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

Response

Successful Response
datalist of objects
modelstring
usageobject
Token usage for embeddings.
object"list"OptionalDefaults to list

Errors

422
Unprocessable Entity Error