Skip to content

Create embeddings

POST
/embeddings
curl --request POST \
--url https://example.com/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "input": "hello world", "model": "text-embedding-3-small" }'

OpenAI-compatible embeddings. input is a string or array of strings. Models: text-embedding-3-small (1536-dim) / -large (3072-dim). Charged per input token.

Media typeapplication/json
EmbeddingsRequest
object
model
required
Model

Text-embedding-3-small | text-embedding-3-large (or text-embedding-ada-002).

string
input
required
Any of:
string
encoding_format
Any of:
string
Example
{
"input": "hello world",
"model": "text-embedding-3-small"
}

Successful Response

Media typeapplication/json
Examplegenerated
example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}