X AI Integration
Connect Helicone with X AI, a platform that provides powerful language models including MoE and Code models for various AI applications.
You can follow their documentation here: https://api-docs.x.ai/
Gateway Integration
Create an X AI account
Log into https://console.x.ai/ or create an account. Once you have an account, you can generate an API key from your dashboard.
Set HELICONE_API_KEY and X_API_KEY as environment variable
Modify the base URL and add Auth headers
Replace the following X AI URL with the Helicone Gateway URL:
https://api.x.ai/v1/chat/completions
-> https://x.helicone.ai/v1/chat/completions
and then add the following authentication headers:
Now you can access all the models on X AI with a simple fetch call:
Example
For more information on how to use headers, see Helicone Headers docs. And for more information on how to use X AI, see X AI Docs.
Was this page helpful?