Embeddings
Hosted, OpenAI-compatible embeddings authenticated by your project key.
POST https://cloud.ratel.sh/v1/embeddings turns text into vectors.
It speaks the OpenAI embeddings contract, so anything that calls OpenAI's /v1/embeddings can call it. No separate provider account is needed.
Use it from the SDK
Point the OpenAI-compatible endpoint source at Ratel Cloud.
import { ratel } from "@ratel-ai/sdk";
const r = ratel({
method: "hybrid",
embedding: {
url: "https://cloud.ratel.sh/v1/embeddings",
model: "ratel-embed-v1",
apiKeyEnv: "RATEL_API_KEY",
},
});from ratel_ai import ToolCatalog
catalog = ToolCatalog(
method="hybrid",
embedding={
"url": "https://cloud.ratel.sh/v1/embeddings",
"model": "ratel-embed-v1",
"api_key_env": "RATEL_API_KEY",
},
)Call it directly
curl -s https://cloud.ratel.sh/v1/embeddings \
-H "Authorization: Bearer $RATEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ratel-embed-v1", "input": ["create a task", "search documents"]}'{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, "..."] },
{ "object": "embedding", "index": 1, "embedding": [0.0789, 0.0012, "..."] }
],
"model": "ratel-embed-v1",
"usage": { "prompt_tokens": 6, "total_tokens": 6 }
}Request
input: a string or an array of up to 512 strings.model:ratel-embed-v1, or omit it. Any other value is a400.encoding_format: only"float".- Body size: up to 4 MB.
Vectors have 768 dimensions. English text works best.
Long inputs
An input longer than the model's 512-token window is cut to fit instead of failing the batch.
The response then carries truncated_inputs: the indexes of the inputs that were cut. It is absent when nothing was cut.
Pricing
€0.0075 per 1M input tokens, spent from your Embeddings balance.
| Plan | Included each month |
|---|---|
| Free | None. Buy credit to use it. |
| Plus | €5 |
| Pro | €20 |
| Enterprise | €20, or custom |
Errors
Errors use the OpenAI envelope: { "error": { "message", "type" } }.
| Status | Meaning |
|---|---|
400 | Bad body, unsupported model, or the input was rejected. |
401 | Missing, invalid, or revoked API key. |
402 | Out of Embeddings credit (insufficient_quota). Top up. |
413 | Body over 4 MB. |
429 | Rate limited upstream. Retry with backoff. |
502 / 503 | Temporarily unavailable. Retry. |
Usage per project (requests, tokens, latency) is on Models > Embeddings in Cloud.