Skip to main content
Helicone OSS LLM Observability

xAI with OpenAI JavaScript SDK

Use the OpenAI JavaScript SDK to integrate with xAI via Helicone to log your xAI usage.
1 min read
Warning

This integration method is maintained but no longer actively developed. For the best experience and latest features, use our new AI Gateway with unified API access to 100+ models.

This integration is used to log usage with the xAI API.

How to Integrate#

Create an account and generate an API key

Log into Helicone or create an account. Once you have an account, you can generate an API key here.

Set up your Helicone API key in your .env file

Modify the base URL path

OpenAI SDK

Verify your requests in Helicone

With the above setup, any calls to xAI will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.

Related Guides#