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.
1
2
Copy
Ask AI
curl -X POST https://x.helicone.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Helicone-Auth: Bearer $HELICONE_API_KEY" \
-d '{
"model": "grok-4-latest",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"max_tokens": 50,
"temperature": 0.7
}'
3