iilib
API

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.

API documentationOfficial siteVerified Oct 3, 2026
Provider type
First Party
Provider
SpaceXAI
Connected models
1
Product integrations
8
OpenAI compatible
Yes

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

ResponsesChat CompletionsStreamingFunction callingWeb searchX searchCode executionImagesVideoVoiceFilesBatch processing

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.

Toolactive

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.

Agentactive

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.

Agentactive

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.

Agentactive

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.

Agentactive

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.

Agentactive

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.

Agentactive

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.

Toolactive

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.

Provider