Authentication
The only endpoint you can call without a key is the public model catalog (GET /v1/models). Everything else requires a Kadraris API key. A key is not tied to a model or an endpoint: the same one works across the whole API and charges your account balance.
Which header to use
The API reads the key from either of two headers. Pick the one your client already sends.
| Header | Value | Usually sent by |
|---|---|---|
Authorization | Bearer sk-kd-... | curl, the OpenAI SDK, generic HTTP tools |
x-api-key | sk-kd-... | the Anthropic SDK, Claude Code |
# Bearer
curl https://kadraris.com/v1/balance -H "Authorization: Bearer $KADRARIS_API_KEY"
# x-api-key
curl https://kadraris.com/v1/balance -H "x-api-key: $KADRARIS_API_KEY"import os, requests
headers = {"Authorization": f"Bearer {os.environ['KADRARIS_API_KEY']}"}
print(requests.get("https://kadraris.com/v1/balance", headers=headers).json())const res = await fetch("https://kadraris.com/v1/balance", {
headers: { "x-api-key": process.env.KADRARIS_API_KEY },
});
console.log(await res.json());Official SDKs need two things from you, the key and the base URL. Note that the Anthropic client takes the domain without /v1:
from openai import OpenAI
from anthropic import Anthropic
openai_client = OpenAI(base_url="https://kadraris.com/v1", api_key="sk-kd-...")
anthropic_client = Anthropic(base_url="https://kadraris.com", api_key="sk-kd-...")Getting a key
- Log in and go to the dashboard.
- Under API keys, create a key and label it, for example
n8norprod-backend. - If you want, give it a monthly spend limit.
- Copy the value now. After you close the dialog it cannot be shown again.
A key is the prefix sk-kd- followed by 32 characters:
sk-kd-4f9c2a7e1b8d3f6a0c5e9b2d7a1f4c8eLost a key? There is no way to recover it. Make a new one, then remove the old one from the dashboard.
Capping spend per key
You can attach a monthly spend limit to any key when you create it. This is useful for keys you hand to a staging setup, a client project or an automation that could run in a loop by mistake.
A request that would take the key over its cap is rejected with 403:
{ "error": { "type": "permission_error", "message": "This key reached its monthly spend limit. Create a new key with a higher limit in the dashboard or use another key." } }Nothing is taken from your balance in that case. To keep going, switch to a different key or create a new one with a higher cap. Each limit covers only its own key; the overall ceiling for the account is simply how much balance you have (see Billing).
Auth-related errors
| Status | error.type | Reason |
|---|---|---|
| 401 | authentication_error | No key, a malformed key, or a key that was deleted |
| 402 | insufficient_balance | The key is fine, but there is not enough balance |
| 403 | permission_error | The key hit its spend limit |
Every error type is listed in Errors.
Handling keys safely
- Call the API from your server only. A key inside frontend code, a mobile app or a public repo can be copied by anyone.
- Give each application or environment its own key. Then you can revoke one without touching the others.
- Load keys from environment variables or a secrets manager rather than committing them.
- If a key is exposed, delete it in the dashboard straight away. Any later request using it gets
401.























