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
The primary inference endpoint is api.x.ai and authenticates with bearer API keys. The REST API includes Responses and Chat Completions alongside image, video, voice, file, batch, and model endpoints.
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 available as an IDE extension, command-line tool, and SDK. It can read and write files, run terminal commands, and use browser and external tools.
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 available through a terminal interface, desktop app, and IDE integrations, with support for multiple model providers and local models.
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.