Skip to content

API reference

The AI API: addresses, authentication, the Sypnia headers, errors and limits.

Applies to EngineCloud
View as Markdown
On this page
  1. Authentication
  2. The Sypnia headers
  3. Errors

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>:

CredentialWho uses itCan
Secret key syp_sk_…your serversthe 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 minutescalls to tasks with browser: true only
Session, personal or OAuth tokenpeople and agents, through the CLI, App or MCPwhat 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:

JSON
{ "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…" } }
StatusCodes
400invalid_request, tool_not_allowed, input_not_supported, context_too_long
401unauthorized
402insufficient_credits, budget_exceeded, spending_limit_reached
403forbidden, person_required, secret_key_in_browser, task_not_allowed
404not_found, task_not_found, model_not_found
409conflict
413too_large
422content_blocked, output_invalid
429rate_limited, end_user_limit (with retry-after)
502provider_key_failed
503provider_unavailable

A call refused before it reached a model costs nothing. The rate limits of the API itself are in Limits.

  • Endpoints

    Model calls, the catalog, routes, usage, calls, limits, keys, browser tokens and the rest.

  1. Authentication
  2. The Sypnia headers
  3. Errors

    Search pages, sections and terms