🌐
xAI
x.ai › api
API | xAI
Our API is compatible with OpenAI and Anthropic’s SDKs. Migrating is as easy as generating an API key and changing a URL.Start building · Installing Grok... We're proud to bring you Grok 4 access on the API, offering advanced reasoning, coding, and visual processing capabilities.View docs
Grok
Meet Grok by xAI: your truth-seeking AI companion for honest answers and insightful analysis.
News
State-of-the-art RAG system built directly into our API. ... Bringing the power of Grok Voice to all developers. ... Announcing Our Transformative Partnership with the Government of El Salvador. ... Grok 4.1 is now available to all users on grok.com, 𝕏, and the iOS and Android apps.
Careers
We are a team of AI technologists and business leaders on a mission to build AI systems that can help humanity understand the world better.
Colossus
We’re running the biggest supercomputer in the world. From start to finish, Colossus was built in 122 days—outpacing every estimate. It’s the most powerful AI training system out there, and it’s expected to double in size in a matter of months.
🌐
xAI
docs.x.ai › docs › models › grok-4-0709
Grok 4
The Hitchhiker's Guide to Grok · Models and Pricing · What's New? Key Information · Manage Billing · Consumption and Rate Limits · Regional Endpoints · Collections · new · Using Management API · Usage Explorer · Migrating to New Models · Debugging Errors ·
🌐
OpenRouter
openrouter.ai › x-ai › grok-4
Grok 4 - API, Providers, Stats | OpenRouter
Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Run Grok 4 with API
🌐
DataCamp
datacamp.com › tutorial › grok-4-api
Grok 4 API: A Step-by-Step Guide With Examples | DataCamp
July 15, 2025 - Learn how to use Grok 4’s API through practical examples featuring image recognition, reasoning, function calling, and structured output.
🌐
xAI
x.ai › news › grok-4
Grok 4 | xAI
The Grok 4 API empowers developers with frontier-level multimodal understanding, a 256,000 context window, and advanced reasoning capabilities to tackle complex tasks across text and vision.
🌐
CometAPI
cometapi.com › how-to-access-grok-4-api
How to Access Grok 4 API - CometAPI - All AI Models in One API
July 15, 2025 - Upon subscribing, navigate to the “API Keys” section, generate a new key, and securely store it for authentication in your code. The Grok 4 API is built to be compatible with both OpenAI and Anthropic SDKs.
🌐
Apidog
apidog.com › blog › how-to-access-grok-4-api
How to Access Grok 4 API
July 18, 2025 - After verification, you'll gain access to the developer dashboard where you can generate API keys. Once your account is active, select the appropriate subscription tier based on your needs. The SuperGrok plan provides the most comprehensive access to Grok 4 features, while the Basic plan offers limited functionality for testing purposes.
🌐
AI/ML API
docs.aimlapi.com › api-references › text-models-llm › xai › grok-4
grok-4 | AI/ML API Documentation
How can I assist you today?", "refusal": null, "annotations": null, "audio": null, "tool_calls": null }, "finish_reason": "stop", "logprobs": null } ], "model": "x-ai/grok-4-07-09", "usage": { "prompt_tokens": 137, "completion_tokens": 914, "total_tokens": 1051, "completion_tokens_details": null, "prompt_tokens_details": null } } ... import requests import json # for getting a structured output with indentation response = requests.post( "https://api.aimlapi.com/v1/chat/completions", headers={ # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: "Authorization":"Bearer <YOUR_AIMLAPI_KEY>", "Content-Type":"application/json" }, json={ "model":"x-ai/grok-4-07-09", "messages":[ { "role":"user", "content":"Hello" # insert your prompt here, instead of Hello } ] } ) data = response.json() print(json.dumps(data, indent=2, ensure_ascii=False))
🌐
AIMLAPI
aimlapi.com › grok-4
Grok 4 AI by xAI is now Available | AI/ML API 🔥
‍Get API Key · Both models share the same architecture base, but Grok 4 benefits from 10× more compute on reasoning during RL. Grok 4 doubles the context window to 256K tokens, and introduces native tool use training during RL. In terms of output quality and technical depth, Grok 4 is a substantial upgrade.
Find elsewhere
🌐
xAI
docs.x.ai › docs › overview
Overview | xAI
Welcome to the xAI developer docs! Our API makes it easy to harness Grok's intelligence in your projects.
🌐
CometAPI
cometapi.com › grok-4-api
Grok 4 API - CometAPI - All AI Models in One API
July 9, 2025 - The Grok 4 API is a developer-friendly, OpenAI-compatible interface that enables access to xAI’s latest large language model for advanced text generation, reasoning, and coding tasks via secure RESTful endpoints.
🌐
Best AI API
aimlapi.com › home › blog › grok 4
Grok 4 API — One API 400+ AI Models | AIMLAPI.com
Optimized for long‑form planning and robust agentic behavior, Grok 4 features a 256k context window and excels at step‑by‑step problem solving, math, logic, and instruction alignment. While multimodal capabilities are limited, Grok 4 dominates in text‑only domains and outperforms previous models across multiple SOTA evaluations. ... Test all API models in the sandbox environment before you integrate.
🌐
xAI
x.ai › news › grok-4-1-fast
Grok 4.1 Fast and Agent Tools API | xAI
We’ve partnered with OpenRouter to make the Grok 4.1 Fast models available for free. We’re offering all agentic tools via the xAI Agent Tools API completely free.
🌐
OpenRouter
openrouter.ai › x-ai › grok-4-fast
Grok 4 Fast - API, Providers, Stats | OpenRouter
Grok 4 Fast is xAI's latest multimodal model with SOTA cost-efficiency and a 2M token context window. It comes in two flavors: non-reasoning and reasoning. Read more about the model on xAI's news post.
🌐
OpenRouter
openrouter.ai › x-ai › grok-4.1-fast
Grok 4.1 Fast - API, Providers, Stats | OpenRouter
Grok 4.1 Fast is xAI's best agentic tool calling model that shines in real-world use cases like customer support and deep research. 2M context window. Reasoning can be enabled/disabled using the reasoning enabled parameter in the API.
🌐
Artificial Analysis
artificialanalysis.ai › models › grok-4 › providers
Grok 4: API Provider Performance Benchmarking & Price Analysis | Artificial Analysis
Analysis of API providers for Grok 4 across performance metrics including latency (time to first token), output speed (output tokens per second), price and others. API providers benchmarked include Microsoft Azure, xAI.
🌐
xAI
docs.x.ai › docs › models
X
The advanced agentic search capabilities powering grok.com are generally available in the new agentic tool calling API, and the Live Search API but will be deprecated by January 12, 2026. Live Search costs $25 per 1,000 sources requested, each source used (Web, X, News, RSS) in a request counts ...
🌐
Chatbase
chatbase.co › blog › grok-4
Grok 4: How to Access and Use It
Access: Linked to your X subscription; SuperGrok subscribers can access Grok 4 through the official X app. xAI has released API access to Grok 4, making it available for developers to integrate into applications ...
🌐
CometAPI
cometapi.com › how-can-you-use-grok-4-on-cometapi-via-api
How Can You Use Grok 4 on CometAPI via API - CometAPI - All AI Models in One API
July 11, 2025 - CometAPI provides a unified REST interface that aggregates hundreds of AI models—under a consistent endpoint, with built-in API-key management, usage quotas, and billing dashboards. Instead of juggling multiple vendor URLs and credentials. Developers can access [Grok 4 API](https://www.cometapi.com/gemini-2-5-flash-lite-previewapi/)(Model: grok-4,grok-4-0709) through CometAPI, the latest models listed are as of the article’s publication date.