Guide
Migrate from OpenRouter in 3 lines
Aniron and OpenRouter both speak the OpenAI-compatible chat completions API, so migrating is a config change, not a rewrite. Swap the base URL, replace the API key, and change the model prefix from a provider slug to aniron/.
Three changes
Swap baseURL
Replace https://openrouter.ai/api/v1 with https://api.aniron.ai/v1 in your OpenAI client constructor. The HTTP-Referer and X-Title headers OpenRouter uses for app attribution are not required and can be removed.
const client = new OpenAI({
baseURL: 'https://api.aniron.ai/v1',
apiKey: process.env.ANIRON_KEY,
}); Replace API key
Generate a Aniron API key at app.aniron.ai. Replace your OpenRouter key with it. The key is shown once โ save it in your environment or secrets manager.
# Before
OPENROUTER_API_KEY=sk-or-v1-abc123...
# After
ANIRON_KEY=sk-aniron-def456... Remap model slugs
OpenRouter prefixes models by upstream provider, like openai/gpt-4o or anthropic/claude-3.5-sonnet. Aniron uses one flat aniron/ prefix for every model. Check /models for the exact slug of each model you use.
// OpenRouter prefixes by provider slug
'openai/gpt-4o' -> 'aniron/gpt-4o'
'anthropic/claude-3.5-sonnet' -> 'aniron/claude-sonnet-4'
'meta-llama/llama-3.1-70b-instruct' -> 'aniron/llama-3.1-70b' Full example
Before (OpenRouter)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://openrouter.ai/api/v1',
apiKey: process.env.OPENROUTER_API_KEY,
defaultHeaders: {
'HTTP-Referer': 'https://yourapp.com',
'X-Title': 'Your App',
},
});
const completion = await client.chat.completions.create({
model: 'openai/gpt-4o',
messages: [{ role: 'user', content: 'Hello' }],
}); After (Aniron routing)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.aniron.ai/v1', // ๐ Change this
apiKey: process.env.ANIRON_KEY, // ๐ Change this
// ๐ Referer/Title headers are not required
});
const completion = await client.chat.completions.create({
model: 'aniron/gpt-4o', // ๐ Swap prefix: openai/ โ aniron/
messages: [{ role: 'user', content: 'Hello' }],
});
The response object is identical. If your code parses completion.choices[0].message.content, it still works. Error handling, streaming chunks, and function calls all follow the same shape you already handle.
What's different from OpenRouter
Model naming
One flat aniron/ prefix instead of a per-provider slug. No need to track which vendor a model belongs to.
Attribution headers
HTTP-Referer and X-Title are not used. Remove them from defaultHeaders, or leave them โ they are ignored.
Fallback routing
Automatic fallback across models is built in, no client-side route: [] array or models: [] fallback list needed.
Budgets
Per-key spend caps and usage dashboards are native to every API key, not an add-on.
Request format
Messages array, temperature, max_tokens, top_p, tools โ all parameters work exactly as documented for OpenRouter.
Error codes
400 for bad input, 401 for invalid key, 402 when balance is zero, 429 on rate limit.
Frequently asked questions
Do I need to change my SDK?
No. Aniron speaks the same OpenAI-compatible chat completions API that OpenRouter does. The official openai package, LangChain, LlamaIndex, and any OpenAI-compatible client work without modification.
What happens to the HTTP-Referer and X-Title headers?
They are OpenRouter-specific and safe to remove. Aniron does not use them for routing, ranking, or attribution, so dropping them from defaultHeaders has no effect on requests.
How do model slugs map over?
OpenRouter prefixes models by provider, like openai/gpt-4o or anthropic/claude-3.5-sonnet. Aniron uses a single aniron/ prefix for every model, for example aniron/gpt-4o or aniron/claude-sonnet-4. Check /models for the full slug list.
Does streaming and function calling still work?
Yes. Set stream: true for streaming and pass tools the same way you do today. Both pass through unchanged for any model that supports them, the same as with OpenRouter.
What about fallback routing?
Aniron applies automatic model fallback on provider errors or rate limits without any client-side config, similar to what you may have hand-rolled with OpenRouter route arrays. See /features for fallback behavior.
Is pricing structured differently than OpenRouter credits?
Both use prepaid balances billed per token, so the mental model carries over directly. Check /pricing for current per-model rates, which range from $0.05 to $10 per million tokens depending on the model.
Related resources
Migrate your first request
Get a Aniron API key and change three lines. Test it with a single request before switching production traffic.