OP Inference
API reference

Create embeddings

POST
/v1/embeddings

Turn text or token ids into vectors. The answer is one JSON body; it never streams. A request fails over only to another endpoint serving the same model, so the vectors stay in one space.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your API key, sent as Authorization: Bearer <key>.

Header Parameters

Idempotency-Key?string

Any string you choose. A retry with the same key and body returns the first result instead of running again. The same key with a different body is a 409 idempotency_conflict.

Request Body

application/json
  1. body
model*string
input*|array<string>|array<integer>|array<array<integer>>

A string, an array of strings, an array of token ids, or an array of token-id arrays. Nothing in it may be empty.

encoding_format?string
Default"float"
Value in"float""base64"
dimensions?integer

Supported by some models only.

Range1 <= value

Response Body

One vector per input, in input order.

application/json
  1. response
id?string
object?string
model?string
provider?string

The provider that served the request.

data?array<>
usage?
curl -X POST "https://example.com/v1/embeddings" \  -H "Authorization: Bearer $OP_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "qwen/qwen3-embedding-8b",    "input": [      "The food was delicious.",      "The service was slow."    ]  }'
{  "id": "string",  "object": "list",  "model": "string",  "provider": "string",  "data": [    {      "object": "embedding",      "index": 0,      "embedding": [        0      ]    }  ],  "usage": {    "prompt_tokens": 0,    "total_tokens": 0  }}