Native Mode

Native Mode

Use any provider’s SDK as-is, pointed at your gateway

Native mode is the simplest way to integrate with Enterprise Router. You keep using your existing provider SDK — OpenAI, Anthropic, or Google — and just change the base URL and API key. Everything else stays the same.

How it works

Your SDK sends requests to Enterprise Router instead of directly to the provider. The gateway:

  1. Authenticates your proxy key
  2. Enforces your access policies (rate limits, budgets, IP allowlists, model restrictions)
  3. Replaces your proxy key with the real provider credential
  4. Forwards the request to the provider unmodified
  5. Streams the response back to you
  6. Logs the request and tracks cost

Because the request is forwarded verbatim, every feature of the provider’s API works: streaming, function calling, tool use, vision, JSON mode, and anything new they add.

Provider base URLs

ProviderBase URLAuth header used upstream
OpenAIhttps://your-gateway.com/openaiAuthorization: Bearer
Anthropichttps://your-gateway.com/anthropicx-api-key
Geminihttps://your-gateway.com/geminix-goog-api-key

Authentication

Pass your Enterprise Router proxy key where the SDK expects the provider’s API key:

  • OpenAI SDK: api_key="sk-proxy-..." (sent as Authorization: Bearer)
  • Anthropic SDK: api_key="sk-proxy-..." (sent as x-api-key)
  • Gemini SDK / REST: send as x-goog-api-key header or in the key parameter

The gateway strips your proxy key, validates it, and replaces it with the real provider API key before forwarding.

What changes in your code

Exactly two things:

  1. API key → your sk-proxy-... proxy key
  2. Base URL → your gateway URL with the provider path

Nothing else changes. Your prompts, parameters, streaming logic, error handling, and response parsing all stay the same.

Next steps