API
Developer API
OpenAI-compatible endpoints for text, images and audio, paid in WIT from your wallet. Prompts are never stored.
Overview
The Allwit API speaks the OpenAI request and response shapes, so the official `openai` SDKs and most tools that support a custom base URL work as they are. The base URL is `https://www.allwit.ai/api/v1`. You authenticate with an API key created in the app, and every request is paid in WIT from the wallet that owns the key.
- 01Create a keySign in to the app and open API keys. Name the key and copy it: it is shown once.
- 02Point your client at AllwitSet the base URL to `https://www.allwit.ai/api/v1` and the API key to your `aw_live_…` key. Nothing else changes.
- 03Pick a model`GET /models` lists what you can call, with each model's WIT price and privacy label.
- AuthenticationAPI keys, the Authorization header, revoking.
- Models and pricingThe model list, WIT per request, Private and Blind.
- Chat completionsPOST /chat/completions, with streaming.
- ImagesPOST /images/generations.
- TranscriptionsPOST /audio/transcriptions.
- SpeechPOST /audio/speech.
- VideosPOST /videos/generations: asynchronous jobs.
- ErrorsThe error shape and every code.
- Rate limitsRequests per minute per key, and Retry-After.
How a request is charged
WIT is charged per request. Before a request is routed, Allwit reserves its estimated cost from your wallet: for text, the prompt tokens plus `max_tokens` at the model's price; for images, the per-image price times `n`; for speech, the price per 1,000 characters of input; for transcription, the minutes the upload's size suggests. When the model answers, the actual cost is settled and the rest of the reservation returns to your balance. If the request fails before anything is produced, nothing is charged. Video jobs are the exception: their price is charged in full when the provider accepts the job, and refunded in full if the job fails.
- Every response carries what you paid, in WIT: `allwit.wit_charged` in JSON responses, the `x-allwit-wit-charged` header on audio bytes. One US dollar is 100 WIT; amounts are whole numbers (`3` is three cents).
- A request that the content moderation blocks is refused and costs nothing: the API moderates before it reserves. (In the chat app a blocked request costs the minimum charge of 1 WIT.)
- If the wallet cannot cover the estimate you get 402 and nothing is reserved. Buy WIT in the app at /app/wit.
Nothing is kept
Allwit does not store or log request or response bodies, transcripts or audio. A usage record holds only the wallet, the key id, the model, the time, the WIT charged and the outcome. A moderation record holds only the verdict, a category, the stage and the time. There is no column anywhere for a prompt, and the request logging and error tracking cannot capture bodies.
Quick start
curl https://www.allwit.ai/api/v1/chat/completions \
-H "Authorization: Bearer $ALLWIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3.8-27b",
"messages": [{"role": "user", "content": "Explain blind routing in one sentence."}],
"max_tokens": 200
}'from openai import OpenAI
client = OpenAI(
base_url="https://www.allwit.ai/api/v1",
api_key="aw_live_…", # from /app/account/api-keys
)
completion = client.chat.completions.create(
model="qwen/qwen3.8-27b",
messages=[{"role": "user", "content": "Explain blind routing in one sentence."}],
max_tokens=200,
)
print(completion.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://www.allwit.ai/api/v1",
apiKey: process.env.ALLWIT_API_KEY, // aw_live_…
});
const completion = await client.chat.completions.create({
model: "qwen/qwen3.8-27b",
messages: [{ role: "user", content: "Explain blind routing in one sentence." }],
max_tokens: 200,
});
console.log(completion.choices[0].message.content);The OpenAPI document is at `https://www.allwit.ai/api/v1/openapi.json`.