API reference

Embeddings

Vectors for text, billed per input token.

On this page

POST/v1/embeddings

Returns one vector per input.

Auth: API key, or pay per request under https://api.usdf.fi/x402

NameTypeRequiredDescription
modelstringYesAn embedding model id.
inputstring or arrayYesThe text, or a list of texts, to embed.

POST /v1/embeddings

curl
curl -X POST https://api.usdf.fi/v1/embeddings \
  -H "Authorization: Bearer $USDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<embedding model>",
    "input": ["The first text", "The second text"]
  }'

Response, trimmed

{
  "object": "list",
  "data": [{ "object": "embedding", "index": 0, "embedding": [ … ] }, … ],
  "model": "<embedding model>",
  "usage": { "prompt_tokens": …, "total_tokens": … },
  "receipt": { "request_id": "<request_id>", "cost": { … }, … }
}