Capacity reports
A listing says what you sell. A capacity report says whether you can take a request right now. Without a fresh one, buyers do not select your route.
The endpoint
curl -s https://gpu.example.com/im/v1/capacity
curl -s 'https://gpu.example.com/im/v1/capacity?route_id=a19636a556af82613e788bb2e7c32d084902d99b1f04ede436642d90b819f245'
The response is always a JSON array with one signed envelope per listed route (A12); ?route_id= filters it to that route, or to an empty array if the ID is not listed. Each report is signed by your listing key:
[
{
"doc": {
"route_id": "a19636a556af82613e788bb2e7c32d084902d99b1f04ede436642d90b819f245",
"in_flight": 11,
"max_concurrency": 64,
"headroom": 53,
"queue_depth": 0,
"observed_at": 1795000000
},
"sig": "v8+tJP7h/xK6P7deYlHCyP01ZtyjamdaZLPFhNmjfl9mOakIUQyqQ1/Wup/SfJ7eQ0nD7mOV8lbpAK/PofJJBQ==",
"key": "GUUbVoGEge8fGv6GfZtqRfCCCxRzX7NAcDF1EjeinYMA"
}
]
| Field | Reference gateway value |
|---|---|
in_flight |
Admitted requests currently running on the route (after Hold check, body upload and durable claim). |
max_concurrency |
serving.max_concurrency from the route's model identity. |
headroom |
max_concurrency − in_flight, or 0 while the gateway is draining or in maintenance. |
queue_depth |
Always 0: the gateway does not queue; it refuses at the limit. |
observed_at |
Unix seconds when the report was signed. |
The gateway re-signs a report only when the second or the counts change, so the endpoint is cheap to poll.
Who reads it, and how fresh it must be
| Reader | Rule |
|---|---|
| Discovery indexer | Crawls each pinned seller every crawlIntervalMs (30 s by default), fetching the listing and capacity. It rejects a report whose signer is not the seller key, whose observed_at is in the future or 120 s old or older, or whose counts are inconsistent (in_flight > max_concurrency, or headroom > max_concurrency − in_flight). A route without a valid report is served with capacity: null. |
| SDK planner | Selects a route only if it has a verified report that is not expired and headroom > 0, and never runs more concurrent requests on it than the advertised headroom. |
| Onboarding self-check | Fails a report older than 120 s or from the future and warns above 90 s; fails if max_concurrency exceeds the listed value. |
| Prober | Measures actual behaviour in waves at concurrency 1, 4, 16 and 64, up to the limit its operator configured for your seller, independently of what you advertise (probe measurements). |
null capacity means "no fresh verified evidence", never "zero load". Keep host clocks synchronized with NTP: a gateway clock ahead of the indexer's makes reports look future-dated, and one behind makes them look stale.
Advertise what you can serve
- Admission enforces the number you advertise. When
in_flightreachesmax_concurrency, the next valid Hold gets HTTP 429no_headroomwithRetry-After: 1. Nothing is billed. - Match the engine. Set
serving.max_concurrencyto what your engine actually runs concurrently (for vLLM,--max-num-seqs). If the engine refuses first, buyers getbackend_rejectedinstead of a clean 429, and probers record failures. - Uploads are separate. A request occupies an inference slot only after its body is fully received and its claim is durable. Each route allows
max_concurrency + 8concurrent body uploads, and each sessionmax(4, max_concurrency); beyond that, 503ingress_busywithRetry-After: 1. - Changing
max_concurrencychanges the route ID, because it is part of the model identity (model identity).
Draining
During a rolling deploy or --control maintenance, every report advertises headroom: 0, so buyers stop selecting the route before new Holds would be refused with 503 gateway_draining (operations).