#### Inference API

# Models

## GET /v1/models

List all models available to the authenticating API key with minimalized information, including model names (ID), creation times, etc.

### Response Body

* `data` (array\<object>, required) — A list of models with with minimalized information.

  * `created` (integer, required) — Model creation time in Unix timestamp.

  * `id` (string, required) — Model ID. Obtainable from \<https://console.x.ai/team/default/models> or \<https://docs.x.ai/docs/models>.

  * `object` (string, required) — The object type, which is always \`"model"\`.

  * `owned_by` (string, required) — Owner of the model.

* `object` (string, required) — The object type of \`data\` field, which is always \`"list"\`.

\*\*Response example:\*\*

```json
{
  "data": [
    {
      "id": "grok-4-0709",
      "created": 1752019200,
      "object": "model",
      "owned_by": "xai"
    },
    {
      "id": "grok-code-fast-1",
      "created": 1755993600,
      "object": "model",
      "owned_by": "xai"
    },
    {
      "id": "grok-3",
      "created": 1743724800,
      "object": "model",
      "owned_by": "xai"
    },
    {
      "id": "grok-3-mini",
      "created": 1743724800,
      "object": "model",
      "owned_by": "xai"
    },
    {
      "id": "grok-2-image-1212",
      "created": 1736726400,
      "object": "model",
      "owned_by": "xai"
    },
    {
      "id": "grok-2-vision-1212",
      "created": 1733961600,
      "object": "model",
      "owned_by": "xai"
    }
  ],
  "object": "list"
}
```

***

## GET /v1/models/\{model\_id}

Get minimalized information about a model with its model\_id.

### Path Parameters

* `model_id` (string, required) — ID of the model to get.

### Response Body

* `created` (integer, required) — Model creation time in Unix timestamp.

* `id` (string, required) — Model ID. Obtainable from \<https://console.x.ai/team/default/models> or \<https://docs.x.ai/docs/models>.

* `object` (string, required) — The object type, which is always \`"model"\`.

* `owned_by` (string, required) — Owner of the model.

\*\*Response example:\*\*

```json
{
  "id": "grok-4-0709",
  "created": 1743724800,
  "object": "model",
  "owned_by": "xai"
}
```

***

## GET /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, pricing, fingerprint and alias(es).

### Response Body

* `models` (array\<object>, required) — Array of available language models.

  * `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

  * `cached_prompt_text_token_price` (integer, required) — Price of a prompt text token (in USD cents per 100 million tokens) that was cached previously.

  * `completion_text_token_price` (integer, required) — Price of the completion text token in USD cents per 100 million token.

  * `created` (integer, required) — Creation time of the model in Unix timestamp.

  * `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

  * `id` (string, required) — Model ID. Obtainable from \<https://console.x.ai/team/default/models> or \<https://docs.x.ai/docs/models>.

  * `input_modalities` (array\<string>, required) — The input modalities supported by the model, e.g. \`"text"\`, \`"image"\`.

  * `object` (string, required) — The object type, which is always \`"model"\`.

  * `output_modalities` (array\<string>, required) — The output modalities supported by the model, e.g. \`"text"\`, \`"image"\`.

  * `owned_by` (string, required) — Owner of the model.

  * `prompt_image_token_price` (integer, required) — Price of the prompt image token in USD cents per 100 million token.

  * `prompt_text_token_price` (integer, required) — Price of the prompt text token in USD cents per 100 million token.

  * `search_price` (integer, required) — Price of the search in USD cents per 100 million searches.

  * `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "models": [
    {
      "id": "grok-3",
      "fingerprint": "fp_898ae9f31c",
      "created": 1743724800,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0",
      "input_modalities": [
        "text"
      ],
      "output_modalities": [
        "text"
      ],
      "prompt_text_token_price": 30000,
      "cached_prompt_text_token_price": 7500,
      "prompt_image_token_price": 0,
      "completion_text_token_price": 150000,
      "search_price": 250000000,
      "aliases": [
        "grok-3-latest",
        "grok-3-beta"
      ]
    },
    {
      "id": "grok-3-mini",
      "fingerprint": "fp_6a09108ff5",
      "created": 1743724800,
      "object": "model",
      "owned_by": "xai",
      "version": "1.0",
      "input_modalities": [
        "text"
      ],
      "output_modalities": [
        "text"
      ],
      "prompt_text_token_price": 3000,
      "cached_prompt_text_token_price": 750,
      "prompt_image_token_price": 0,
      "completion_text_token_price": 5000,
      "search_price": 250000000,
      "aliases": [
        "grok-3-mini-latest",
        "grok-3-mini-beta"
      ]
    },
    {
      "id": "grok-2-vision-1212",
      "fingerprint": "fp_daba7546e5",
      "created": 1733961600,
      "object": "model",
      "owned_by": "xai",
      "version": "0.1.0",
      "input_modalities": [
        "text",
        "image"
      ],
      "output_modalities": [
        "text"
      ],
      "prompt_text_token_price": 20000,
      "prompt_image_token_price": 20000,
      "completion_text_token_price": 100000,
      "aliases": []
    }
  ]
}
```

***

## GET /v1/language-models/\{model\_id}

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

### Path Parameters

* `model_id` (string, required) — ID of the model to get.

### Response Body

* `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

* `cached_prompt_text_token_price` (integer, required) — Price of a prompt text token (in USD cents per 100 million tokens) that was cached previously.

* `completion_text_token_price` (integer, required) — Price of the completion text token in USD cents per 100 million token.

* `created` (integer, required) — Creation time of the model in Unix timestamp.

* `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

* `id` (string, required) — Model ID. Obtainable from \<https://console.x.ai/team/default/models> or \<https://docs.x.ai/docs/models>.

* `input_modalities` (array\<string>, required) — The input modalities supported by the model, e.g. \`"text"\`, \`"image"\`.

* `object` (string, required) — The object type, which is always \`"model"\`.

* `output_modalities` (array\<string>, required) — The output modalities supported by the model, e.g. \`"text"\`, \`"image"\`.

* `owned_by` (string, required) — Owner of the model.

* `prompt_image_token_price` (integer, required) — Price of the prompt image token in USD cents per 100 million token.

* `prompt_text_token_price` (integer, required) — Price of the prompt text token in USD cents per 100 million token.

* `search_price` (integer, required) — Price of the search in USD cents per 100 million searches.

* `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "id": "grok-4-0709",
  "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"
  ]
}
```

***

## GET /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, pricing, fingerprint and alias(es).

### Response Body

* `models` (array\<object>, required) — Array of available image generation models.

  * `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

  * `created` (integer, required) — Model creation time in Unix timestamp.

  * `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

  * `id` (string, required) — Model ID.

  * `image_price` (integer, required) — Price of a single image in USD cents.

  * `input_modalities` (array\<string>, required) — The input modalities supported by the model.

  * `max_prompt_length` (integer, required)

  * `object` (string, required) — The object type, which is always \`"model"\`.

  * `output_modalities` (array\<string>, required) — The output modalities supported by the model.

  * `owned_by` (string, required) — Owner of the model.

  * `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "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 /v1/image-generation-models/\{model\_id}

Get full information about an image generation model with its model\_id.

### Path Parameters

* `model_id` (string, required) — ID of the model to get.

### Response Body

* `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

* `created` (integer, required) — Model creation time in Unix timestamp.

* `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

* `id` (string, required) — Model ID.

* `image_price` (integer, required) — Price of a single image in USD cents.

* `input_modalities` (array\<string>, required) — The input modalities supported by the model.

* `max_prompt_length` (integer, required)

* `object` (string, required) — The object type, which is always \`"model"\`.

* `output_modalities` (array\<string>, required) — The output modalities supported by the model.

* `owned_by` (string, required) — Owner of the model.

* `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "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": []
}
```

***

## GET /v1/video-generation-models

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

### Response Body

* `models` (array\<object>, required) — Array of available video generation models.

  * `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

  * `created` (integer, required) — Model creation time in Unix timestamp.

  * `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

  * `id` (string, required) — Model ID.

  * `input_modalities` (array\<string>, required) — The input modalities supported by the model (e.g. "text", "image").

  * `object` (string, required) — The object type, which is always \`"model"\`.

  * `output_modalities` (array\<string>, required) — The output modalities supported by the model (e.g. "video").

  * `owned_by` (string, required) — Owner of the model.

  * `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "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 /v1/video-generation-models/\{model\_id}

Get full information about a video generation model with its model\_id.

### Path Parameters

* `model_id` (string, required) — ID of the model to get.

### Response Body

* `aliases` (array\<string>, required) — Alias ID(s) of the model that user can use in a request's model field.

* `created` (integer, required) — Model creation time in Unix timestamp.

* `fingerprint` (string, required) — Fingerprint of the xAI system configuration hosting the model.

* `id` (string, required) — Model ID.

* `input_modalities` (array\<string>, required) — The input modalities supported by the model (e.g. "text", "image").

* `object` (string, required) — The object type, which is always \`"model"\`.

* `output_modalities` (array\<string>, required) — The output modalities supported by the model (e.g. "video").

* `owned_by` (string, required) — Owner of the model.

* `version` (string, required) — Version of the model.

\*\*Response example:\*\*

```json
{
  "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": []
}
```
