Skip to content

Credits and usage

How a call is priced, reserved and charged, and where you see what each case and each person spent.

Applies to EngineCloud
View as Markdown
On this page
  1. What a call costs
  2. Reserved first, charged after
  3. Where you see it

What a call costs

A model has a price for each million tokens it reads and each million it writes; some charge less for tokens they read again soon after (Caching). A call costs:

tokens read × read price + tokens written × write price

In Sypnia Cloud the prices are in credits and shown in the catalog (ai models). Self-hosted, the gateway uses your providers’ prices, in their currency, from its price table.

Reserved first, charged after

  1. Before the call, the most it could cost (what it reads, plus its longest possible answer, max_output_tokens) is reserved from your prepaid credits. If your balance cannot cover it, the call still runs during the 7 days of grace and is taken from your next top-up; after them it stops with 402 insufficient_credits and costs nothing.
  2. After the call, the real tokens are charged and the rest of the reservation returns to your balance at once.

A smaller max_output_tokens reserves less, so many calls at the same time fit in the same balance.

Where you see it

WhereWhat it shows
App, project board and ledgerAI spending per case, next to the rest of the project’s spending
ai.app.sypnia.comusage by day, and by case, task, key, person and model, with the month’s pace
npx @sypnia/ai usage --by case --since 30dthe same in your terminal; --csv to export
GET /v1/usage?group_by=casethe same through the API

Usage of La Espiga for one month, by case:

CaseCallsTokens readTokens writtenShare of credits
ask-about-a-product1,840760,00071,00071 %
publish-bread-of-the-day305,5001,9004 %
find-products2,41096,000—25 %
  1. What a call costs
  2. Reserved first, charged after
  3. Where you see it

    Search pages, sections and terms