API reference · BYOK
Attach a provider credential
POST/api/provider-keysSigned in session
Inference then bills to your provider account while Antimatter keeps routing, metering, and dashboards. Antimatter charges no credits for a BYOK request and marks the response x-antimatter-byok: 1. A key is used only for the models this deployment serves through that provider directly (GET says which, as servedHere), never by an agent's key, and a BYOK answer is never cached. Saving a second key for a provider revokes the first.
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| providerrequired | string | One of "openrouter", "openai", "anthropic", "google", "deepseek", "xai", "mistral", "groq", "cerebras", "together", "fireworks". |
| keyrequired | string | |
| label | string |
Example
{
"provider": "openrouter",
"key": "string",
"label": "string"
}Answer 201
Stored.
| Field | Type | What it is |
|---|---|---|
| providerKey | ProviderKey | |
| providerKey. | integer | |
| providerKey. | string | One of "openrouter", "openai", "anthropic", "google", "deepseek", "xai", "mistral", "groq", "cerebras", "together", "fireworks". |
| providerKey. | string or null | |
| providerKey. | integer | |
| providerKey. | integer or null | |
| providerKey. | integer or null |
Errors
- 400OpenAI 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.