# Create embedding

> Turn text, token arrays or multimodal content into embedding vectors.

`POST https://api.numes.ai/api/v1/embeddings`

Source: https://0.0.0.0:3000/docs/api-reference/embeddings/create-embedding
Authorization: Bearer inference key

Vectors come back sorted by `index`; `encoding_format: "base64"` returns each vector base64-encoded. `dimensions`, `encoding_format` and `input_type` are forwarded to the endpoint; with `provider.require_parameters: true`, only endpoints that declare them are used. Find embedding models with `GET /models?output_modalities=embeddings`. Your account's [request policy](/docs/privacy/request-policy) applies to text inputs; images, files, audio and token arrays aren't inspected. Guide: [Embeddings](/docs/multimodal/embeddings).

```request
{
  "method": "POST",
  "path": "/embeddings",
  "body": {
    "model": "author/embedding-model",
    "input": ["The quick brown fox", "jumps over the lazy dog"]
  }
}
```

```json title="Response 200"
{
  "id": "embd-0f5b5c9a-3a7e-4c6f-9d1e-2b8f7a6c5d4e",
  "object": "list",
  "model": "author/embedding-model",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, 0.0789] },
    { "object": "embedding", "index": 1, "embedding": [0.0231, -0.0112, 0.0654] }
  ],
  "usage": { "prompt_tokens": 10, "total_tokens": 10, "cost": 0.000001 }
}
```

## Headers

- `X-Request-Id` (string; Length 1–128): Correlation ID, not an idempotency key. Inference request IDs recorded with a generation are unique per account. A traffic-admitted request reusing a recorded ID returns 400 invalid_request. Traffic admission rejection takes precedence over this conflict, including for reused IDs; it performs no generation lookup and writes no generation, result or attempt. Rate-limit rejection returns 429 rate_limited with Retry-After; an inference limiter outage retains 500 server.

## Request body (application/json)

- `model` (string; required; Length 3–393; Pattern ^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$)
- `input` (string | array<string> | array<integer> | array<array<integer>> | array<array<object>>; required)
  - variant Option 1
  - variant Option 2
  - variant Option 3
  - variant Option 4
  - variant Option 5
- `dimensions` (integer; Range 1–65,536)
- `encoding_format` (enum<string>; default "float"; one of float, base64)
- `input_type` (string; Length ≤ 128)
- `provider` (object)
  - `order` (array<string>; Items ≤ 100; Item length 1–256)
  - `allow_fallbacks` (boolean; default true)
  - `require_parameters` (boolean; default false)
  - `data_collection` (enum<string>; one of allow, deny)
  - `zdr` (boolean)
  - `only` (array<string>; Items ≤ 100; Item length 1–256)
  - `ignore` (array<string>; Items ≤ 100; Item length 1–256)
  - `quantizations` (array<string>; Items ≤ 100; Item length 1–256)
  - `regions` (array<string>; Items ≤ 64; Unique items; Item pattern ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$): Numes extension filtering endpoint-declared country or region identifiers.
  - `sort` (enum<string>; one of price, throughput, latency, quality): Deterministic provider sort. `quality` is a deliberate Numes compatibility extension that ranks endpoints by exact task-scoped content-free validation evidence; it is opt-in and never changes the default routing order.

  - `max_price` (object)
    - `prompt` (number; Range ≥ 0)
    - `completion` (number; Range ≥ 0)

## Response 200 (application/json)

- `id` (string; required)
- `object` (string; required)
- `model` (string; required; Pattern ^[a-z0-9][a-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._:-]{0,291}$)
- `data` (array<object>; required)
  - `object` (string; required)
  - `index` (integer; required; Range ≥ 0)
  - `embedding` (array<number> | string; required)
    - variant Option 1
    - variant Option 2
- `usage` (object; required)
  - `prompt_tokens` (integer; required; Range ≥ 0)
  - `total_tokens` (integer; required; Range ≥ 0)
  - `cost` (number; required; Range ≥ 0)

## Response 503 (application/json)

- `error` (object; required)
  - `code` (integer; required)
  - `message` (string; required)
  - `metadata` (object)
- `openrouter_metadata` (object)

## Response default (application/json)

- `error` (object; required)
  - `code` (integer; required)
  - `message` (string; required)
  - `metadata` (object)
- `openrouter_metadata` (object)
