Skip to content
CodeLifter

API providers and routers

The same model can be served by its maker, a cloud, an inference host or a router. Who serves it decides where your prompts and code go, and whose terms apply to them.

Five blank envelopes of different sizes fanned out, one orange-red

Four kinds of provider

All providers 14

Provider Kind Serves OpenAI-compatible Before you send code
OpenAI API First-party GPT models Yes, native at api.openai.com/v1; Responses API recommended for new projects Read the data policy
Anthropic API First-party Claude models Test layer at api.anthropic.com/v1; native API is Messages Anthropic says the layer is mainly for testing and not production-ready for most uses
Gemini API First-party Gemini models Yes, at /v1beta/openai Read the data policy
Grok API (xAI) First-party Grok models Yes, marked legacy; Responses API preferred Read the data policy
Mistral API First-party Mistral models Same request shape, not labelled compatible Read the data policy
DeepSeek API First-party DeepSeek models Yes, base URL api.deepseek.com Read the data policy
Amazon Bedrock Cloud Amazon Nova plus DeepSeek, Mistral AI, Qwen and other vendors Yes, at /openai/v1 on bedrock-runtime Signs in with AWS credentials or a Bedrock API key
Gemini Enterprise Agent Platform Cloud Gemini models in your Google Cloud project Yes, for Gemini models Only Google Cloud auth works with the compatible client
Microsoft Foundry Cloud GPT models plus Cohere, DeepSeek, Grok, Meta and Mistral models Yes, at /openai/v1 Model availability varies by Azure region
Groq Inference host GPT OSS, Llama, Qwen3.8 27B and others Mostly; some features unsupported Read the data policy
Together AI Inference host DeepSeek, Kimi, MiniMax, Qwen and others Yes, at api.together.ai/v1 Read the data policy
Fireworks AI Inference host DeepSeek, GLM, Kimi, Qwen and others Yes, at /inference/v1 Read the data policy
OpenRouter Router 465 models listed on 15 October 2026, served by many hosts Yes, at openrouter.ai/api/v1 Sends requests to third-party hosts; set data_collection to deny to skip hosts that may store data
LiteLLM Router Self-hosted gateway in front of 100+ provider APIs Yes, its default format You run it; data goes to whichever providers you configure

Endpoints, base URLs and model lists checked against each provider’s own documentation on 15 October 2026. We do not summarise data-retention terms; read each provider’s current policy yourself before you send private code.

Switching providers is one line

Thirteen of the fourteen providers above document an OpenAI-compatible Chat Completions endpoint (Anthropic’s is a compatibility layer it describes as meant for testing), and Mistral documents the same request shape without calling it compatible. Change the base URL, the key and the model name; keep the rest. That makes it cheap to move when prices or rankings shift, and it means one review of the calling code covers every provider you switch between.

client.js JavaScript · 24 lines Reviewed
// Base URL and model as each provider documents them (checked 2026-10-15):
// Groq https://api.groq.com/openai/v1 qwen/qwen3.8-27b
// Together https://api.together.ai/v1 MiniMaxAI/MiniMax-M3
// DeepSeek https://api.deepseek.com deepseek-flash
// Gemini API https://generativelanguage.googleapis.com/v1beta/openai gemini-3.8-flash
// OpenRouter https://openrouter.ai/api/v1 qwen/qwen3.8-27b
async function ask(prompt) {
const res = await fetch(process.env.BASE_URL + '/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + process.env.API_KEY
},
body: JSON.stringify({
model: process.env.MODEL,
messages: [{ role: 'user', content: prompt }]
})
});
if (!res.ok) throw new Error('HTTP ' + res.status + ': ' + await res.text());
const data = await res.json();
return data.choices[0].message.content;
}
ask('Say hello in one sentence.').then(console.log, console.error);
Editor-written sample, run in Node 22 against a local test server, not a live provider. Base URLs and model names in the comment are as each provider documented them on 15 October 2026. Keep keys in environment variables, never in the repo.