Ratel Docs
FeaturesAPIs

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.

The model is ratel-embed-v1, served by BAAI/bge-base-en-v1.5.

APIs, Embeddings: requests, tokens, average latency and last request, with tokens per day and a quickstart

Use it from the SDK

Point the OpenAI-compatible endpoint source at the Ratel Platform.

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.

Credit

Each call spends Embeddings credit, by the input tokens read. Your plan's monthly allowance goes first, then prepaid credit.

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 is on APIs › Embeddings in the console: Requests, Tokens, Average latency and Last request.

On this page