Getting started
Point any OpenAI-compatible client at the Exemplar AI Gateway. Authenticate with an org eis_* key, use provider/model ids, and prefer Chat Completions for the widest SDK support.
Not sure whether you need Unified /gateway/v1, Anthropic/OpenAI passthrough, or the Cursor adapter? Start with Choose your surface.
Prerequisites
- An org platform key starting with
eis_— create under Tokens and API keys. - At least one provider enabled under AI Gateway → Management → Providers, with Connectors/Vault credentials attached (or a one-off BYOK header).
export EXEMPLAR_API_KEY=eis_…
export EXEMPLAR_GATEWAY_URL=https://production-api.exemplar.dev/gateway/v1Send the key as Authorization: Bearer $EXEMPLAR_API_KEY or X-API-Key: $EXEMPLAR_API_KEY. Org is resolved from the key.
Upstream credentials — prefer Connectors / Vault and enable providers under AI Gateway → Management → Providers. For one-off BYOK:
X-Upstream-Authorization: Bearer <provider_api_key>If the org has any gateway providers configured, only enabled ones are allowed.
Models
Use provider/model ids on the unified API:
| Pattern | Example clients |
|---|---|
openai/gpt-4o-mini | Chat, Responses, LangChain, Cursor |
anthropic/claude-sonnet-4-6 | Chat, Responses, Anthropic passthrough |
groq/llama-3.3-70b-versatile | Chat, Responses |
gemini/gemini-2.5-flash | Chat, Responses |
Bare model names (e.g. gpt-4o-mini) resolve via the org’s default provider when configured.
Quick start
curl — Chat Completions (recommended)
curl https://production-api.exemplar.dev/gateway/v1/chat/completions \
-H "Authorization: Bearer $EXEMPLAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Say hello from the Exemplar gateway"}]
}'Claude or Groq — same endpoint, change model:
curl https://production-api.exemplar.dev/gateway/v1/chat/completions \
-H "X-API-Key: $EXEMPLAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Summarize open incidents"}]
}'TypeScript — OpenAI SDK
import OpenAI from "openai";
const gateway = new OpenAI({
apiKey: process.env.EXEMPLAR_API_KEY!, // eis_…
baseURL:
process.env.EXEMPLAR_GATEWAY_URL ??
"https://production-api.exemplar.dev/gateway/v1",
});
const chat = await gateway.chat.completions.create({
model: "openai/gpt-4o-mini",
messages: [{ role: "user", content: "Draft a status update" }],
});
console.log(chat.choices[0]?.message?.content);
const claude = await gateway.chat.completions.create({
model: "anthropic/claude-sonnet-4-6",
max_tokens: 256,
messages: [{ role: "user", content: "Summarize open incidents" }],
});Python — OpenAI SDK
import os
from openai import OpenAI
gateway = OpenAI(
api_key=os.environ["EXEMPLAR_API_KEY"], # eis_…
base_url=os.environ.get(
"EXEMPLAR_GATEWAY_URL",
"https://production-api.exemplar.dev/gateway/v1",
),
)
chat = gateway.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Draft a status update"}],
)
print(chat.choices[0].message.content)Console setup
Enable providers
AI Gateway → Management → Providers — enable the providers your org should use and attach Connectors/Vault credentials.
Optional failover routes
Management → Routes — map an operation (chat, responses, or *) to a primary target and fallbacks. See Failover & routes.
Optional response cache
Management → Cache — set the org default for non-stream chat/responses. See Response cache.
Optional rate limits
Configure org or API-key RPM/TPM policies (admin API or platform defaults). See Rate limits.
Next steps
- Choose your surface — Unified vs passthrough vs Cursor vs Claude
- Unified API — Chat Completions, Responses, embeddings, streaming
- Provider passthrough — Anthropic, OpenAI, Agents SDK, Agno, ADK
- Frameworks — LangChain, Vercel AI SDK, Claude Agent SDK, and more
- Cursor IDE — OpenAI-compatible override via
/gateway/cursor - Claude Code — Anthropic passthrough + model aliases
Prefer Chat Completions for frameworks and most agents. Always authenticate with eis_*; never put upstream provider keys in model context—use Vault or X-Upstream-Authorization.