Model APIs / Embeddings

Embeddings

Vectors in the OpenAI shape, with the provider's own embeddings and the charge on every response.

POST/v1/embeddingsinference:invokeBrowse embedding models →

Request

The OpenAI shape, so any OpenAI SDK's embeddings call works unchanged.

FieldRequiredNotes
modelrequiredAn embeddings model's id.
inputrequiredA string or a list of strings.
dimensionsoptionalVector size, for models that support it.
encoding_formatoptionalHow vectors are encoded, as in the OpenAI shape.
Request
import os
from openai import OpenAI

client = OpenAI(base_url="https://yelno.ai/v1", api_key=os.environ["YELNO_API_KEY"])
res = client.embeddings.create(
    model="MODEL",
    input=["refund policy for damaged items", "shipping times to Canada"],
)
print(len(res.data), len(res.data[0].embedding))

Response

200 · application/json
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, …] },
    { "object": "embedding", "index": 1, "embedding": [ … ] }
  ],
  "model": "…",
  "usage": { … },
  "yelno": { … }
}

The vectors are the provider's, one per input, in input order.

Every JSON response carries the same yelno block a chat response does: request_id, provider, model, endpoint_id, attempts and cost. cost is {state: "final", currency, customer_nanos} when the provider reported the cost with the response, or {state: "pending", currency, note} when it reports it later — the charge then settles once. Errors use the standard error envelope; upstream text never reaches you.

Sending a model to a route it is not served on answers 422 capability_unsupported with code: "operation_unsupported" and a message naming the route that serves it. Every model in the catalog shows its type and route.