Amux AI

Create Embeddings

Last updated November 22, 2026

OpenAI-compatible vector embeddings endpoint supporting OpenAI SDKs and Jina multimodal and task adapter extensions.

OpenAI-compatible vector embeddings endpoint. Official openai Python and TypeScript SDKs work out of the box by setting base_url to Amux AI and authenticating with Authorization: Bearer <key>.

This page documents the shared POST /v1/embeddings protocol schema (also used by Jina AI embedding models). For model-specific context windows, default dimensions, Matryoshka truncation ranges, task adapters, and multimodal input formats, see the per-model guides under the Embeddings section — such as Jina Embeddings v5 Text Small, Jina Embeddings v5 Omni Small, Jina Embeddings v4, and Jina Embeddings v3.

POSThttps://gateway.amux.ai/v1/embeddings

Authorization

header
AuthorizationstringRequired

Bearer <your Amux AI key> Amux AI API key created in the console.

Content-TypestringRequiredDefault "application/json"

Must be application/json.

Request

application/json
modelstringRequired

Canonical model ID or alias (for example jina/jina-embeddings-v5-text-small or jina-embeddings-v5-text-small).

inputstring | object | array<string | object>Required

Input text string, single multimodal object (Jina PDF { pdf } must be sent standalone, not inside an array), array of strings, token ID array, or array of multimodal objects ({ text }, { image }, { audio }, { video }, and V5 Omni fused groups { content: [...] }).

dimensionsinteger

Optional target output vector dimensionality (Matryoshka truncation). Supported ranges vary by model (1–1024 for v5 Small / v3, 1–768 for v5 Nano, 1–2048 for v4).

encoding_format"float" | "base64"

OpenAI-compatible output vector encoding format (float or base64).

embedding_type"float" | "base64" | "binary" | "ubinary" | array<"float" | "base64" | "binary" | "ubinary">

Jina output vector precision or quantization format (float, base64, binary, ubinary, or a list of these).

task"retrieval.query" | "retrieval.passage" | "text-matching" | "clustering" | "classification" | "separation" | "code.query" | "code.passage"

Optional task-specific adapter. Supported values depend on the model (clustering on v5, separation on v3, code.query / code.passage on v4); see per-model docs.

normalizedboolean

Whether to return L2-normalized unit vectors (default true on v5 / v3; not supported on v4).

truncateboolean

Whether to truncate inputs exceeding the model context window instead of returning an error (default false).

late_chunkingboolean

Whether to apply late chunking across the batch (supported for text inputs on v4 and v3; not available on v5).

return_multivectorboolean

Whether to return per-token multi-vector embeddings (jina-embeddings-v4 only; cannot be combined with dimensions).

return_tokenized_inputboolean

Whether to return tokens alongside multi-vector embeddings (jina-embeddings-v4 only; requires return_multivector=true).

userstring

Optional end-user identifier for monitoring and abuse prevention.

Response

200response

Embedding vectors generated successfully.

400response

Invalid request body, unsupported streaming flag, or model does not support the embeddings endpoint.

402response

Insufficient workspace balance.

Protocol overview

  • Synchronous, non-streaming: Embeddings endpoints do not support streaming; passing stream: true returns a 400 error.
  • Direct extension passthrough: Beyond standard OpenAI fields (model, input, dimensions, encoding_format, user), the gateway forwards vendor-specific extensions directly — including Jina's task, embedding_type, normalized, truncate, late_chunking, return_multivector, return_tokenized_input, standalone multimodal objects (such as { pdf }), multimodal arrays, and V5 Omni fused groups ({ content: [...] }).
  • Multimodal token billing: For multimodal embedding requests, usage.total_tokens aggregates text (prompt_tokens) plus image/PDF (image_tokens), audio (audio_tokens), and video (video_tokens) input tokens. Billing uses total_tokens with no output token charges.
  • Endpoint isolation: Embedding models cannot be invoked through text chat endpoints such as /v1/chat/completions or /v1/messages.
  • Size limits: Request payloads are capped at 32 MB and responses at 32 MB. For large high-dimensional batches, split inputs into smaller batches or use base64 encoding.

Error handling

Errors follow the standard OpenAI error schema. Upstream validation errors (including FastAPI 422 responses) are normalized to 400 invalid_request while preserving field-level details; oversized payloads fail immediately without cross-channel retries. See Errors and retries for full error definitions.

cURL
curl https://gateway.amux.ai/v1/embeddings \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jina/jina-embeddings-v5-text-small",
    "input": [
      "Organic skincare for sensitive skin with aloe vera and chamomile."
    ]
  }'
{
  "object": "list",
  "model": "jina/jina-embeddings-v5-text-small",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0123,
        -0.0456,
        0.0789
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "total_tokens": 14,
    "image_tokens": 0,
    "audio_tokens": 0,
    "video_tokens": 0
  }
}