Embeddings API
POST https://tokuse.com/v1/embeddings returns text vectors in the OpenAI embeddings format. It is the endpoint to use for retrieval, clustering, and similarity search when your documents and queries are text.
| Item | Value |
|---|---|
| Method and path | POST /v1/embeddings |
| Authentication | Authorization: Bearer $TOKUSE_API_KEY |
| Models | A text embedding model enabled on the upstream account |
| Pricing | Tokuse pricing and the upstream provider console |
Endpoint and authentication
Send the key as a Bearer token. The request body takes a single string or an array of strings in input. Embeddings requests are usually made from a backend job, not from a browser.
Models and prerequisites
A text embedding model has to be enabled on the upstream account before the request can succeed. Model IDs and vector dimensions are provider-specific; take the exact ID from the catalog rather than guessing from another provider's naming.
Volcengine multimodal embeddings are a separate case. Those requests go to the upstream /api/v3/embeddings/multimodal path and are not part of this standard endpoint. Do not send image inputs to /v1/embeddings and expect the multimodal route.
Request
curl https://tokuse.com/v1/embeddings \
-H "Authorization: Bearer $TOKUSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-embedding-model",
"input": [
"key rotation checklist",
"deployment rollback steps"
]
}'
Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, 0.0011]
},
{
"object": "embedding",
"index": 1,
"embedding": [0.0321, 0.0148, -0.0654, 0.0207]
}
],
"model": "your-embedding-model",
"usage": {
"prompt_tokens": 14,
"total_tokens": 14
}
}
The example shortens the vector. Real vectors contain hundreds or thousands of floats depending on the model.
Notes and limits
- Enable a text embedding model on the upstream account first. Without one, the request fails before any vector is produced.
- Batch several strings in one
inputarray to cut request overhead. The maximum batch size and token limit come from the selected model. - A missing model and an upstream channel failure can look similar from the client. Log the upstream error text when an embedding job starts failing.
Billing
There are no fixed prices here. Text embeddings are billed by input tokens at the rates on the Tokuse pricing page and in the upstream provider console. Check /pricing and the upstream console before running a large backfill.