Loops that die on one error
A single busy model mid-task and your agent throws away twenty steps of work. Hand-written retry logic never covers every case.
For agent builders
Planning, tool calls, summaries, retries. An agent makes dozens of model calls per task. Route each one by capability, fail over when a model is busy, and see exactly what every step cost.
for every step of every agent loop
token counts and price on every call
a busy model no longer stops the run
The problem
A single busy model mid-task and your agent throws away twenty steps of work. Hand-written retry logic never covers every case.
Agents fan out unpredictably. Without per-call pricing you find out what a task cost long after it ran.
Using your heaviest model to classify a tool result or format JSON burns budget on work a lighter model handles fine.
Capabilities
Ask for reasoning on the planning step and chat on the formatting step. The router sends each to the lowest-priced enabled model that can do it.
If a model is busy or errors, the request moves to another eligible model in the same call, so your loop keeps going.
Send an Idempotency-Key with each step. If your orchestrator retries, the usage is metered once, not twice.
Agents often ask the same question twice. Identical prompts inside the cache window come back instantly and are not billed.
Each call returns input tokens, output tokens, latency and price, ready to attach to the step in your trace.
Set a requests-per-minute ceiling so a runaway loop hits a wall before it hits your budget.
Use cases
Plan with a reasoning model, read and summarise sources with a lighter one, and write the final brief with whichever you name.
Send code generation and review steps with capability code, and keep small planning chatter on cheaper chat models.
Classify the ticket, draft a reply, check tone, escalate. Four calls, one key, a full cost trail.
Agents that read inboxes, fill forms and reconcile records, with history you can audit step by step.
How it works
Sign up, generate an API key in the console and copy it once. We store only a hash.
Send each step to POST /api/ainf/inference with a prompt and a capability, or a model_id when you need a specific model.
Request history and usage dashboards show every step, its tokens, latency and price.
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"}'Yes. Pass a capability and the router picks the lowest-priced enabled model for it, or pass a model_id to pin a step to one model. Mix both in the same agent.
The router tries another eligible model in the same request. You only see an error if no eligible model can complete it.
Not if you send an Idempotency-Key. Usage for a given key is metered once, so a retried step is not counted twice.
Every account gets a free monthly token allowance, so you can build and test an agent before metered pricing applies.
One key, every capability, fail-over built in. Start on the free allowance today.