Embeddings
The embeddings request, its limits and its answer.
POST https://api.sylphx.com/v1/embeddings returns one vector per input. The wire is
OpenAI-compatible, so the OpenAI SDKs work with only the base URL and the key
changed.
Check which embedding models your key can call
Embeddings are served on their own meter and only for models the catalogue
lists for them. The public catalogue lists no embedding model, so read
the catalogue your key sees before you build on this route: GET https://api.sylphx.com/v1/models. A model id the catalogue does not serve answers 404 model_not_found.
Request
curl https://api.sylphx.com/v1/embeddings \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<an embedding model id from your catalogue>",
"input": ["The first text", "The second text"]
}'| Field | Type | What it is |
|---|---|---|
model | string | The model id from the catalogue. Required. |
input | string or string[] | One text, or a batch of up to 2048 texts. Each text must be non-empty and at most 64 KiB. |
dimensions | integer | The output size. Accepted only for models that support choosing it. |
encoding_format | string | Only float is served. |
The request is strict: a key the API does not know is refused with a typed
invalid_request that names its path, not silently dropped.
Response
An object of type list: a data array with one embedding object per input
(index, embedding), the model that served, and usage with the tokens
metered.
Errors
The error envelope, the retry rules and the Idempotency-Key header are the
same as on every other call: see errors and retries. A 402
means a spending cap held the request before any model was called.