API guide
OpenAI-compatible at the edge, with per-call billing attached to every response.
Authentication
Two paths, both a bearer token. A signed-in session uses the cookie the app sets; programmatic callers use an API key issued in the app.
GET /api/v1/models
authorization: Bearer $THIRDEYE_API_KEY
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/models | Public model catalogue with per-model pricing. The only endpoint that needs no key. |
| POST | /api/v1/chat/completions | Chat completions, streaming or buffered, with tool calling. |
| GET | /api/keys | List your keys with per-key credit, budget and rate limits. |
| POST | /api/keys | Issue a key. The secret is shown once. |
| POST | /api/payments/intent | Create a deposit intent, optionally tagged to one key. |
| GET | /api/stats/me | Your usage by day, with tokens and billed cost. |
| POST | /api/feedback | Public issue or idea intake. Anonymous is allowed. |
Billing headers
| Header | Meaning |
|---|---|
x-thirdeye-cost-usd | The billed amount for this call, including margin. This is the number to quote. |
x-thirdeye-key-credit-remaining-usd | Credit left on the key that paid, when the key carries its own balance. |
x-thirdeye-key-budget-remaining-usd | Spend left under the key's monthly ceiling, when one is set. |
Do not compute cost from the catalogue and present it as the price you paid: catalogue rates exclude the platform margin, so the arithmetic understates the real charge by roughly ten percent.
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | auth | No valid session or key. |
| 402 | insufficient_credit / budget_exceeded | The account or the key cannot cover the call. |
| 404 | model_not_found | The model is not in the catalogue. |
| 429 | rate_limit | The key is over its RPM or TPM window, or the endpoint is protecting itself. |