Models & pricing
Choose a callable model, check its capabilities, and understand what each request costs. Model prices are quoted in USD per million tokens; your charge depends on the token buckets actually used.
Choose a model
Use GET /models with your key for the current callable model list. Copy an entry's id into the model field of your request rather than guessing a name from its display label.
The model directory also shows prices and capabilities. Check availability, context size, and support for tools or images before changing a production workload. Models sharing an endpoint do not necessarily share every feature.
curl https://api.straitly.ai/v1/models \ -H "Authorization: Bearer $STRAITLY_API_KEY"
The token rates
- Input
- Fresh tokensNew input tokens that are not accounted for as cache reads or cache writes.
- Cache read
- Reused inputInput served from an existing prompt cache, billed at the model's cache-read rate.
- Cache write
- Stored inputInput written into the cache. When a model has separate 5-minute and 1-hour write rates, use the applicable rate.
- Output
- Generated tokensThe model's billable output tokens. Use reported usage, not the length of visible text, when reconciling a request.
Cached tokens are part of input accounting, not extra fresh input to count a second time. Activity separates the buckets so you can reconcile the charge.
Calculate a charge
Multiply each token bucket by its applicable per-million rate, add the results, and divide by 1,000,000. Include a separate 1-hour cache-write term when that rate exists.
charge_usd = (
fresh_input_tokens * input_rate
+ cache_read_tokens * cache_read_rate
+ cache_write_5m_tokens * cache_write_5m_rate
+ cache_write_1h_tokens * cache_write_1h_rate
+ output_tokens * output_rate
) / 1_000_000- Example input
- $0.0021,000 fresh input tokens at an illustrative $2 per million.
- Example output
- $0.003500 output tokens at an illustrative $6 per million.
- Example total
- $0.005No cached tokens in this example. These are sample rates, not a live model quote.
Use the customer rates shown in the directory. Do not apply a discount a second time to a rate that already includes it.
Discounts and payment
Every model is priced below the provider's list price, and the discount is already in the token rates. Use the model directory for each model's current rate.
Billing is prepaid. When your balance is exhausted, requests are rejected with 402 insufficient_credits. A per-key spend cap can stop a key even when the account still has a balance.
Failed requests are not billed. For interrupted streams or a disputed charge, inspect the recorded request status and charge in Activity rather than estimating from the text you received.
Cache-write durations
Prompt caching is model-specific. A 5-minute cache write and a 1-hour cache write can have different prices; they must not be treated as one universal write rate.
The billing code tracks these durations separately. Where no distinct 1-hour price exists, the model's configured fallback rate applies. Check the current rate card and request details for the model you use.
Reconcile your usage
- Open Activity and select a request to inspect token buckets, status, and the charge.
- Use the recorded request-time charge for historical spend. Multiplying old usage by today's prices may produce a different total.
- Export filtered usage as CSV or JSON when reconciling an invoice or comparing workloads.