Relay
Relay Infer Endpoint
The actual metered tier-3 call - request shape, the end-user key header, and exactly what gets billed.
Need the shortest path?
Use Quick Start when you want the smallest working route β scan β graph β run flow first.
Something feels off?
Inspect scan output, graph state, active route/context, and dispatch in a practical order.
Need the full surface?
Browse all runtime methods, hooks, extension points, and lifecycle APIs.
This is the endpoint your app's Cinder config points at for tier-3 fallback, once you have a project's apiKey.
Endpoint
POST /v1/relay/infer
Authorization: Bearer <project apiKey>
Content-Type: application/jsonThe request body is the same normalized fallback shape every tier-3 request uses - see Contracts for the full request/response shape.
Order of operations
Before spending anything on a real provider call, Relay:
- Resolves the project from the
apiKey. - Checks the project's balance is positive. A project at zero balance never reaches the provider at all - not even once.
- Only then runs the real call, then charges for exactly what it cost.
A failed provider call is never billed - you don't pay for an error.
If the project's keyPolicy is "end_user"
Pass the end user's own provider key with each request - it is never stored:
POST /v1/relay/infer
Authorization: Bearer <project apiKey>
x-end-user-ai-key: sk-ant-...
Content-Type: application/json
{ "text": "...", "graph": { "routes": ["..."] } }Omitting this header on an end_user-policy project is rejected with 400, not silently resolved some other way.
Response
{
"intent": "navigate",
"target": "loans-overdue",
"confidence": 0.9,
"_relay": { "estimatedCostCents": 0.01, "balanceCents": 449.99 }
}The _relay field is Relay's own addition on top of the normal infer response - your app can ignore it, or surface the running balance to a user if that's useful.
Continue reading