OpenAI-compatible. Change one base_url, keep your existing code, reach 80+ models.
Quick start
Innjoy is OpenAI compatible: same SDKs, same request shape. Text runs at /v1/chat/completions, images at /v1/images/generations, video at /v1/videos/generations. Point your existing OpenAI SDK at https://api.innjoy.ai/v1, swap the API key, and you are done.
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-…", baseURL: "https://api.innjoy.ai/v1" });
const r = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hi" }],
});
Illustrative endpoint, final base_url confirmed at launch.
Authentication
Every request carries a bearer token in the Authorization header. Keys start with sk- for production and fo-test- for sandbox. Create keys in Dashboard, API Keys; each key can be scoped to specific models, IP allowlists, and spend caps. Keys are hashed at rest and can be rotated instantly with no downtime. A 401 response includes a hint header explaining exactly why the key was rejected.
Because the API surface is byte for byte compatible, every official OpenAI SDK works without a fork: just change the base URL and API key. Tool calls, JSON mode, parallel function calling, and structured outputs all pass through unchanged. Provider specific extensions such as Anthropic thinking budget and Gemini grounding are exposed via extra_body.
javascript
const stream = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Write a haiku" }],
stream: true,
});
for await (const chunk of stream)
process.stdout.write(chunk.choices[0].delta.content || "");
Routing
Innjoy routes every request to the best available upstream provider based on latency, price, context window, and regional health. You stay in control: pin a model, pin a provider, or hand the wheel to Auto Router. Routing decisions are logged per request and visible in your dashboard, with a why this route explanation.
json
// Pin a specific provider and region
{ "model": "anthropic/claude-sonnet-4-6@us-east" }
// Or let Auto Router pick on every call
{ "model": "auto" }
Fallback
Declare an ordered list and Innjoy will transparently retry down the chain if an upstream errors, rate limits, or times out. Fallbacks add zero latency on the happy path. The response lists which candidates were tried and which finally served the request.
Append :nitro for lowest latency, :floor for lowest cost, or :long to auto pick a long context variant. Shortcuts compose with fallbacks: a model tagged :nitro inside a fallback chain still honors the fastest path preference.
Auto Router is a learned classifier that reads your prompt and picks the cheapest model that still meets a target quality score. Most teams see a large cost reduction versus always using a frontier model, with no measurable drop in quality on their evals. Per workspace training data never leaves your tenant, and you can pin Auto Router to a whitelist of models if compliance requires it.
json
"model": "auto"
// or tune the cost / quality tradeoff
"model": "auto", "auto_router": { "quality": 0.85 }
Bring your own key
Drop your own provider keys for OpenAI, Anthropic, Google, Azure and AWS Bedrock into your dashboard, and Innjoy will use them instead of ours. You keep your direct pricing and enterprise contracts while still getting routing, fallback, caching, and observability. BYOK requests cost no Innjoy credits; a small platform fee applies on upstream spend, capped per workspace each month.
Zero data retention
Turn on ZDR in workspace settings and Innjoy will not log request bodies, response bodies, or prompt and completion text to any persistent store. Metadata such as latency, token counts, route and status code is still recorded so billing and dashboards keep working. ZDR is available on Pro and Team plans and can be enforced at the API key level.
Prompt caching
Identical system prompts and prefixes are transparently cached at the edge. Cached tokens cost a fraction of list price and return in well under a second. It works on every provider, even those that do not expose native caching.
json
// Force cache on a specific prefix
"messages": [
{
"role": "system",
"content": [{ "type": "text", "text": "…", "cache_control": { "type": "ephemeral" } }]
}
]
Error codes
Innjoy uses standard HTTP status codes and a uniform error envelope with type, message, code, upstream status and a retry hint. Common codes include invalid key, insufficient scope, low balance, rate limit, upstream unavailable, context too long and content filtered.
json
{
"error": {
"type": "rate_limit_exceeded",
"message": "Too many requests on auto-router",
"code": "fo_ratelimit_rpm",
"upstream_status": 429,
"retry_after_ms": 2400
}
}
Get your key
Claim AI credit and start calling models from your IDE.