/v1/embeddings endpoint is fully
OpenAI-compatible.
Creating embeddings
GET /v1/models.
Parameters
/v1/embeddings accepts exactly these fields:
As with chat, unknown parameters are silently ignored; only the fields above are
forwarded to the model.
Batch input
input can be a single string or an array of strings. Batching many texts in
one request is the recommended way to embed a corpus: it embeds them in a single
round trip and reduces requests-per-minute (RPM) pressure against your
rate limits.
data, each with an index that matches the position of
the corresponding input, so you can align vectors to their source texts.
The response
Billing
Embeddings are billed on input tokens only: there are no output tokens, sousage reports prompt_tokens and total_tokens. Batching many inputs in one
request is priced the same as sending them individually, while cutting your
request count.
Errors and rate limits
Embedding models have their own per-model TPM/RPM limits; exceeding them returns HTTP429; see Rate limits. For error codes, see
Errors.