API Reference
Embeddings
POST /v1/embeddings
POST /v1/embeddingsOpenAI-compatible embeddings endpoint.
Request
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Your Carrot model name |
input | string | string[] | Yes | Text to embed (single string or array) |
Example
curl https://api.carrotlabs.ai/v1/embeddings \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "my-embedding-model",
"input": "Hello world"
}'Batch embeddings
curl https://api.carrotlabs.ai/v1/embeddings \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "my-embedding-model",
"input": ["Hello world", "Goodbye world"]
}'Errors
| Status | Meaning |
|---|---|
401 | Invalid or missing API key |
404 | Model not found |
502 | Inference provider temporarily unavailable |