Docs
Migration Guide
Aniron is wire-compatible with the OpenAI Chat Completions API. Migrating an existing integration is a two-line change: base URL and API key.
What changes
import OpenAI from 'openai';
const client = new OpenAI({
- baseURL: 'https://api.openai.com/v1',
- apiKey: process.env.OPENAI_API_KEY,
+ baseURL: 'https://api.aniron.ai/v1',
+ apiKey: process.env.ANIRON_API_KEY,
});
const completion = await client.chat.completions.create({
- model: 'gpt-4o',
+ model: 'aniron/gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
}); base_url→https://api.aniron.ai/v1api_key→ your Aniron key (see Authentication)model→ prefix the existing model name withaniron/, or switch to any of the 20+ models in the catalog
What doesn't change
Everything downstream of the client construction is unchanged: request parameters
(messages,
temperature,
max_tokens, and so on), the
streaming chunk
format, tool calling
request/response shapes, and the error
response format. If your code accesses
completion.choices[0].message.content, it
keeps working with no further changes.
One addition worth making
OpenAI's API has no equivalent to Aniron's fallbacks
parameter. It's optional, but worth adding during migration: an ordered array of backup
model IDs that Aniron retries automatically on a rate limit or server error, at no code
change beyond the request body. See
Model Fallbacks.
Rollout
Test the new base URL and key against a single non-production request first. Because the request and response shapes are identical, there's no client-side parsing to validate — only that the key is active and has credit. See Managing Credits before switching production traffic over.
Migrate your first request
Get an Aniron API key and change two lines. Test it before switching production traffic.