Keep your SDK. Connect your free providers.
Use your existing OpenAI client library with a Free AI Router API base URL and a unified workspace key. Your requests are forwarded to the OpenAI-compatible providers you configure.
Supported API endpoints
POST /v1/chat/completions accepts text messages and supports non-streaming JSON or streaming server-sent events. GET /v1/models lists your configured models. This release does not implement the Responses API, Anthropic Messages API, embeddings or image generation.
Configure your client
Create a workspace account, add a provider connection and create a unified API key. Set your client’s base URL to this server’s /v1 endpoint and its API key to the unified key. See the quickstart for complete Python, JavaScript and cURL examples.
Choose your routing behavior
Use model auto for priority-based routing across enabled connections. It can switch to each connection’s first model on failure. To keep a model fixed, specify its exact ID; only connections listing that ID will be eligible. Smaller connection priority numbers are tried first.
Streaming and retries
The router forwards streaming chunks with backpressure. It can switch providers before a stream starts. Once a stream starts it never replays the prompt to another provider. An interrupted stream is reported as a failure rather than silently counted as successful.
Compatibility has limits
Providers differ in supported parameters, model behavior and tool support. Basic tool fields are forwarded, but support depends on the upstream model. The API validates known request fields and rejects unsupported parameters instead of implying full API compatibility.
Inspect the actual route
X-Routed-Via identifies the connection, X-Routed-Model reports the configured upstream model ID, and X-Router-Attempts counts attempted connections for the request. The Activity page shows durations, errors and upstream-reported token usage without storing conversation content.