🌐
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
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.
🌐
xAI
docs.x.ai › docs › tutorial
The Hitchhiker's Guide to Grok | xAI
With your xAI API key exported as an environment variable, you're ready to make your first API request. Let's test out the API using curl. Paste the following directly into your terminal. ... curl https://api.x.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $XAI_API_KEY" \ -m 3600 \ -d '{ "messages": [ { "role": "system", "content": "You are Grok, a highly intelligent, helpful AI assistant."
🌐
Apideck
apideck.com › blog › how-to-get-your-grok-xai-api-key
How to Get Your Grok (XAI) API Key
September 10, 2025 - Grok API keys typically start with "xai-". Store your key securely: ... 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?"
🌐
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. 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 - You can sign in in one of three ... your Twitter or Google account. ... Below the welcome message, you should see a small text block that reads, “Manage API keys.” Click on this....
🌐
GitGuardian
docs.gitguardian.com › x ai api key
X AI API Key | GitGuardian documentation
Summary: X's AI API allow integrating Grok in an application. The API Key is used to authenticate requests to the API.
🌐
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.
🌐
xAI
docs.x.ai › docs › api-reference
REST API Reference | xAI
The base for all routes is at https://api.x.ai. For all routes, you have to authenticate with the header Authorization: Bearer <your xAI API key>.
Find elsewhere
🌐
xAI
docs.x.ai › docs › key-information › using-management-api
Using Management API | xAI
The management key can be obtained at xAI Console -> Settings -> Management Keys. The base URL is at https://management-api.x.ai, which is also different from the inference API.
🌐
Microsoft Developer Blogs
devblogs.microsoft.com › dev blogs › semantic kernel › effortlessly integrate xai’s grok with semantic kernel
Integrating xAI's Grok API with Semantic Kernel (C# & Python)
March 6, 2025 - Navigate to the “API Keys” section, create a new key, and note it down. The base URL for API calls is https://api.x.ai/v1.
🌐
TypingMind
typingmind.com › guide › use-grok-api-key-to-chat-with-ai
How to use xAI API Key for AI chat | TypingMind
September 29, 2025 - Complete guide on how to use your xAI (Grok) API key with TypingMind. No monthly fees, advanced features, and better AI chat experience.
🌐
Elephas
elephas.app › blog › how-to-get-grok-api-key
How to Get Grok API Key (Step by Step Guide) | 2026
2 weeks ago - Although the creation process of ... of how to create and use the Grok API key. ... Head over to the Grok PromptIDE at ide.x.ai and log in using your existing X account....
🌐
X
developers.x.ai › api › api-key
Create API Key - xAI Developer Platform
To create an API key, open the PromptIDE (ide.x.ai) and sign in using your X account.
🌐
Medium
medium.com › @piyushkashyap045 › how-to-leverage-xai-api-for-your-projects-a-step-by-step-guide-2f2ae6bf4f9f
How to Leverage xAI API for Your Projects: A Step-by-Step Guide | by Piyush Kashyap | Medium
November 12, 2024 - The xAI API is structured around making HTTP requests to access different endpoints. Each API request must be authenticated using your API key. Base URL: https://api.x.ai/v1 (this is the endpoint you’ll interact with).
🌐
Griptapenodes
docs.griptapenodes.com › en › stable › how_to › keys › grok
How to get and use an xAI Grok API key - Griptape Nodes
Grok is a family of Large Language Models (LLMs) developed by xAI. You can access these models via the GrokPrompt config node. To make use of these, however, you'll need to have an XAI account, and generate an API key.
🌐
AI Content Labs
docs.aicontentlabs.com › articles › x-ai-api-key
How to Set Up the X.ai API Key
January 7, 2025 - Go to the X.ai login page: https://x.ai/. If you don’t have an account yet, you can create one using the same link. Go to the API keys section: https://console.x.ai/.
🌐
Make
apps.make.com › xai
xAI - Apps Documentation
with the xai app in {{product name}} , you can create completions and make api calls in your xai account requirements to use the xai app in {{product name}} , you must have a https //x ai/ connect xai to {{product name}} to get started, you must first create a connection between xai and {{product name}} , allowing the two services to communicate to create the connection, you need to /#obtain your api key in xai /#create the connection in obtain your api key in xai before you create the connection in {{product name}} , you should first obtain an api key in your xai account to obtain the api key
🌐
Reddit
reddit.com › r/llmdevs › free xai grok api key/credits in 2024
r/LLMDevs on Reddit: Free xAI Grok API Key/Credits in 2024
November 6, 2024 -

November 4, 2024

https://x.ai/blog/api?_bhlid=9f5ec12bce9af5dbd44b53e85ec66e15161e6773

API Public Beta

Starting today, developers can build on our Grok foundation models using our newly released API. We will run a public beta program until the end of 2024 during which everyone will get $25 of free API credits per month.

We are happy to announce the immediate availability of our API, which gives developers programmatic access to our Grok series of foundation models. To get started, head to console.x.ai and sign up to create an account. We are excited to see what developers build using Grok.

Models

We are kicking off our public beta with a preview of a new Grok model that is currently in the final stages of development. The model – released under the provisional name grok-beta – has a context length of 128,000 tokens and also supports function calling and system prompts. We will release more information about the model shortly.

In addition to the text-only version of the model grok-beta, we will also release a multi-modal version that can ingest images. The vision model will be available next week.

Free credits

We will run a public beta program throughout the end of the year. Everyone will get $25 of free API credits per month to test the API and get started using Grok.

Anyone who has purchased prepaid credits so far will get the equivalent amount of free monthly credits for every month until the end of the year. For example, if you purchased $50 of prepaid credits already, you will now have $25 + $50 of additional free credits in November and December.

API

To learn more about our API, check out our documentation at docs.x.ai. 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.

🌐
OpenAI
platform.openai.com › docs › api-reference › introduction
API Reference - OpenAI API
In cases like timeouts or network issues when you can’t get the X-Request-Id response header, you can share the X-Client-Request-Id value with our support team, and we can look up whether we received the request and when. ... 1 2 3 curl https://api.openai.com/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "X-Client-Request-Id: 123e4567-e89b-12d3-a456-426614174000"