grok-4
completions
Grok 4 is the latest and greatest flagship model, offering unparalleled performance in natural language, math and reasoning - the perfect jack of all trades.
Input:$3 / 1M tokens
Output:$15 / 1M tokens
Context:256K tokens
tools
text
text
Access grok-4 through LangDB AI Gateway
Recommended
Integrate with xai's grok-4 and 250+ other models through a unified API. Monitor usage, control costs, and enhance security.
Unified API
Cost Optimization
Enterprise Security
Get Started Now
Free tier available • No credit card required
Instant Setup
99.9% Uptime
10,000+Monthly Requests
Code Example
Configuration
Base URL
API Keys
Headers
Project ID in header
X-Run-Id
X-Thread-Id
Model Parameters
9 availablelogprobs
max_tokens
response_format
seed
temperature
012
tool_choice
tools
top_logprobs
top_p
011
Additional Configuration
Tools
Guards
User:
Id:
Name:
Tags:
Publicly Shared Threads3
Popular Models10