ChatOpenAI at Toolken’s gateway, add X-Toolken-Key to default_headers, and spend appears in your dashboard broken down by agent.
1
Get your two keys
You need two keys:
Toolken forwards your provider key to the upstream model provider untouched and never stores it.
2
Build the model
Use
ChatOpenAI from langchain_openai. Set base_url to Toolken’s gateway and pass your keys in default_headers:X-Toolken-Metadata-Agent labels this model’s traffic in the dashboard. Use any string that identifies the graph or workflow.3
Use the model in your graph nodes
Pass No changes to your graph structure, edges, or state schema are needed.
model into whichever nodes call the LLM. A simple invoke pattern looks like:4
Confirm in your dashboard
Run your graph. Within seconds, calls appear in the Toolken dashboard grouped under the
research-agent agent. Cost, token usage, and latency are captured for every node invocation.Next
CrewAI
Configure Toolken for CrewAI agents with the built-in LLM class.
Providers & Routing
One gateway URL, many providers, your own keys.