Thirdeye AI pay-per-call inference

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

MethodPathPurpose
GET/api/v1/modelsPublic model catalogue with per-model pricing. The only endpoint that needs no key.
POST/api/v1/chat/completionsChat completions, streaming or buffered, with tool calling.
GET/api/keysList your keys with per-key credit, budget and rate limits.
POST/api/keysIssue a key. The secret is shown once.
POST/api/payments/intentCreate a deposit intent, optionally tagged to one key.
GET/api/stats/meYour usage by day, with tokens and billed cost.
POST/api/feedbackPublic issue or idea intake. Anonymous is allowed.

Billing headers

HeaderMeaning
x-thirdeye-cost-usdThe billed amount for this call, including margin. This is the number to quote.
x-thirdeye-key-credit-remaining-usdCredit left on the key that paid, when the key carries its own balance.
x-thirdeye-key-budget-remaining-usdSpend 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

StatusCodeMeaning
401authNo valid session or key.
402insufficient_credit / budget_exceededThe account or the key cannot cover the call.
404model_not_foundThe model is not in the catalogue.
429rate_limitThe key is over its RPM or TPM window, or the endpoint is protecting itself.