Cost optimization

Spend less, ship the same

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.

Right-sized models

for every task

Free repeats

cache hits cost nothing

No double metering

with idempotency keys

The problem

What is slowing you down today

Heavyweight by default

Using your most capable model for every call is the most expensive habit there is.

Paying for the same answer

Repeated prompts billed again and again.

Responses longer than needed

Unbounded output means unbounded cost.

Capabilities

Everything you need, nothing you don't

Route by capability

Send a capability instead of a model name, and the router picks the lowest-priced enabled model that can do it.

Compare before you call

Sort the model catalog by price and test candidates in the playground.

Cap max_tokens

Set max_tokens to the longest useful answer. You pay for output tokens produced.

Design for cache hits

Identical prompt, model and temperature inside the cache window is a free cache hit. Keep prompts stable.

Idempotent retries

An Idempotency-Key on every request means retries are metered once.

Watch the dashboard

Daily and month-to-date usage show where spend is growing before the invoice does.

Use cases

What teams run on it

01

Classification

Lower-priced chat models with temperature 0 and short max_tokens.

02

FAQ answers

Stable prompts that hit the cache.

03

Batch enrichment

Idempotency keys per item and paced workers.

04

Mixed agent steps

Reasoning only where reasoning is needed.

How it works

From sign-up to production

  1. 1

    Measure

    Use per-response price and the usage dashboard to find your biggest spenders.

  2. 2

    Right-size

    Move routine calls to capability routing or lower-priced models.

  3. 3

    Trim and reuse

    Cap max_tokens and stabilise prompts for cache hits.

Control

Built so you stay in charge

Keys you control

API keys are shown once at creation and stored only as a hash. Revoke any key instantly from Settings.

Spend you can see

Every request carries its own receipt: tokens in, tokens out, latency and price. Nothing is billed that you cannot trace.

Limits you set

Per-account rate limits and a free monthly allowance keep experiments safe before they become production.

Data you decide on

You choose exactly what you send. Repeat prompts can be served from your cache, and cache hits are never billed.

For developers

One endpoint. Every model.

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"}'

Questions, answered

What is the single biggest saving?

Usually sending routine work to a lower-priced model by requesting a capability rather than pinning your most capable model.

Are cached responses really free?

Yes. Cache hits report a price of zero.

Do failed attempts cost anything?

No. You pay for calls that succeed, at the price of the model that served them.

How do I know what a change saved?

Compare price_micros on responses and daily totals in the usage dashboard before and after.

Find your first saving today

Open the usage dashboard and the model catalog side by side.