🌐
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...
Grok
Meet Grok by xAI: your truth-seeking AI companion for honest answers and insightful analysis.
News
Learn more about our latest releases and company updates.
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.
People also ask

🌐
xAI
docs.x.ai › docs › overview
Overview | xAI
Grok is our flagship AI model designed to deliver truthful, insightful answers. ... Create an API Key and make your first request.
🌐
Merge.dev
merge.dev › blog › grok-api-key
How to get your Grok API key (5 steps)
January 2, 2025 - Once you select “Create API key,” ... the endpoints you want to grant it, and pick the models it can use. Finally, you’ll be able to preview and generate the key. Once you’ve created it, you'll be able to view its usage and edit, disable, or delete it. You can also create an entirely new key by clicking on Create API key. Before building to Grok’s API, it’s ...
🌐
Grok API
grok-api.apidog.io › introduction-933934m0
Introduction - Grok API
Build with Grok 3To access the Grok 3 models via API, please create an xAI account and an API key.
🌐
DataCamp
datacamp.com › tutorial › grok-3-api
Grok 3 API: A Step-by-Step Guide With Examples | DataCamp
May 1, 2025 - If you want to know more about Grok 3’s architecture and performance, make sure to take a look at this overview of Grok 3. In this section, I will explain how to create an API key, set up a Python environment to connect to the Grok API, and make your first user request.
🌐
GitHub
github.com › mem0ai › grok3-api
GitHub - mem0ai/grok3-api: Unofficial Grok 3 API
Follow these steps to get started with the Grok3 API client. ... Open grok.com in your browser. Log in if you aren't already logged in. Open the browser's developer tools (e.g., F12 or right-click > Inspect). Go to the "Network" tab and filter for requests containing the new-chat endpoint (e.g., https://grok.com/rest/app-chat/conversations/new).
Starred by 526 users
Forked by 98 users
Languages   Python
🌐
Cloudflare
developers.cloudflare.com › directory › ai gateway › using ai gateway › provider native › xai
xAI · Cloudflare AI Gateway docs
"You are Grok, a chatbot inspired by the Hitchhiker's Guide to the Galaxy.", }, { role: "user", content: "What is the meaning of life, the universe, and everything?", }, ], }); console.log(completion.choices[0].message); If you are using the OpenAI SDK with Python, you can set your endpoint like this: Python · import os · from openai import OpenAI · XAI_API_KEY = os.getenv("XAI_API_KEY") client = OpenAI( api_key=XAI_API_KEY, base_url="https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/grok", ) completion = client.chat.completions.create( model="grok-4", messages=[ {"role": "syst
Find elsewhere
🌐
xAI
docs.x.ai › docs › api-reference
REST API Reference | xAI
Reference of all available xAI REST API endpoints
🌐
Grok AI
grokai.bot › home
Grok AI API - Grok AI
May 15, 2025 - The Grok AI API is a powerful language model interface that allows developers to integrate advanced AI capabilities such as natural language understanding, text generation, and intelligent automation into their own applications.
🌐
xAI
docs.x.ai › docs › introduction
Introduction | xAI
To access the grok-4 models via API, please create an xAI account and an API key.
🌐
xAI
docs.x.ai › docs › tutorial
The Hitchhiker's Guide to Grok | xAI
Certain grok models can accept both text AND images as an input. For example: ... import os from xai_sdk import Client from xai_sdk.chat import user, image client = Client( api_key=os.getenv("XAI_API_KEY"), timeout=3600, # Override default timeout with longer timeout for reasoning models ) chat = client.chat.create(model="grok-4") chat.append( user( "What's in this image?", image("https://science.nasa.gov/wp-content/uploads/2023/09/web-first-images-release.png") ) ) response = chat.sample() print(response.content)
🌐
xAI
docs.x.ai › docs
Welcome to the xAI documentation - Grok
Grok is our flagship AI model designed to deliver truthful, insightful answers. ... Create an API Key and make your first request.
🌐
BytePlus
byteplus.com › en › topic › 499220
Grok API Tutorial: Step-by-Step Guide 2025
Once your environment is set up, the next step is to understand how to interact with the Grok API's various endpoints. These endpoints are the specific URLs you will send requests to in order to perform different tasks, like generating text or listing available models.
🌐
GitHub
github.com › realasfngl › Grok-Api
GitHub - realasfngl/Grok-Api: A free Grok API wrapper that allows you to use Grok without API access or Account.
🔓 No Authentication Required - Access Grok without an account · 🆓 Completely Free - No API keys or paid subscriptions needed · 🚀 FastAPI Server - Ready-to-use REST API endpoint
Starred by 87 users
Forked by 25 users
Languages   Python
🌐
AI SDK
ai-sdk.dev › providers › ai-sdk-providers › xai
AI SDK Providers: xAI Grok
It defaults to the XAI_API_KEY environment variable. ... Custom headers to include in the requests. fetch (input: RequestInfo, init?: RequestInit) => Promise<Response> Custom fetch implementation. Defaults to the global fetch function. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing. You can create xAI models using a provider instance. The first argument is the model id, e.g. grok-3.
🌐
xAI
x.ai › news › api
API Public Beta | xAI
Our REST API is fully compatible with the ones offered by OpenAI and Anthropic. This simplifies migration. For example, if you’re currently using the OpenAI Python SDK, you can start using Grok by simply changing the base_url to https://api.x.ai/v1 and using your xAI API key that you created on console.x.ai.
🌐
Apideck
apideck.com › blog › how-to-get-your-grok-xai-api-key
How to Get Your Grok (XAI) API Key
September 10, 2025 - curl https://api.x.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-1", "messages": [ { "role": "user", "content": "What is happening on X today?" } ], "stream": false, "temperature": 0.7 }'
🌐
Agentsapis
agentsapis.com › grok-4-api › endpoints
Grok API Endpoints: Full Guide to Text, Vision & Tool Integration
Explore all Grok API endpoints for chat, completions, vision, image generation, embeddings, and tool calling. Learn how to integrate Grok 4 with RESTful requests and third-party proxies like OpenRouter and Cloudflare.