Skip to content

How it works

From your app's call to the model's answer, and the record that says what it cost.

Applies to EngineCloud
View as Markdown
On this page
  1. Your app asks for a task
  2. The route decides
  3. Limits and credits are checked first
  4. The provider answers
  5. It is charged and recorded
  6. Where things live
  1. Your app asks for a task

    Your server calls POST https://ai.api.sypnia.com/v1/chat/completions with "model": "task:write" (or the id of a model), the messages, and two headers that say who and what: Sypnia-Case: publish-bread-of-the-day and, when a person of your app is behind it, Sypnia-End-User.

  2. The route decides

    The gateway checks the key and reads the project’s route for write: which model, which fallbacks, the instructions the route always adds, the safety options and the limits.

  3. Limits and credits are checked first

    Requests and tokens per minute, and the caps in credits of the project, the key, the case and the person, are checked. The most the call can cost (its input plus its longest possible answer) is reserved from your credits. If any check fails, the call stops here with a clear error and costs nothing.

  4. The provider answers

    Redaction and content checks run if the route has them. The call goes to the model through OpenRouter or Amazon Bedrock, and the answer streams back to your app as it is written. If the model fails or is too slow, the next model of the route takes over.

  5. It is charged and recorded

    The real tokens are priced and charged, the rest of the reservation goes back to your balance, and the call becomes a span in the trace of its use case in Telemetry: model, tokens, time, cost in credits. What was asked and answered is not kept unless you turned that on.

Where things live

ThingWhere
The APIhttps://ai.api.sypnia.com/v1 Cloud, or your gateway’s address Engine
The MCP serverhttps://mcp.ai.sypnia.com Cloud, or <your gateway>/mcp Engine
The consoleai.app.sypnia.com, and the AI panel of each project in App Cloud
Routes, keys, limits, call recordsthe gateway’s Postgres
What was asked and answerednowhere, unless a route turns it on; then encrypted in object storage for the days you chose
Tracesyour project’s Telemetry, or any OpenTelemetry endpoint
  1. Your app asks for a task
  2. The route decides
  3. Limits and credits are checked first
  4. The provider answers
  5. It is charged and recorded
  6. Where things live

    Search pages, sections and terms