Quickstart
An account, a key and one request. The gateway speaks the APIs your SDK already speaks, so the only new thing is its address.
Get a key
Section titled “Get a key”- Create an account. Credit is prepaid and there is no subscription: add some on the Billing page.
- Create a key on the API keys page.
- Keep the key out of your code. The samples on these pages read it from the environment, as
EXOTIC_API_KEY.
export EXOTIC_API_KEY="sk-er-..."$env:EXOTIC_API_KEY = "sk-er-..."Send a request
Section titled “Send a request”This is a Chat Completions request, the format most tools and SDKs speak. Every text model in the catalogue answers it. With the OpenAI SDK, the base URL is https://api.exoticrouter.com/v1.
curl https://api.exoticrouter.com/v1/chat/completions \ -H "Authorization: Bearer $EXOTIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-5-5", "messages": [{"role": "user", "content": "Say hello in five words."}] }'import osfrom openai import OpenAI
client = OpenAI( base_url="https://api.exoticrouter.com/v1", api_key=os.environ["EXOTIC_API_KEY"],)
reply = client.chat.completions.create( model="anthropic/claude-sonnet-5-5", messages=[{"role": "user", "content": "Say hello in five words."}],)print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.exoticrouter.com/v1", apiKey: process.env.EXOTIC_API_KEY,});
const reply = await client.chat.completions.create({ model: "anthropic/claude-sonnet-5-5", messages: [{ role: "user", content: "Say hello in five words." }],});console.log(reply.choices[0].message.content);A model is named by its id, lab/model. Swap anthropic/claude-sonnet-5-5 for openai/gpt-6.2-astra, google/gemini-4-neon or any other id from the models page and the same request goes to that model.
Stream the answer
Section titled “Stream the answer”Set stream to true and the answer arrives piece by piece, as server-sent events, exactly as the OpenAI API sends them.
stream = client.chat.completions.create( model="anthropic/claude-sonnet-5-5", messages=[{"role": "user", "content": "Write a haiku about glass."}], stream=True,)for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True)const stream = await client.chat.completions.create({ model: "anthropic/claude-sonnet-5-5", messages: [{ role: "user", content: "Write a haiku about glass." }], stream: true,});for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? "");}curl -N https://api.exoticrouter.com/v1/chat/completions \ -H "Authorization: Bearer $EXOTIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-5-5", "stream": true, "messages": [{"role": "user", "content": "Write a haiku about glass."}] }'Keep the SDK you have
Section titled “Keep the SDK you have”The gateway also speaks Anthropic’s and Google’s own APIs, so their SDKs work too. Each takes the gateway’s address as its base URL and the same key.
| SDK | Base URL | Models |
|---|---|---|
| OpenAI | https://api.exoticrouter.com/v1 |
Every model |
| Anthropic | https://api.exoticrouter.com |
The Claude models |
| Gemini | https://api.exoticrouter.com |
The Gemini models |
Where next
Section titled “Where next”- Models and ids: How a model is named, and how to list what is live.
- Chat Completions: Tools, images, streaming and the rest of the format.
- Billing and balance: How a request is priced, and reading the balance.
- Errors: What each status means and what to do about it.