Gateway Integration
1
2
Create an OpenRouter account
Log into www.openrouter.ai or create an account. Once you have an account, you
can generate an API key.
3
Set HELICONE_API_KEY and OPENROUTER_API_KEY as environment variable
4
Modify the base URL and add Auth headers
Replace the following OpenRouter URL with the Helicone Gateway URL:
https://openrouter.ai/api/v1/chat/completions
-> https://openrouter.helicone.ai/api/v1/chat/completions
and then add the following authentication headers.Example
Note: usage data and cost calculations while streaming are only offered
for OpenAI and Anthropic models. For non-stream requests, usage data and cost
calculations are available for all models.