---
title: "POST /v1/encode/{model}"
method: POST
path: "/v1/encode/{model}"
tags: ["inference"]
---

# POST /v1/encode/{model}

`POST /v1/encode/{model}`

Mixed-success batches return 200 with only successful items; the response carries no per-item error envelope. For per-item error visibility, send single-item batches.

## Path parameters

- `model` string, required

## Headers

- `X-SIE-MACHINE-PROFILE` string, nullable
- `X-SIE-Pool` string, nullable
- `X-SIE-SDK-Version` string, nullable

## Request body

- EncodeRequest
  - `items` ItemInput[], required
    - `audio` AudioInput
      - `data` string, byte, required — Media bytes. Base64-encoded on the JSON path; native binary on the msgpack path.
      - `format` string, nullable
      - `sample_rate` integer, nullable — Sample rate in Hz. Must be positive.
    - `document` DocumentInput
      - `data` string, byte, required — Media bytes. Base64-encoded on the JSON path; native binary on the msgpack path.
      - `format` string, nullable
    - `id` string, nullable
    - `images` ImageInput[], nullable
      - `data` string, byte, required — Media bytes. Base64-encoded on the JSON path; native binary on the msgpack path.
      - `format` string, nullable
    - `metadata` unknown
    - `text` string, nullable
    - `video` VideoInput
      - `data` string, byte, required — Media bytes. Base64-encoded on the JSON path; native binary on the msgpack path.
      - `format` string, nullable
  - `params` EncodeParams
    - `instruction` string, nullable
    - `options` unknown
    - `output_dtype` 'float32' | 'float16' | 'int8' | 'uint8' | 'binary'
    - `output_types` OutputType[], nullable

## Response `200`

Encode response

- EncodeResponse
  - `items` EncodeResult[], required
    - `dense` DenseVector
      - `dims` integer, required
      - `dtype` 'float32' | 'float16' | 'int8' | 'uint8' | 'binary', required
      - `values` number[], required
    - `id` string, nullable
    - `multivector` MultiVector
      - `dtype` 'float32' | 'float16' | 'int8' | 'uint8' | 'binary', required
      - `num_tokens` integer, required
      - `token_dims` integer, required
      - `values` array[], required
        - number[]
    - `sparse` SparseVector
      - `dims` integer, nullable
      - `dtype` 'float32' | 'float16' | 'int8' | 'uint8' | 'binary', required
      - `indices` integer[], required
      - `values` number[], required
  - `model` string, required
  - `timing` TimingInfo
    - `inference_ms` number, double, required
    - `postprocessing_ms` number, double, nullable
    - `queue_ms` number, double, required
    - `tokenization_ms` number, double, required
    - `total_ms` number, double, required
  - `usage` Usage — Authoritative worker-emitted usage. Post-tokenization counts, never a character estimate. A reported `0` is a measurement (a request that read no text); an absent block means the serving path could not count. Structurally identical to `ScoreUsage`, which shipped this shape first.
    - `images` integer, nullable
    - `input_tokens` integer, required

## Other responses

- `400` — Invalid request
- `401` — Missing or invalid bearer token
- `404` — Model not found
- `409` — Bundle override conflicts with model routing
- `413` — Request body too large
- `500` — All batch items failed or gateway internal error; gateway auth enabled but no tokens configured
- `502` — Terminal model load failure (MODEL_LOAD_FAILED)
- `503` — Provisioning in progress, queue unavailable, GPU not configured, model loading, or capacity exhausted
- `504` — Result channel closed

## Changes

> 41 revisions in range; 2 could not be searched.

- **2026-07-03** `a07e76b98502` — 1 warning
  - deleted the `header` request parameter `X-SIE-Engine`
- **2026-06-13** `a7b0c412cdd4` — 1 breaking
  - removed the success response with the status `202`
- **2026-06-03** `f4131a4016da` — 1 info
  - added the new optional `header` request parameter `X-SIE-Engine`
- **2026-05-08** `a499d5bea359` — 1 info
  - added the success response with the status `202`

[Change history](https://skmtc.dev/superlinked/apis/sie-gateway/changes/v1/encode/:model/post.md)

---

[API](https://skmtc.dev/superlinked/apis/sie-gateway.md) · [All operations](https://skmtc.dev/superlinked/apis/sie-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/superlinked/sie-gateway/revisions/78eeecd83405/schema)
