Rewrites for every vendor
Changing models should not mean changing your whole client layer.
Migration
If your app already sends chat-style requests over HTTP, moving is mostly configuration. Change the base URL, swap in your key, and map your message text into the prompt field.
plus a small body mapping
temperature and max_tokens carry over
routing, fail-over and caching included
The problem
Changing models should not mean changing your whole client layer.
Your retry-and-switch code is the least tested part of your stack.
Your current setup reports tokens, but not what each call actually cost.
Capabilities
Send requests to https://<your-host>/api/ainf/inference instead of your current completion endpoint.
Authorization: Bearer <key> works the same way. Only the key value changes.
Join your system and user message text into a single prompt string. Most integrations do this in one helper function.
temperature and max_tokens keep their familiar names and meaning.
Replace hard-coded model names with a catalog model_id, or drop them and send a capability.
Your text is in result.response; usage is in result.input_tokens, output_tokens and total_tokens; the price is in result.price_micros.
Use cases
Summaries, rewrites and extraction move over with almost no change.
Serialise the conversation into the prompt in a consistent format.
Add an Idempotency-Key per item so restarts are metered once.
Send a share of traffic to the new endpoint behind a flag and compare.
How it works
Update configuration to the new endpoint and bearer key.
Build prompt from your messages; read result.response and usage fields.
Retire your own fail-over and caching code once traffic is stable.
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"}'It is close but not identical. The auth header, temperature and max_tokens carry over; your message text goes into a single prompt field.
No. Any client that can send JSON over HTTPS works, including the one you already use, once pointed at the new base URL.
Yes. Find it in the catalog and pass its model_id.
Run your real prompts in the playground, then route a small share of traffic to the new endpoint.
Change a URL, map one field, and gain routing, fail-over and caching.