Create Embedding

Create text embeddings. Returns vector representations of the input text.

Authentication

AuthorizationBearer
Your production key sent as a bearer token.

Request

This endpoint expects an object.
modelstringRequired

Model ID in format ‘provider/model-name’

inputstring or list of stringsRequired
Text to embed
encoding_formatstring or nullOptional
Encoding format for embeddings
dimensionsinteger or nullOptional

Number of dimensions for the output embeddings. Supported by OpenAI text-embedding-3 and later models and by Google gemini embedding models.

task_typestring or nullOptional

Google-only: the embedding task type (e.g. RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING). Ignored for non-Google models.

userstring or nullOptional

End-user identifier

vendorstring or nullOptional
Pin the vendor that runs this request.
customerstring or nullOptional

Customer ID (UUID) to scope this request to, applying that customer’s routing policy, provider keys, budget, and usage attribution.

Response

Successful Response
datalist of objects
modelstring
usageobject
Token usage for embeddings.
vendorstring
Vendor that served the request.
object"list"OptionalDefaults to list

Errors

422
Unprocessable Entity Error