---
title: "POST /images/embeddings"
method: POST
path: "/images/embeddings"
---

# POST /images/embeddings

`POST /images/embeddings`

Return the embedding vectors for given images.
The method makes a REST API call to the `/images/embeddings` route on the given endpoint.

**Deprecated**: This API is deprecated. Use the OpenAI API instead.
See [migration guide](https://learn.microsoft.com/azure/foundry/how-to/model-inference-to-openai-migration).

## Query parameters

- `api-version` string, required

## Headers

- `extra-parameters` 'error' | 'drop' | 'pass-through'

## Request body

- ImageEmbeddingsOptions — The configuration information for an image embeddings request.
  - `input` ImageEmbeddingInput[], required — Input image to embed. To embed multiple inputs in a single request, pass an array. The input must not exceed the max input tokens for the model.
    - `image` string, required — The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`.
    - `text` string — Optional. The text input to feed into the model (like DINO, CLIP). Returns a 422 error if the model doesn't support the value or parameter.
  - `dimensions` integer — Optional. The number of dimensions the resulting output embeddings should have. Passing null causes the model to use its default value. Returns a 422 error if the model doesn't support the value or parameter.
  - `encoding_format` 'base64' | 'binary' | 'float' | 'int8' | 'ubinary' | 'uint8' — Specifies the types of embeddings to generate. Compressed embeddings types like `uint8`, `int8`, `ubinary` and `binary`, may reduce storage costs without sacrificing the integrity of the data. Returns a 422 error if the model doesn't support the value or parameter. Read the model's documentation to know the values supported by your model.
  - `input_type` 'text' | 'query' | 'document' — Represents the input types used for embedding search.
  - `model` string — ID of the specific AI model to use, if more than one model is available on the endpoint.

## Response `200`

The request has succeeded.

- EmbeddingsResult — Representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios.
  - `id` string, required — Unique identifier for the embeddings result.
  - `data` EmbeddingItem[], required — Embedding values for the prompts submitted in the request.
    - `embedding` number[], required — List of embedding values for the input prompt. These represent a measurement of the vector-based relatedness of the provided input. Or a base64 encoded string of the embedding vector.
    - `index` integer, required — Index of the prompt to which the EmbeddingItem corresponds.
    - `object` 'embedding', required — The object type of this embeddings item. Will always be `embedding`.
  - `usage` EmbeddingsUsage, required — Measurement of the amount of tokens used in this request and response.
    - `prompt_tokens` integer, required — Number of tokens in the request.
    - `total_tokens` integer, required — Total number of tokens transacted in this request/response. Should equal the number of tokens in the request.
  - `object` 'list', required — The object type of the embeddings result. Will always be `list`.
  - `model` string, required — The model ID used to generate this result.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.dev/azure/apis/ai-model-inference.md) · [All operations](https://skmtc.dev/azure/apis/ai-model-inference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/ai-model-inference/revisions/6a2cfd0ca1ff/schema)
