Heavyweight by default
Using your most capable model for every call is the most expensive habit there is.
Cost optimization
Most inference spend is avoidable. Use the right model for each job, stop paying for repeats, cap output length and make retries safe. Every lever is in your hands.
for every task
cache hits cost nothing
with idempotency keys
The problem
Using your most capable model for every call is the most expensive habit there is.
Repeated prompts billed again and again.
Unbounded output means unbounded cost.
Capabilities
Send a capability instead of a model name, and the router picks the lowest-priced enabled model that can do it.
Sort the model catalog by price and test candidates in the playground.
Set max_tokens to the longest useful answer. You pay for output tokens produced.
Identical prompt, model and temperature inside the cache window is a free cache hit. Keep prompts stable.
An Idempotency-Key on every request means retries are metered once.
Daily and month-to-date usage show where spend is growing before the invoice does.
Use cases
Lower-priced chat models with temperature 0 and short max_tokens.
Stable prompts that hit the cache.
Idempotency keys per item and paced workers.
Reasoning only where reasoning is needed.
How it works
Use per-response price and the usage dashboard to find your biggest spenders.
Move routine calls to capability routing or lower-priced models.
Cap max_tokens and stabilise prompts for cache hits.
Control
API keys are shown once at creation and stored only as a hash. Revoke any key instantly from Settings.
Every request carries its own receipt: tokens in, tokens out, latency and price. Nothing is billed that you cannot trace.
Per-account rate limits and a free monthly allowance keep experiments safe before they become production.
You choose exactly what you send. Repeat prompts can be served from your cache, and cache hits are never billed.
For developers
Send a prompt and a capability, or name a model. One bearer key, one small JSON body, and a full receipt on every response.
curl https://YOUR-DOMAIN/api/ainf/inference \
-H "Authorization: Bearer $AI_INFERENCE_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d '{"prompt":"Summarise this ticket in one line","capability":"chat"}'Usually sending routine work to a lower-priced model by requesting a capability rather than pinning your most capable model.
Yes. Cache hits report a price of zero.
No. You pay for calls that succeed, at the price of the model that served them.
Compare price_micros on responses and daily totals in the usage dashboard before and after.
Open the usage dashboard and the model catalog side by side.