Ratel Docs
Hosted APIs

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 a 400.
  • 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.

PlanIncluded each month
FreeNone. Buy credit to use it.
Plus€5
Pro€20
Enterprise€20, or custom

Errors

Errors use the OpenAI envelope: { "error": { "message", "type" } }.

StatusMeaning
400Bad body, unsupported model, or the input was rejected.
401Missing, invalid, or revoked API key.
402Out of Embeddings credit (insufficient_quota). Top up.
413Body over 4 MB.
429Rate limited upstream. Retry with backoff.
502 / 503Temporarily unavailable. Retry.

Usage per project (requests, tokens, latency) is on Models > Embeddings in Cloud.

On this page