Skip to Content
AI GatewayGetting started

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

  1. An org platform key starting with eis_ — create under Tokens and API keys.
  2. 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/v1

Send 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:

PatternExample clients
openai/gpt-4o-miniChat, Responses, LangChain, Cursor
anthropic/claude-sonnet-4-6Chat, Responses, Anthropic passthrough
groq/llama-3.3-70b-versatileChat, Responses
gemini/gemini-2.5-flashChat, Responses

Bare model names (e.g. gpt-4o-mini) resolve via the org’s default provider when configured.

Quick start

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

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.

Last updated on