Docs

Embeddings

POST/api/v1/embeddings

Turn text into vectors for search, clustering, and retrieval. OpenAI request and response shapes, billed at the model's input-token rate only.

Example

curl https://tokenkiln.com/api/v1/embeddings \
  -H "Authorization: Bearer tk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "BAAI/bge-large-en-v1.5",
    "input": ["The quick brown fox", "jumped over the lazy dog"]
  }'

Notes

  • input accepts a single string or an array; arrays come back as one vector per element, in order.
  • encoding_format supports both float and base64. The official SDKs default to base64 and decode transparently; both work here.
  • Use an embedding model from the catalog. Sending chat prompts to an embedding model, or embedding input to a chat model, returns the engine's error and costs nothing.

Billing

Embeddings produce no output tokens, so the request settles as usage.prompt_tokenstimes the model's input rate. The same hold-then-settle flow as chat completions applies, and failed requests are never billed.