Skip to main content
Gemini routes through Toolken’s OpenAI-compatible endpoint. Use the OpenAI SDK pointed at the Toolken gateway with a gemini- model name — the gateway translates the request to Gemini’s format and maps the response back. There is no separate Gemini-native endpoint on the Toolken gateway.
There is no separate Gemini-native endpoint on the Toolken gateway. Send your request to /v1/chat/completions with a gemini- model name. The gateway handles the translation transparently.
1

Get your keys

You need two keys:Toolken forwards your Gemini key verbatim and never stores it.
2

Configure the client

Use the OpenAI SDK. Your Gemini key goes in apiKey / api_key and travels in Authorization: Bearer — the gateway forwards it to Google untouched.
Model names starting with gemini- are auto-detected. No extra header is needed to tell the gateway to route to Gemini.
3

Attribute by customer (optional)

Add X-Toolken-Metadata-Customer-Id to track spend per end-user or organization:
4

See your cost

Within seconds your request appears in the dashboard, grouped by agent and customer. You receive a standard OpenAI-compatible response — the translation is transparent.

Streaming

Streaming works the same way as with any OpenAI SDK call:

How translation works

The gateway rewrites the OpenAI-compatible request body to Gemini’s generateContent format before forwarding, and maps the response back to a standard chat.completions shape. Your Gemini key travels in Authorization: Bearer and the gateway forwards it to Google as x-goog-api-key.

Next

Custom Properties

All attribution headers and how metadata keys become dashboard dimensions.

OpenAI SDK

Use OpenAI models through Toolken with the same SDK setup.

Anthropic SDK

Use Claude models through Toolken with the Anthropic SDK.

Anthropic and Gemini

Provider routing details for Anthropic and Gemini.