Documentation

Documentation

Embeddings

POST /v1/embeddings — OpenAI-compatible text embeddings from an open model, billed per input token.

POST https://paraloncloud.com/v1/embeddings turns text into vectors, in the same request and response shape as OpenAI's endpoint. Any client that lets you set a base URL works unchanged: the openai packages, LangChain, LlamaIndex, and the Embeddings OpenAI node in n8n.

Request

curl https://paraloncloud.com/v1/embeddings \
  -H "Authorization: Bearer prlc_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "multilingual-e5-small",
    "input": ["query: where is my order", "passage: Your order #4482 shipped on Monday."]
  }'
field
modelan embedding model id from GET /v1/models (listed with "type": "embedding")
inputone string, or an array of up to 256 strings; token ids are accepted too
encoding_formatfloat (default) or base64

Texts longer than the model's input length are truncated at the end, not rejected. Batch what you can: a request carrying 64 texts costs the same tokens as 64 requests carrying one, and counts once against your rate limit.

Response

{
  "object": "list",
  "data": [
    {"object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, ...]},
    {"object": "embedding", "index": 1, "embedding": [...]}
  ],
  "model": "multilingual-e5-small",
  "usage": {"prompt_tokens": 27, "total_tokens": 27}
}

Vectors come back in input order, normalized to unit length, so cosine similarity is the dot product.

Models

iddimensionsinput lengthlanguagesprice per 1M input tokens
multilingual-e5-small384512 tokens100$0.02

E5 models are trained with a prefix: put query: in front of a search query and passage: in front of a document, and use the same convention when you index and when you search. Skipping the prefix works; matching it is measurably better for retrieval.

Embedding models are served on CPU nodes of the network, separate from the GPU workers that run chat models, so a busy chat fleet does not slow your indexing and the reverse.

Billing and limits

Billed per input token at the model's price, from the same credits as chat completions; there are no output tokens. A free key's 250,000-token trial covers the endpoint too, and the per-minute and in-flight limits of a key are shared between its chat and embedding requests. See Credits & Billing.

Clients

Python

from openai import OpenAI
client = OpenAI(base_url="https://paraloncloud.com/v1", api_key="prlc_...")
r = client.embeddings.create(model="multilingual-e5-small",
                             input=["query: return policy", "passage: Returns accepted within 30 days."])
vectors = [d.embedding for d in r.data]

LangChain

from langchain_openai import OpenAIEmbeddings
emb = OpenAIEmbeddings(model="multilingual-e5-small",
                       base_url="https://paraloncloud.com/v1", api_key="prlc_...",
                       check_embedding_ctx_length=False)

check_embedding_ctx_length=False stops LangChain from tokenizing with OpenAI's tokenizer before sending; the server truncates correctly on its own.

n8n: the Embeddings OpenAI node with a credential whose Base URL is https://paraloncloud.com/v1; the model dropdown lists the embedding models the same way it does for chat.

Errors

statuscodemeaning
400invalid_request_errorunknown model, or input empty / not a string or array
429rate_limit_errorkey over its per-minute or in-flight limit, or every worker busy (workers_busy)
503server_errorno worker is serving the model right now