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
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | An embedding model id. |
input | string or array | Yes | The 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": { … }, … }
}Foundry documentation