API reference · Keys
Set a key's policy
PATCH/api/keys/{id}/policySigned in session
Daily and monthly budgets in micro USD, a requests per day ceiling, a model allowlist and blocklist, a per request cost ceiling, an output token ceiling, the wires the key may use, and the comparable fallback. Send only the fields to change; null clears one. A key that hits a limit answers 429 or 403 with the policy_exceeded type and starts working again when the window rolls over. Every guardrail is enforced on every wire the key can use, batch lines included; x402 requests carry no key and no policy.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | integer | The key id. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| dailyBudgetMicros | integer or null | Micro USD. Null means unlimited. |
| monthlyBudgetMicros | integer or null | Micro USD. Null means unlimited. |
| requestsPerDay | integer or null | Null means unlimited. |
| modelAllowlist | array of string or null | |
| maxCostPerRequestMicros | integer or null | Micro USD. A request whose worst case (prompt estimate plus max_tokens at the catalog's prices, across its whole fallback chain) is over this is refused before dispatch with 403 request_cost_exceeded, and so is one naming a model with no published price. On the image and audio doors the worst case is the hold that request would place. Null means unlimited. |
| maxOutputTokens | integer or null | max_tokens is lowered to this, below the deployment ceiling, and x-antimatter-route-warning says so. Null means the deployment ceiling. |
| modelBlocklist | array of string or null | Ids this key never reaches: named, they are refused (or dropped from the models chain, with a warning); routed, autopilot never picks them. |
| allowedWires | array of string or null | The wires this key may use. A batch line is held to batch, whatever its url; images is /v1/images/generations and audio is both /v1/audio/speech and /v1/audio/transcriptions. Null means every wire; a refusal is 403 policy_violation. |
| comparableFallback | boolean | Fall back to the nearest comparable, no dearer world on a retriable failure, as x-antimatter-fallback: comparable does per request. x-antimatter-fallback: off turns it off for one request. |
| strictJson | boolean | Check every JSON answer (a response_format of json_object or json_schema) before it is handed over and repair it once, as x-antimatter-json: strict does per request; such a request may not stream. x-antimatter-json: off turns it off for one request. |
| compress | string or null | Compress every request the key sends, as x-antimatter-compress does per request. Null is off; x-antimatter-compress: off turns it off for one request. One of "safe", "aggressive". |
| marketplaceOff | boolean | Keep every request this key sends on the house route: no inference marketplace provider is ever a candidate for it, whatever its price. |
| piiRedact | string or null | Replace emails, phone numbers, Luhn checked card numbers, IBANs and US and UK government ids in every message with typed placeholders before the request leaves. restore also puts the values back into the answer. Null is off. The answer says how many in x-antimatter-pii-redacted. One of "redact", "restore". |
| autoCache | boolean or null | Automatic prompt caching. True places cache markers on a prompt's repeated start (the system prompt and tools, or the conversation so far) for worlds that take them; false never does; absent or null follows the deployment. x-antimatter-auto-cache: on or off decides for one request. |
| hedgeMs | integer or null | Hedged requests: when the first source has sent no byte in this many milliseconds, a second source of the same world at the same card is asked and the first answer wins. Needs hedgeMaxMicros. x-antimatter-hedge decides per request. |
| hedgeMaxMicros | integer or null | The most a hedge's cancelled loser may add to a request's charge (its prompt bound at the card), in micro dollars. A hedge that could cost more is never sent. |
| coalesce | boolean | Identical requests from this key's account in flight at once share one upstream call. Each is billed as if it were alone, unless the deployment states a shared discount; the answer says x-antimatter-coalesced. |
Example
{}Answer 200
The stored policy.
| Field | Type | What it is |
|---|---|---|
| policy | KeyPolicy | |
| policy. | integer or null | Micro USD. Null means unlimited. |
| policy. | integer or null | Micro USD. Null means unlimited. |
| policy. | integer or null | Null means unlimited. |
| policy. | array of string or null | |
| policy. | integer or null | Micro USD. A request whose worst case (prompt estimate plus max_tokens at the catalog's prices, across its whole fallback chain) is over this is refused before dispatch with 403 request_cost_exceeded, and so is one naming a model with no published price. On the image and audio doors the worst case is the hold that request would place. Null means unlimited. |
| policy. | integer or null | max_tokens is lowered to this, below the deployment ceiling, and x-antimatter-route-warning says so. Null means the deployment ceiling. |
| policy. | array of string or null | Ids this key never reaches: named, they are refused (or dropped from the models chain, with a warning); routed, autopilot never picks them. |
| policy. | array of string or null | The wires this key may use. A batch line is held to batch, whatever its url; images is /v1/images/generations and audio is both /v1/audio/speech and /v1/audio/transcriptions. Null means every wire; a refusal is 403 policy_violation. |
| policy. | boolean | Fall back to the nearest comparable, no dearer world on a retriable failure, as x-antimatter-fallback: comparable does per request. x-antimatter-fallback: off turns it off for one request. |
| policy. | boolean | Check every JSON answer (a response_format of json_object or json_schema) before it is handed over and repair it once, as x-antimatter-json: strict does per request; such a request may not stream. x-antimatter-json: off turns it off for one request. |
| policy. | string or null | Compress every request the key sends, as x-antimatter-compress does per request. Null is off; x-antimatter-compress: off turns it off for one request. One of "safe", "aggressive". |
| policy. | boolean | Keep every request this key sends on the house route: no inference marketplace provider is ever a candidate for it, whatever its price. |
| policy. | string or null | Replace emails, phone numbers, Luhn checked card numbers, IBANs and US and UK government ids in every message with typed placeholders before the request leaves. restore also puts the values back into the answer. Null is off. The answer says how many in x-antimatter-pii-redacted. One of "redact", "restore". |
| policy. | boolean or null | Automatic prompt caching. True places cache markers on a prompt's repeated start (the system prompt and tools, or the conversation so far) for worlds that take them; false never does; absent or null follows the deployment. x-antimatter-auto-cache: on or off decides for one request. |
| policy. | integer or null | Hedged requests: when the first source has sent no byte in this many milliseconds, a second source of the same world at the same card is asked and the first answer wins. Needs hedgeMaxMicros. x-antimatter-hedge decides per request. |
| policy. | integer or null | The most a hedge's cancelled loser may add to a request's charge (its prompt bound at the card), in micro dollars. A hedge that could cost more is never sent. |
| policy. | boolean | Identical requests from this key's account in flight at once share one upstream call. Each is billed as if it were alone, unless the deployment states a shared discount; the answer says x-antimatter-coalesced. |
Errors
- 400OpenAI shaped error.
- 404OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.