API Credits
Pay as you go, per token, from a prepaid balance, with cached input at a lower price.
Calls with an API key are paid from prepaid credits, per token. Credits are separate from every plan: you do not need a plan to call the API, and a plan never uses your credits.
Prices
| Raven Flash | Raven Max | |
|---|---|---|
| Input | $0.50 / 1M tokens | $1.25 / 1M tokens |
| Cached input | $0.05 / 1M tokens | $0.13 / 1M tokens |
| Output | $2.50 / 1M tokens | $6.25 / 1M tokens |
Prices are in US dollars. Output includes reasoning tokens. Cached input is the part of your input the model reports as already cached (usage.prompt_tokens_details.cached_tokens); it is applied on its own, with no flag, and a long prefix you repeat (a system prompt, a document) is where it helps most. Pricing shows the same prices.
The debit formula
Each request costs (input - cached) x input price + cached x cached price + output x output price, with the prices per 1M tokens, rounded to a millionth of a dollar. For example, on Raven Flash with 2,000 new input tokens, 8,000 cached input tokens and 1,000 output tokens:
fresh input 2,000 x $0.50 / 1M = $0.0010cached input 8,000 x $0.05 / 1M = $0.0004output 1,000 x $2.50 / 1M = $0.0025total $0.0039The same counts are in the usage of every answer. In the Messages format, input_tokens already leaves out the cached part, which is cache_read_input_tokens.
Add credits
- Open Billing on your dashboard.
- Choose Add credits and a pack: $5, $10, $20 and $50.
- Pay at checkout.
- Credits never expire, and every API key on your account draws on the same balance.
- Credit purchases are non-refundable.
- The Activity page of your dashboard lists each request with its key, model, tokens and cost; Billing shows your balance day by day.
What happens at zero
Before a request runs, the API checks your balance. If it is zero or below, the request is refused with 402 and nothing is sent to the model:
{ "error": { "message": "Insufficient API credits: your balance is ...", "type": "insufficient_credits", "code": "insufficient_credits" }}A request that runs is debited after it finishes, from the tokens it used. So the last request before your balance runs out can take it a little below zero; the next one is refused. A request that fails is not debited.