xAI
docs.x.ai › docs › tutorial
The Hitchhiker's Guide to Grok | xAI
Create an API key via the API Keys Page in the xAI API Console.
xAI
docs.x.ai › docs › overview
xAI API
Learn how to use our products and services
Videos
01:13
How to Generate the xAI Grok API Key - YouTube
04:45
Get Started With xAI: How To Make Your First API Call - YouTube
11:06
NEW XAi API Is Live - Everything You Need To Know! - YouTube
06:08
The xAI API IS INSANE: Full Demo And Beginner's Guide - YouTube
03:43
Grok xAI API in Python - Getting Started - YouTube
12:11
How to use Grok API with Free Credits!!! - YouTube
xAI
docs.x.ai › docs › resources › faq-api
FAQ - xAI Console | xAI
Frequently asked questions on using the xAI Console, including creating teams, managing roles, and configuring settings.
xAI
docs.x.ai › docs › key-information › using-management-api
Using Management API | xAI
You need to get a management key, which is separate from your API key, to use the management API. The management key can be obtained at xAI Console -> Settings -> Management Keys.
Make
apps.make.com › xai
xAI - Apps Documentation
with the xai app in {{product name}} ... to obtain the api key log in to your https //accounts x ai/sign in click go to api console in the lower left in the left sidebar, click api keys click create api ......
DataCamp
datacamp.com › tutorial › grok-4-api
Grok 4 API: A Step-by-Step Guide With Examples | DataCamp
July 15, 2025 - To access the API, you’ll need to purchase credits. Starting out, it’s wise to use prepaid credits instead of automatic billing—this helps you avoid surprise charges. You can buy tokens and track your usage in the xAI console, under Invoices > Credits.
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>.
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 - We’ll also explain the basics of the API call structure, provide a sample code, and highlight how you can use AI to guide you through programming if you don’t have a lot of experience. ... xAI is an AI platform developed to provide advanced artificial intelligence tools to developers, businesses, and enthusiasts.
xAI
docs.x.ai › docs › guides › chat
Chat Responses | xAI
With Responses API, we can send the id of the previous response, and the new messages to append to it. ... import os from xai_sdk import Client from xai_sdk.chat import user, system client = Client( api_key=os.getenv("XAI_API_KEY"), management_api_key=os.getenv("XAI_MANAGEMENT_API_KEY"), timeout=3600, ) chat = client.chat.create(model="grok-4", store_messages=True) chat.append(system("You are Grok, a chatbot inspired by the Hitchhiker's Guide to the Galaxy.")) chat.append(user("What is the meaning of life, the universe, and everything?")) response = chat.sample() print(response) # The response
DataCamp
datacamp.com › tutorial › grok-3-api
Grok 3 API: A Step-by-Step Guide With Examples | DataCamp
May 1, 2025 - To use the API, we need to buy credits. Using prepaid credits rather than automatic invoice billing is recommended in the beginning, as it is a good safeguard against unexpected costs. You can buy tokens and get an overview of your usage in the xAI console under Invoices > Credits.
xAI
docs.x.ai › docs › management-api
Management API | xAI
This API also facilitates oversight of billing aspects, including monitoring prepaid credit balances and usage deductions, ensuring seamless scalability and cost transparency for Grok model integrations. To get started, go to xAI Console...
GitHub
github.com › xai-org › xai-sdk-python
GitHub - xai-org/xai-sdk-python: The official Python SDK for the xAI API
The xAI SDK includes the option to export OpenTelemetry traces to the console or an OTLP compatible backend. Exporting telemetry is not enabled by default, and you must explicitly configure this in code to start exporting traces. When enabled, each API call automatically generates detailed traces (spans) that capture the complete execution flow of that call, as well as rich metadata including attributes such as input prompts, model responses, and token usage statistics.
Starred by 282 users
Forked by 43 users
Languages Python
GitHub
github.com › xai-org › xai-cookbook
GitHub - xai-org/xai-cookbook: A collection of pragmatic, real-world examples guiding you from basic to advanced use of xAI's Grok APIs.
This repo includes a pre-commit hook with Gitleaks to block accidental API key commits. It’s not foolproof though, if you accidentally commit your key, revoke it immediately in the xAI Console and generate a new one.
Starred by 257 users
Forked by 93 users
Languages TypeScript 88.2% | Python 4.9% | Shell 4.3% | CSS 1.6%