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.
Videos
12:11
How to use Grok API with Free Credits!!! - YouTube
08:29
Grok API: Crash Course for Beginners in 8 Mins! - YouTube
01:13
How to Generate the xAI Grok API Key - YouTube
19:41
xAI has released their Grok Public API! How to use it in Clay - ...
19:20
GenAI Vlog - Grok 4 API Call and CLI Introduction Tutorial - YouTube
03:43
Grok xAI API in Python - Getting Started - YouTube
How can I access Grok's API?
You can access the API by registering on the xAI Developer Portal, generating API keys, and authenticating your requests with the Authorization header. The base URL is https://api.grok.xai.com/v1.
latenode.com
latenode.com › home › blog about no-code integrations with latenode - the ultimate no-code automation platform › undefined › xai grok (grok 2, grok 3) in ai technology & language models - explore no-code automation with latenode › complete guide to xai's grok: api documentation and implementation
Complete Guide to xAI's Grok: API Documentation and Implementation
What pricing tiers are available for Grok?
Grok offers a Standard tier priced at $0.03 per request and an Enterprise tier with custom pricing. During the public beta, users get $25 in monthly API credits, requiring an X Premium+ subscription.
latenode.com
latenode.com › home › blog about no-code integrations with latenode - the ultimate no-code automation platform › undefined › xai grok (grok 2, grok 3) in ai technology & language models - explore no-code automation with latenode › complete guide to xai's grok: api documentation and implementation
Complete Guide to xAI's Grok: API Documentation and Implementation
What are the key features of Grok by xAI?
Grok offers real-time responses via webhooks and a scalable architecture suitable for large workloads. It also integrates with cloud services and supports custom connectors for flexible integration.
latenode.com
latenode.com › home › blog about no-code integrations with latenode - the ultimate no-code automation platform › undefined › xai grok (grok 2, grok 3) in ai technology & language models - explore no-code automation with latenode › complete guide to xai's grok: api documentation and implementation
Complete Guide to xAI's Grok: API Documentation and Implementation
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
xAI
docs.x.ai › docs › api-reference
REST API Reference | xAI
Reference of all available xAI REST API endpoints
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.
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.