Submit an embedding request
Changed onSubmits an embedding request to the embeddings router
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Request body
Embeddings request input
The number of dimensions for the output embeddings
The format of the output embeddings
Text, token, or multimodal input(s) to embed
The type of input (e.g. search_query, search_document). Document-chunk input (string[][]) is only valid with a document input type.
The model to use for embeddings
Provider routing preferences for the request.
A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
A unique identifier for the end-user
Example request
{
"dimensions": 1536,
"input": "The quick brown fox jumps over the lazy dog",
"model": "openai/text-embedding-3-small"
}Response
Embedding response
Embeddings response containing embedding vectors
List of embedding objects
Unique identifier for the embeddings response
The model used for embeddings
Token usage statistics
Example response
{
"data": [
{
"embedding": [
0.0023064255,
-0.009327292,
0.015797347
],
"index": 0,
"object": "embedding"
}
],
"model": "openai/text-embedding-3-small",
"object": "list",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}Changes
- info
added the new optional request property
provider/allOf[#/components/schemas/ProviderPreferences]/options/celeris - info
added the new
Celerisenum value to the request propertyprovider/allOf[#/components/schemas/ProviderPreferences]/ignore/items/anyOf[#/components/schemas/ProviderName] - info
added the new
Celerisenum value to the request propertyprovider/allOf[#/components/schemas/ProviderPreferences]/only/items/anyOf[#/components/schemas/ProviderName]
1 more change in this revision
- info