Inference API
Models
List models
/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
A list of models with with minimalized information.
object
string
The object type of data field, which is always "list".
Get model
/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
Model creation time in Unix timestamp.
id
string
Model ID. Obtainable from <https://console.x.ai/team/default/models> or <https://docs.x.ai/docs/models>.
object
string
The object type, which is always "model".
owned_by
string
Owner of the model.
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, pricing, fingerprint and alias(es).
Response Body
models
array
Array of available language models.
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_id
string
required
ID of the model to get.
Response Body
aliases
array
Alias ID(s) of the model that user can use in a request's model field.
cached_prompt_text_token_price
integer
Price of a prompt text token (in USD cents per 100 million tokens) that was cached previously.
completion_text_token_price
integer
Price of the completion text token in USD cents per 100 million token.
created
integer
Creation time of the model in Unix timestamp.
fingerprint
string
Fingerprint of the xAI system configuration hosting the model.
id
string
Model ID. Obtainable from <https://console.x.ai/team/default/models> or <https://docs.x.ai/docs/models>.
input_modalities
array
The input modalities supported by the model, e.g. "text", "image".
object
string
The object type, which is always "model".
output_modalities
array
The output modalities supported by the model, e.g. "text", "image".
owned_by
string
Owner of the model.
prompt_image_token_price
integer
Price of the prompt image token in USD cents per 100 million token.
prompt_text_token_price
integer
Price of the prompt text token in USD cents per 100 million token.
search_price
integer
Price of the search in USD cents per 100 million searches.
version
string
Version of the model.
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, pricing, fingerprint and alias(es).
Response Body
models
array
Array of available image generation models.
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_id
string
required
ID of the model to get.
Response Body
aliases
array
Alias ID(s) of the model that user can use in a request's model field.
created
integer
Model creation time in Unix timestamp.
fingerprint
string
Fingerprint of the xAI system configuration hosting the model.
id
string
Model ID.
image_price
integer
Price of a single image in USD cents.
input_modalities
array
The input modalities supported by the model.
max_prompt_length
integer
object
string
The object type, which is always "model".
output_modalities
array
The output modalities supported by the model.
owned_by
string
Owner of the model.
version
string
Version of the model.
List video generation models
/v1/video-generation-models
List all video generation models available to the authenticating API key with full information.
Response Body
models
array
Array of available video generation models.
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_id
string
required
ID of the model to get.
Response Body
aliases
array
Alias ID(s) of the model that user can use in a request's model field.
created
integer
Model creation time in Unix timestamp.
fingerprint
string
Fingerprint of the xAI system configuration hosting the model.
id
string
Model ID.
input_modalities
array
The input modalities supported by the model (e.g. "text", "image").
object
string
The object type, which is always "model".
output_modalities
array
The output modalities supported by the model (e.g. "video").
owned_by
string
Owner of the model.
version
string
Version of the model.
Did you find this page helpful?