API reference
The AI API: addresses, authentication, the Sypnia headers, errors and limits.
On this page
API: https://ai.api.sypnia.com/v1 Cloud, or your gateway’s address followed by /v1 Engine. The model endpoints speak the same language as OpenAI’s.
Authentication
Authorization: Bearer <key or token>:
| Credential | Who uses it | Can |
|---|---|---|
Secret key syp_sk_… | your servers | the project’s own secret key can do everything; a key made for AI has the scopes call (model calls), read (usage, calls, routes) or admin (routes, limits, keys) |
Browser token syp_ait_… | browsers, for one person, 10 minutes | calls to tasks with browser: true only |
| Session, personal or OAuth token | people and agents, through the CLI, App or MCP | what the person’s role allows |
A secret key sent from a browser (the request has an Origin header) is refused. Tokens used by agents cannot apply routes, change limits, create keys or add provider keys: those answer 403 person_required.
The Sypnia headers
Sypnia-Case, Sypnia-End-User, Sypnia-Budget, Sypnia-Store and traceparent, described in Chat and streaming. They work on every model endpoint.
Errors
The shape is OpenAI’s, with a Sypnia code and the call’s id:
{ "error": { "code": "end_user_limit", "type": "rate_limit_error", "message": "This person reached 40 requests today for allergen-answer.", "param": null, "call_id": "call_6f2c…" } }| Status | Codes |
|---|---|
| 400 | invalid_request, tool_not_allowed, input_not_supported, context_too_long |
| 401 | unauthorized |
| 402 | insufficient_credits, budget_exceeded, spending_limit_reached |
| 403 | forbidden, person_required, secret_key_in_browser, task_not_allowed |
| 404 | not_found, task_not_found, model_not_found |
| 409 | conflict |
| 413 | too_large |
| 422 | content_blocked, output_invalid |
| 429 | rate_limited, end_user_limit (with retry-after) |
| 502 | provider_key_failed |
| 503 | provider_unavailable |
A call refused before it reached a model costs nothing. The rate limits of the API itself are in Limits.
Model calls, the catalog, routes, usage, calls, limits, keys, browser tokens and the rest.