Getting started
The API is OpenAI-compatible. If your code already calls OpenAI, two settings are all that change.
- 1
Create a key
Sign in, open API keys, and create one. The secret is shown once — we store only a hash, so it cannot be recovered afterwards.
- 2
Point your client at us
from openai import OpenAI client = OpenAI( base_url="https://api.aiomodels.dev/v1", api_key="sk_live_...", ) - 3
Make a request
completion = client.chat.completions.create( model="claude-haiku-4-5", messages=[{"role": "user", "content": "Hello"}], ) print(completion.choices[0].message.content)Set
stream=Truefor server-sent events. Token usage arrives in the final frame.
Endpoints
| GET /v1/models | Models available to your account |
| POST /v1/chat/completions | Streaming and non-streaming |
| POST /v1/responses | Responses API, for Codex and the responses wire protocol |
| POST /v1/images/generations | Accepted immediately, billed on completion |
| GET /v1/generations/{id} | Poll an image job |
Errors
Errors use OpenAI's envelope with a request_id for support. 402 means top up, 404 means the model is unknown or not enabled for you, and 503 means the gateway was unavailable — that request is not charged.