xAI API
xAI API provides programmatic access to Grok models through OpenAI-compatible REST endpoints and xAI's gRPC interface, with text, tool, media, file, and batch APIs.
Overview
Create an API key in the xAI Console and pass it as a bearer token. For new text integrations, use the Responses API; Chat Completions remains available as a legacy endpoint. The REST API also covers image, video, voice, file, batch, and model operations.
API details
- Base URL
- https://api.x.ai/v1/
- Authentication
- Bearer Token
- Styles
- Rest, Grpc, Sdk
- Pricing model
- Usage Based
- Official SDKs
- Python
Capabilities
Usage pricing depends on the selected model, context length, tools, media operations, and service tier.
Models currently mapped to this API
This is the verified iilib subset, not the provider's complete model catalog.
Tools and agents integrating this API
Only integrations backed by explicit product or provider documentation are shown.
Aider
Aider is an open-source terminal tool for working with language models on an existing codebase. It builds a repository map, edits files, integrates with Git, and can run linting and tests.
Amp
Amp is a coding agent from Amp Frontier Corporation that runs in the terminal, on the web, in cloud orbs, and through desktop and mobile apps, with integrations for common code editors.
Cline
Cline is an open-source coding agent for IDEs, terminal CLI, desktop and SDK, providing file editing, shell commands, browser tools and model-provider choice.
Junie
Junie is JetBrains' coding agent for JetBrains IDEs and the command line. It can inspect projects, write and modify code, run development tasks, and use project instructions and agent skills.
OpenCode
OpenCode is an open-source coding agent offering CLI and desktop clients, a web interface, and multiple model providers; version 1 also documents IDE integrations.
Pi
Pi is an open-source, extensible terminal coding agent from Earendil Works with multi-provider model access, local tools, skills, extensions, prompt templates, and SDK support.
Qwen Code
Qwen Code is an open-source coding agent from the Qwen team with terminal, editor, desktop, browser, and chat surfaces and support for Qwen and third-party model providers.
Zed
Zed is an open-source code editor from Zed Industries with a native coding agent, external agent integrations, terminal-backed agent threads, edit prediction, and multiplayer collaboration.