Skip to main content
One parameter change is all it takes. Point the OpenAI SDK at https://gateway.toolken.ai/v1, add X-Toolken-Key as a default header, and every call the SDK makes is attributed and tracked in your dashboard.
1

Get your keys

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

Configure the client

X-Toolken-Metadata-Agent takes any string. Use one value per agent or workflow you want to track separately in the dashboard. Any X-Toolken-Metadata-* header becomes a groupable dimension automatically.
3

Attribute by customer (optional)

Add X-Toolken-Metadata-Customer-Id to track spend per end-user or organization:
Use any ID you already have: a user ID, an org slug, an account number. The value is recorded as-is and shows up as a grouping dimension in the dashboard.
4

See your cost

Within seconds your request appears in the dashboard, grouped by agent and customer. The response body is identical to calling OpenAI directly — Toolken is a transparent proxy.

Streaming

The OpenAI SDK’s streaming API works without any changes:
Token usage is captured from the final chunk and appears in the dashboard the same way as non-streaming calls.

How the two keys travel

Toolken reads and strips its own X-Toolken-* headers before forwarding the request. Your OpenAI key travels in Authorization: Bearer — exactly as it would when calling OpenAI directly.

Next

Custom Properties

All attribution headers and how metadata keys become dashboard dimensions.

Anthropic SDK

Use Claude models through Toolken with the Anthropic SDK.

Gemini SDK

Use Gemini models through Toolken via the OpenAI-compatible path.

Providers Overview

All supported providers and the BYOK model.