Welcome to the Grok 3 API documentation. Our API provides access to state-of-the-art language models for various natural language processing tasks. This documentation will help you integrate Grok 3 into your applications.
https://grok3api.com/api
All API requests require authentication using an API key. You can obtain your API key from the dashboard. Include your API key in the request headers using either:
Authorization: Bearer YOUR_API_KEY
x-api-key: YOUR_API_KEY
Generate chat completions using the Grok 3 model.
{
"model": "grok-3",
"messages": [
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"temperature": 0.7
}
{
"id": "chatcmpl-123...",
"object": "chat.completion",
"created": 1740330947,
"model": "grok-3",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 48,
"completion_tokens": 783,
"total_tokens": 831
}
}
curl https://grok3api.com/api/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-3",
"messages": [{
"role": "user",
"content": "What is artificial intelligence?"
}]
}'
import requests
url = "https://grok3api.com/api/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
data = {
"model": "grok-3",
"messages": [{
"role": "user",
"content": "What is artificial intelligence?"
}]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Rate limits vary based on your subscription plan: