Inference API

Embeddings


Create embeddings

/v1/embeddings

Create an embedding vector representation corresponding to the input text. This is the endpoint for making requests to embedding models.

Request Body

Response Body

data

array

A list of embedding objects.

model

string

Model ID used to create embedding.

object

string

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


List embedding models

/v1/embedding-models

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

Response Body

models

array

Array of available embedding models.


Get embedding model

/v1/embedding-models/{model_id}

Get full information about an embedding 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. 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.

object

string

Object type, should be model.

output_modalities

array

The output modalities supported by the model.

owned_by

string

Owner of the model.

prompt_image_token_price

integer

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

prompt_text_token_price

integer

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

version

string

Version of the model.


Last updated: September 2, 2026