Skip to main content
POST
text.embed

Authorizations

Authorization
string
header
required

API key: sk_live_…

Headers

Idempotency-Key
string

Optional. A retry with the same key returns the stored result.

Maximum string length: 255
Pramaan-Max-Price-Micro
string

Optional. The most this request may be priced at, in micro-USD (a whole number above 0). It replaces the capability's own price ceiling for this request, lower or higher. Sources that could cost more are left out; when none is left the answer is 400 with the lowest limit that would work.

Pattern: ^[1-9]\d{0,14}$

Body

application/json
input
string[]
required

The texts to embed, 1 to 96; each at most 32,000 characters, 1,000,000 characters in total. The vectors come back in this order.

Required array length: 1 - 96 elements
Required string length: 1 - 32000
model
enum<string>

Fixed model name. fast means embed-1; best means embed-2. Omit for embed-2 at 1024 dimensions, or to use an earlier space.

Available options:
fast,
best,
embed-1,
embed-2,
embed-3,
embed-4,
embed-5,
embed-6,
embed-7,
embed-8,
embed-9,
embed-10,
embed-11,
embed-12,
embed-13,
embed-25,
embed-26
inputType
enum<string>
default:document

What the texts are for: "document" is stored and searched over, "query" is a search against stored documents. Default "document".

Available options:
query,
document
dimensions
number

Vector length to ask for, from 2 to 3072. The model must support exactly this size; unsupported sizes are rejected. Omit for the model's default, and omit it when you send space; a length that does not match the space is rejected.

Required range: 2 <= x <= 3072
space
string

Opaque id of the vector space to serve, from an earlier call's result. Old aliases are ignored; a fixed name or size must match the space. Store it next to your vectors and send it back so later calls land in the same space: vectors from different spaces are not comparable, and a space no provider here serves is rejected. Omit to use the default space.

Pattern: ^sp_[0-9a-f]{12}$

Response

The result

model
string
required

Fixed name of the model that produced these vectors.

Pattern: ^embed-[1-9]\d*$
space
string
required

Opaque id of the vector space these vectors live in. Store it next to the vectors and send it back as space on later calls. Vectors from different spaces are not comparable.

Pattern: ^sp_[0-9a-f]{12}$
dimensions
number
required

Length of every vector returned.

embeddings
number[][]
required

One vector per input text, in input order.

usage
object
required

Token usage for the call.