> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://doc.enterpriserouter.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://doc.enterpriserouter.com/_mcp/server.

# Native Mode

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

| Provider  | SDK `base_url`                               | Auth header used upstream |
| --------- | -------------------------------------------- | ------------------------- |
| OpenAI    | `https://api.enterpriserouter.com/openai/v1` | `Authorization: Bearer`   |
| Anthropic | `https://api.enterpriserouter.com/anthropic` | `x-api-key`               |
| Gemini    | `https://api.enterpriserouter.com/gemini`    | `x-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**: `api_key="sk-proxy-..."` (sent as `x-goog-api-key`)

The gateway accepts your proxy key from any of these headers: `Authorization: Bearer`, `x-api-key`, or `x-goog-api-key`. It strips the 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

Note that OpenAI's SDK includes `/v1` in its default base URL (`https://api.openai.com/v1`), so your gateway base URL must also include `/v1` (e.g., `https://api.enterpriserouter.com/openai/v1`). Anthropic and Gemini SDKs append their API version paths automatically, so their base URLs do not need `/v1`.

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

## Next steps

* **[OpenAI integration guide](/native-openai)** — Python and TypeScript examples
* **[Anthropic integration guide](/native-anthropic)** — Python and TypeScript examples
* **[Gemini integration guide](/native-gemini)** — Python and TypeScript examples