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." }, { "role": "user", "content": "What is the meaning of life, the universe, and everything?"
DataCamp
datacamp.com › tutorial › grok-3-api
Grok 3 API: A Step-by-Step Guide With Examples | DataCamp
May 1, 2025 - We can combine the function calling ... the packages and functions mentioned before; ... Defining the output schema. We start with an API call using the create() function to trigger the tool call....
Videos
03:43
Grok xAI API in Python - Getting Started - YouTube
08:29
Grok API: Crash Course for Beginners in 8 Mins! - YouTube
12:11
How to use Grok API with Free Credits!!! - YouTube
04:16
How to install and get the Grok API: Detailed tutorial ($25 free) ...
19:41
xAI has released their Grok Public API! How to use it in Clay - ...
02:12
xAI API Tutorial: Run Grok Locally using Python on Windows - 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
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. ... The xAI API is a toolkit for developers to integrate xAI's Grok models into their own applications, the xAI API provides the building blocks to create new AI experiences.
xAI
docs.x.ai › docs › overview
xAI API
Grok is our flagship AI model designed to deliver truthful, insightful answers. ... Create an API Key and make your first request. ... Let Grok perform actions and look up information.
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.
Analytics Vidhya
analyticsvidhya.com › home › how to access grok 3 api?
How to Access the Grok 3 API? - Analytics Vidhya
It should notify the user when stock is low. Create a plan for the directory structure and provide code snippets for the key components. """ client = OpenAI( api_key=os.getenv("GROK_API_KEY"), base_url="https://api.x.ai/v1", ) response = ...
Published July 25, 2025
Medium
medium.com › @okanyenigun › grok-api-f180e5a7fa67
Grok API. Running Grok on local consumer… | by Okan Yenigün | Medium
October 28, 2024 - Interestingly, you can also use the OpenAI package for this purpose. import os from openai import OpenAI os.environ["XAI_API_KEY"] = "your-key" XAI_API_KEY = os.getenv("XAI_API_KEY") client = OpenAI( api_key=XAI_API_KEY, base_url="https://api.x.ai/v1", ) completion = client.chat.completions.create( model="grok-beta", messages=[ {"role": "system", "content": "You are Grok, a chatbot inspired by the Hitchhikers Guide to the Galaxy."}, {"role": "user", "content": "Explain the risks of improper AI usage and its contribution to autocratic regimes."}, ], ) print(completion.choices[0].message) """ ChatCompletionMessage(content='Here is a humorous take on the risks of improper AI usage and its potential contribution to autocratic regimes:\n\n---\n\n**The Perils of Improper AI Usage: A Hitchhiker\'s Guide**\n\n**1.
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.
OpenRouter
openrouter.ai › x-ai › grok-4.1-fast
Grok 4.1 Fast - API, Providers, Stats | OpenRouter
Use the reasoning parameter in your request to enable reasoning, and access the reasoning_details array in the response to see the model's internal reasoning before the final answer. When continuing a conversation, preserve the complete reasoning_details when passing messages back to the model so it can continue reasoning from where it left off.
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 - Save your API key in a secure password manager or encrypted noteSometimes, this provider will require you to add a payment method to your account before you can use your API key to chat with AI. So, to avoid any hiccups, make sure you’ve got a payment method set up and ready to go! Important: Keep your API key secure and never share it publicly. Store it safely as you'll need it to connect with TypingMind. Once you have your xAI API key, connecting it to TypingMind to chat with AI is straightforward: ... grok-4-0709https://api.x.ai/v1/chat/completionsgrok-4-0709 via xAIhttps://www.typingmind.com/model-logo.webp32000
Apideck
apideck.com › blog › how-to-get-your-grok-xai-api-key
How to Get Your Grok (XAI) API Key
September 10, 2025 - import os import requests headers = { "Authorization": f"Bearer {os.getenv('GROK_API_KEY')}", "Content-Type": "application/json" } # Query with real-time X context payload = { "model": "grok-1", "messages": [ { "role": "user", "content": "What are people saying about the Olympics right now?" } ], "enable_x_context": True, # Enable real-time X data "include_trending": True, # Include trending topics "max_tokens": 1000 } response = requests.post( "https://api.x.ai/v1/chat/completions", headers=headers, json=payload )