Create embeddings
POST/embeddings
Turns text into vectors, in the format of OpenAI's embeddings API (client.embeddings.create in the OpenAI SDKs). qwen3-embedding-0.6b (alias qwen/qwen3-embedding-0.6b) returns one vector of 1024 numbers per input, for at most 512 inputs per request.
Billed on usage.prompt_tokens, the input tokens the model read, at the model's input price; output is not billed. GET /v1/models?format=openai lists the model with endpoints: ["/v1/embeddings"] and its price per million tokens. Only Serenity Edge API keys can use this route. See the Embeddings, rerank and redaction guide.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 413
- 429
- 500
- 503
One embedding per input, in input order, with the model id and the tokens the model read. The vectors of the example are shortened to four numbers; each has 1024.
The request was refused: a body that is not a JSON object, a missing or invalid model, input or encoding_format, more than 512 inputs, more than about 300,000 tokens (a quarter of the characters), a model served on another route (The model 'qwen3-reranker-0.6b' is not served on /v1/embeddings.), or a request the model server could not process (The model server rejected the request. Check the input sizes and parameters.). param names the field at fault when there is one.
Missing or invalid API key.
The key is valid but cannot use this route: only Serenity Edge API keys can. Any other key, such as a key from a Serenity Star account, gets permission_denied with a message that names the route's API (embeddings, rerank or redact).
The model id is unknown, or it is a chat or decision model, which cannot be used on this route (model_not_found).
The request body is larger than this route accepts (4 MB, request_too_large).
Rate limit exceeded, or the service is temporarily at capacity for this model. Wait for the number of seconds in the Retry-After header before retrying.
Response Headers
Seconds to wait before retrying.
Unexpected server error: the model service returned an unexpected response (upstream_error), the request got no answer within 600 seconds (timeout), or an error in the gateway. Retry with backoff.
The model service is temporarily unavailable (upstream_unavailable). Retry later and check the status page at https://status.serenityedge.ai.