Inference API

Models

View as Markdown

List models

/v1/models

List all models available to the authenticating API key, including model names (ID), creation times, and pricing.

Response Body

dataarray<object>

A list of models with with minimalized information.

objectstring

The object type of `data` field, which is always `"list"`.

Exampletext

text

No parameters.
Exampletext

text

{
  "data": [
    {
      "id": "latest",
      "aliases": [],
      "context_length": 131072,
      "created": 1776556800,
      "object": "model",
      "owned_by": "xai",
      "prompt_text_token_price": 12500,
      "cached_prompt_text_token_price": 2000,
      "prompt_image_token_price": 12500,
      "completion_text_token_price": 25000
    },
    {
      "id": "grok-420-reasoning",
      "aliases": [],
      "context_length": 256000,
      "created": 1768003200,
      "object": "model",
      "owned_by": "xai",
      "prompt_text_token_price": 20000,
      "cached_prompt_text_token_price": 2000,
      "prompt_image_token_price": 0,
      "completion_text_token_price": 80000,
      "prompt_text_token_price_long_context": 40000,
      "completion_text_token_price_long_context": 160000,
      "long_context_threshold": 128000,
      "capabilities": {
        "reasoning_effort": [
          "low",
          "medium",
          "high",
          "xhigh"
        ],
        "default_reasoning_effort": "high"
      }
    },
    {
      "id": "grok-imagine-image",
      "aliases": [],
      "context_length": 1024,
      "created": 1769472000,
      "object": "model",
      "owned_by": "xai",
      "image_price": 200000000
    }
  ],
  "object": "list"
}

Get model

/v1/models/{model_id}

Get information about a model with its model_id, including pricing.

Path Parameters

model_idstring

ID of the model to get.

Response Body

aliasesarray<string>

Alias ID(s) of the model that user can use in a request's model field.

createdinteger

Model creation time in Unix timestamp.

objectstring

The object type, which is always `"model"`.

owned_bystring

Owner of the model.

pricingarray<object>

Per-image prices by (quality, resolution) tier (image generation models). Omitted when the model prices all qualities identically (see `image_price`).

Exampletext

text

No parameters.
Exampletext

text

{
  "id": "latest",
  "created": 1776556800,
  "object": "model",
  "owned_by": "xai",
  "prompt_text_token_price": 12500,
  "cached_prompt_text_token_price": 2000,
  "prompt_image_token_price": 12500,
  "completion_text_token_price": 25000
}

List language models

/v1/language-models

List all chat and image understanding models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, fingerprint and alias(es).

Response Body

modelsarray<object>

Array of available language models.

Exampletext

text

No parameters.
Exampletext

text

{
  "models": [
    {
      "id": "latest",
      "fingerprint": "fp_777a9f8466",
      "created": 1776556800,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0",
      "input_modalities": [
        "text",
        "image"
      ],
      "output_modalities": [
        "text"
      ],
      "prompt_text_token_price": 12500,
      "cached_prompt_text_token_price": 2000,
      "prompt_image_token_price": 12500,
      "completion_text_token_price": 25000,
      "search_price": 0,
      "prompt_text_token_price_long_context": 0,
      "cached_prompt_text_token_price_long_context": 0,
      "completion_text_token_price_long_context": 0,
      "long_context_threshold": 0,
      "aliases": [
        "grok-4.3-latest"
      ]
    },
    {
      "id": "grok-420-reasoning",
      "fingerprint": "fp_5319828d69",
      "created": 1768003200,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0",
      "input_modalities": [
        "text"
      ],
      "output_modalities": [
        "text"
      ],
      "prompt_text_token_price": 20000,
      "cached_prompt_text_token_price": 2000,
      "prompt_image_token_price": 0,
      "completion_text_token_price": 80000,
      "search_price": 0,
      "prompt_text_token_price_long_context": 40000,
      "cached_prompt_text_token_price_long_context": 0,
      "completion_text_token_price_long_context": 160000,
      "long_context_threshold": 128000,
      "aliases": [],
      "capabilities": {
        "reasoning_effort": [
          "low",
          "medium",
          "high",
          "xhigh"
        ],
        "default_reasoning_effort": "high"
      }
    }
  ]
}

Get language model

/v1/language-models/{model_id}

Get full information about a chat or image understanding model with its model_id.

Path Parameters

model_idstring

ID of the model to get.

Response Body

aliasesarray<string>

Alias ID(s) of the model that user can use in a request's model field.

cached_prompt_text_token_priceinteger

Price of a prompt text token (in USD cents per 100 million tokens) that was cached previously.

cached_prompt_text_token_price_long_contextinteger

Price of the cached prompt text token for long context requests (USD cents per 100 million tokens). When 0, falls back to cached_prompt_text_token_price.

completion_text_token_priceinteger

Price of the completion text token in USD cents per 100 million token.

completion_text_token_price_long_contextinteger

Price of the completion text token for long context requests (USD cents per 100 million tokens). When 0, the standard completion_text_token_price applies.

createdinteger

Creation time of the model in Unix timestamp.

fingerprintstring

Fingerprint of the xAI system configuration hosting the model.

input_modalitiesarray<string>

The input modalities supported by the model, e.g. `"text"`, `"image"`.

long_context_thresholdinteger

Token count at or above which the long context prices apply. When 0, the model has no long context pricing tier.

objectstring

The object type, which is always `"model"`.

output_modalitiesarray<string>

The output modalities supported by the model, e.g. `"text"`, `"image"`.

owned_bystring

Owner of the model.

prompt_image_token_priceinteger

Price of the prompt image token in USD cents per 100 million token.

prompt_text_token_priceinteger

Price of the prompt text token in USD cents per 100 million token.

prompt_text_token_price_long_contextinteger

Price of the prompt text token for long context requests (USD cents per 100 million tokens). When 0, the standard prompt_text_token_price applies at all context lengths.

search_priceinteger

Price of the search in USD cents per 100 million searches.

versionstring

Version of the model.

Exampletext

text

No parameters.
Exampletext

text

{
  "id": "latest",
  "fingerprint": "fp_156d35dcaa",
  "created": 1743724800,
  "object": "model",
  "owned_by": "xai",
  "version": "1.0.0",
  "input_modalities": [
    "text"
  ],
  "output_modalities": [
    "text"
  ],
  "prompt_text_token_price": 20000,
  "cached_prompt_text_token_price": 0,
  "prompt_image_token_price": 0,
  "completion_text_token_price": 100000,
  "aliases": [
    "grok-4",
    "grok-4-latest"
  ]
}

List image generation models

/v1/image-generation-models

List all image generation models available to the authenticating API key with full information. Additional information compared to /v1/models includes modalities, fingerprint and alias(es).

Response Body

modelsarray<object>

Array of available image generation models.

Exampletext

text

No parameters.
Exampletext

text

{
  "models": [
    {
      "id": "grok-imagine-image",
      "fingerprint": "fp_ca78641a52",
      "max_prompt_length": 1024,
      "created": 1738961600,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0.0",
      "prompt_text_token_price": 100000,
      "prompt_image_token_price": 100000,
      "generated_image_token_price": 100000,
      "aliases": []
    }
  ]
}

Get image generation model

/v1/image-generation-models/{model_id}

Get full information about an image generation model with its model_id.

Path Parameters

model_idstring

ID of the model to get.

Response Body

aliasesarray<string>

Alias ID(s) of the model that user can use in a request's model field.

createdinteger

Model creation time in Unix timestamp.

fingerprintstring

Fingerprint of the xAI system configuration hosting the model.

idstring

Model ID.

image_priceinteger

Price of a single image in USD cents. The default tier: medium quality at the default (1k) resolution. See `pricing` for the full quality/resolution matrix.

input_modalitiesarray<string>

The input modalities supported by the model.

max_prompt_lengthinteger

objectstring

The object type, which is always `"model"`.

output_modalitiesarray<string>

The output modalities supported by the model.

owned_bystring

Owner of the model.

pricingarray<object>

Per-image prices by (quality, resolution) tier. One entry per combination the model serves; omitted when the model prices all qualities identically (see `image_price`).

versionstring

Version of the model.

Exampletext

text

No parameters.
Exampletext

text

{
  "id": "grok-imagine-image",
  "fingerprint": "fp_ca78641a52",
  "max_prompt_length": 1024,
  "created": 1737961600,
  "object": "model",
  "owned_by": "xai",
  "version": "1.0.0",
  "prompt_text_token_price": 100000,
  "prompt_image_token_price": 100000,
  "generated_image_token_price": 100000,
  "aliases": []
}

List video generation models

/v1/video-generation-models

List all video generation models available to the authenticating API key with full information.

Response Body

modelsarray<object>

Array of available video generation models.

Exampletext

text

No parameters.
Exampletext

text

{
  "models": [
    {
      "id": "grok-imagine-video",
      "fingerprint": "fp_898ae9f31c",
      "created": 1743724800,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0.0",
      "input_modalities": [
        "text",
        "image"
      ],
      "output_modalities": [
        "video"
      ],
      "aliases": []
    }
  ]
}

Get video generation model

/v1/video-generation-models/{model_id}

Get full information about a video generation model with its model_id.

Path Parameters

model_idstring

ID of the model to get.

Response Body

aliasesarray<string>

Alias ID(s) of the model that user can use in a request's model field.

createdinteger

Model creation time in Unix timestamp.

fingerprintstring

Fingerprint of the xAI system configuration hosting the model.

idstring

Model ID.

input_modalitiesarray<string>

The input modalities supported by the model (e.g. "text", "image"; "audio" for models accepting reference audio).

objectstring

The object type, which is always `"model"`.

output_modalitiesarray<string>

The output modalities supported by the model (e.g. "video").

owned_bystring

Owner of the model.

versionstring

Version of the model.

Exampletext

text

No parameters.
Exampletext

text

{
  "id": "grok-imagine-video",
  "fingerprint": "fp_898ae9f31c",
  "created": 1743724800,
  "object": "model",
  "owned_by": "xai",
  "version": "1.0",
  "input_modalities": [
    "text",
    "image"
  ],
  "output_modalities": [
    "video"
  ],
  "aliases": []
}

Last updated:April 13, 2026