---
title: "Submit an embedding request"
method: POST
path: "/embeddings"
tags: ["Embeddings"]
---

# Submit an embedding request

`POST /embeddings`

Submits an embedding request to the embeddings router

## Request body

- object — Embeddings request input
  - `dimensions` integer — The number of dimensions for the output embeddings
  - `encoding_format` 'float' | 'base64' — The format of the output embeddings
  - `input` union, required — Text, token, or multimodal input(s) to embed
    - string
    - string[]
    - number[]
    - array[]
      - number[]
    - object[]
      - `content` union[], required
        - union
          - object
            - `text` string, required
            - `type` 'text', required
          - object
            - `image_url` object, required
              - …
            - `type` 'image_url', required
          - ContentPartInputAudio
            - `input_audio` MultimodalMedia, required
              - …
            - `type` 'input_audio', required
          - ContentPartInputVideo
            - `input_video` MultimodalMedia, required
              - …
            - `type` 'input_video', required
          - ContentPartInputFile
            - `input_file` MultimodalMedia, required
              - …
            - `type` 'input_file', required
  - `input_type` string — The type of input (e.g. search_query, search_document)
  - `model` string, required — The model to use for embeddings
  - `provider` object, nullable — Provider routing preferences for the request.
    - `allow_fallbacks` boolean, nullable — Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
    - `data_collection` 'deny' | 'allow' | 'null', nullable — Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it - deny: use only providers which do not collect user data.
    - `enforce_distillable_text` boolean, nullable — Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.
    - `ignore` union[], nullable — List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `max_price` object — The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
      - `audio` string — Price per audio unit
      - `completion` string — Price per million completion tokens
      - `image` string — Price per image
      - `prompt` string — Price per million prompt tokens
      - `request` string — Price per request
    - `only` union[], nullable — List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `order` union[], nullable — An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `preferred_max_latency` union — Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
      - number, double
      - PercentileLatencyCutoffs — Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
        - `p50` number, double, nullable — Maximum p50 latency (seconds)
        - `p75` number, double, nullable — Maximum p75 latency (seconds)
        - `p90` number, double, nullable — Maximum p90 latency (seconds)
        - `p99` number, double, nullable — Maximum p99 latency (seconds)
      - unknown
    - `preferred_min_throughput` union — Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
      - number, double
      - PercentileThroughputCutoffs — Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
        - `p50` number, double, nullable — Minimum p50 throughput (tokens/sec)
        - `p75` number, double, nullable — Minimum p75 throughput (tokens/sec)
        - `p90` number, double, nullable — Minimum p90 throughput (tokens/sec)
        - `p99` number, double, nullable — Minimum p99 throughput (tokens/sec)
      - unknown
    - `quantizations` Quantization[], nullable — A list of quantization levels to filter the provider by.
    - `require_parameters` boolean, nullable — Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
    - `sort` union — The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
      - 'price' | 'throughput' | 'latency' | 'exacto' — The provider sorting strategy (price, throughput, latency)
      - ProviderSortConfig — The provider sorting strategy (price, throughput, latency)
        - `by` 'price' | 'throughput' | 'latency' | 'exacto' | 'null', nullable — The provider sorting strategy (price, throughput, latency)
        - `partition` 'model' | 'none' | 'null', nullable — Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
      - unknown
    - `zdr` boolean, nullable — Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
  - `user` string — A unique identifier for the end-user

## Response `200`

Embedding response

- object — Embeddings response containing embedding vectors
  - `data` object[], required — List of embedding objects
    - `embedding` union, required — Embedding vector as an array of floats or a base64 string
      - number[]
      - string
    - `index` integer — Index of the embedding in the input list
    - `object` 'embedding', required
  - `id` string — Unique identifier for the embeddings response
  - `model` string, required — The model used for embeddings
  - `object` 'list', required
  - `usage` object — Token usage statistics
    - `cost` number, double — Cost of the request in credits
    - `cost_details` object, nullable — Breakdown of upstream inference costs
      - `upstream_inference_completions_cost` number, double, required
      - `upstream_inference_cost` number, double, nullable
      - `upstream_inference_prompt_cost` number, double, required
    - `is_byok` boolean — Whether a request was made using a Bring Your Own Key configuration
    - `prompt_tokens` integer, required — Number of tokens in the input
    - `prompt_tokens_details` object — Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.
      - `audio_tokens` integer — Number of audio tokens in the input
      - `file_tokens` integer — Number of file/document tokens in the input
      - `image_tokens` integer — Number of image tokens in the input
      - `text_tokens` integer — Number of text tokens in the input
      - `video_tokens` integer — Number of video tokens in the input
    - `total_tokens` integer, required — Total number of tokens used

## Other responses

- `400` — Bad Request - Invalid request parameters or malformed input
- `401` — Unauthorized - Authentication required or invalid credentials
- `402` — Payment Required - Insufficient credits or quota to complete request
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - Unexpected server error
- `502` — Bad Gateway - Provider/upstream API failure
- `503` — Service Unavailable - Service temporarily unavailable
- `524` — Infrastructure Timeout - Provider request timed out at edge network
- `529` — Provider Overloaded - Provider is temporarily overloaded

## Changes

- **2026-06-19** `45a08ba87968` — 2 info
  - added the optional property `usage/cost_details` to the response with the `200` status
  - added the optional property `usage/is_byok` to the response with the `200` status

[Change history](https://skmtc.dev/openrouterteam/apis/openrouter-api/changes/embeddings/post.md)

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) · [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openrouterteam/openrouter-api/revisions/619a2678ecee/schema)
