Credits & Billing

Tchavi uses a credit-based billing system — each API request consumes credits based on the model used and the number of tokens processed.

Tchavi uses a credit-based billing system. Each API request consumes credits based on the model used and the number of tokens processed.

How credits are calculated

  • Chat models: Input and output are billed per token, each at its own rate, and the total is rounded up once to a thousandth of a credit:

    text
    credits = ceil( (input_tokens × input_rate + output_tokens × output_rate) / 1000 , 0.001 )

    There is no minimum per request and no rounding per side: a 40-token question at 1 credit per 1K costs 0.04 credits, not 1. Credits carry three decimals everywhere — balances, X-Credits-Used, usage logs.

  • Cached input: when a provider serves part of your prompt from its cache, those tokens are billed at a cache rate of their own, not the input rate. See Prompt caching below.

  • Image models: Flat credit cost per image. GPT Image bills by quality (low / medium / high), Nano Banana by resolution (0.5K to 4K), FLUX.2 and Seedream a single flat rate. Rectangular sizes carry a 1.5× surcharge, applied exactly.

  • TTS (text-to-speech): Credits per 1K characters of input text, billed per character (1 234 characters at 32 credits/1K cost 39.488 credits)

  • Transcription (Whisper): Credits per minute of audio, rounded up to the next whole minute (the provider's own billing unit)

  • Video models: Credits per second of video, varies by resolution (some models add a surcharge when audio is generated). Motion-control models, whose output length follows a reference video (e.g. kling-v3-motion-control), reserve credits at the maximum possible length upfront and automatically refund the unused part once the actual length is known.

Response headers

Every API response includes metadata headers:

HeaderDescription
X-Credits-UsedCredits consumed by this request
X-Credits-RemainingYour current credit balance
X-RateLimit-RPM-LimitYour requests-per-minute limit
X-RateLimit-RPM-RemainingRequests remaining in the current minute
X-RateLimit-TPM-LimitYour tokens-per-minute limit
X-RateLimit-TPM-RemainingToken budget remaining in the current minute
X-Request-IdUnique request ID for support/debugging
Retry-AfterSeconds to wait before retrying (on 429 responses)

Example credit calculation. A request with 500 input tokens + 200 output tokens on a model priced at 1 cr/1K input and 2 cr/1K output (illustrative rates) costs:

text
500 × 1 / 1000  =  0.500 credits  (input)
200 × 2 / 1000  =  0.400 credits  (output)
                   ─────────────
                   0.900 credits

This request costs 0.9 credits, exactly its proration. A message ten times shorter costs ten times less, so there is no penalty for many small requests; the only thing that changes your bill is the number of tokens and the model.

X-Credits-Used on every response tells you exactly what a call cost, so you never have to work it out by hand. The exact rate for each model is shown in the Models table.

Prompt caching

Agents and chat apps resend the same conversation on every turn. Providers keep the repeated prefix in a cache and charge a fraction of the normal price to read it back. Tchavi passes that straight through: a cached input token costs a tenth of the input rate.

Token classRateWhen it applies
Inputthe model's input ratetokens the model processed fresh
Cached input0.1 × input ratetokens the provider served from its cache
Cache write1.25 × input ratetokens written to the cache, on providers that charge for it
Outputthe model's output rategenerated tokens

On OpenAI models this is automatic — prompts above roughly 1 000 tokens are cached by the provider with no change to your code, and repeated calls simply cost less. Anthropic models do not pass cache markers through yet, so a Claude conversation is currently billed entirely at the input rate.

The difference is large for a long-running agent. A turn that sends 120 000 tokens of context, of which 110 000 is a repeat, costs a quarter of what it would at the flat input rate.

Your usage log records the three input classes separately, so you can see how much of a request was a cache hit.

Cache rates are only applied to models where the provider's cache pricing has been verified. Everywhere else a cached token is billed at the ordinary input rate, which is what Tchavi did for every model before this existed — never more than the rate shown in the Models table.

Recharging

Buy credits from your billing dashboard using mobile money. The full list of supported operators and countries is published live at /api/payments/providers. Top-ups start at 1 000 FCFA, credits are added instantly after payment, and they never expire. There is no signup bonus: your first top-up carries a +300 bonus credits, and it also moves your account from the Free level to Builder (see Rate Limits).

See also Rate Limits and Error Handling.

On this page