[API reference]

Embeddings

Turn text into vectors for search, clustering and retrieval. One request can embed up to 2,048 inputs.

POST/v1/embeddings

Create embeddings

curl https://api.topolabs.ai/v1/embeddings \  -H "Authorization: Bearer $TOPO_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "text-embedding-3-large",    "input": ["Stake first, serve second", "Sampled re-execution"],    "dimensions": 1024  }'

Request body

  • modelstringRequired

    An embedding model, such as text-embedding-3-large.

  • inputstring | string[]Required

    Text to embed. Up to 2,048 items per request and 8,192 tokens per item.

  • dimensionsinteger

    Output size between 256 and 3072. Smaller vectors are cheaper to store.

    Default: 3072

  • encoding_formatstring

    float or base64. Base64 cuts response size by about 25%.

    Default: float

Response

response.json
json
{  "object": "list",  "model": "text-embedding-3-large",  "data": [    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0481, 0.0277, ...] },    { "object": "embedding", "index": 1, "embedding": [-0.0092, 0.0314, 0.0619, ...] }  ],  "usage": { "prompt_tokens": 9, "total_tokens": 9 },  "topo": { "node": "us-east-4", "receipt": { "amount": "0.0000012", "currency": "USDT" } }}

Pricing

text-embedding-3-large costs $0.13 per million input tokens. Embeddings have no output tokens, so the input count is the whole bill.