---
updatedAt: 2026-10-21T01:37:50.000Z
---

# Creates an embedding vector from the input text, image, or text and image.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "NVIDIA NIM API for nvidia/nemotron-3.5-embed-8b",
    "description": "The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim/reference/nvidia-nemotron-3_5-embed-8b for more details.",
    "version": "1.0.0",
    "termsOfService": "https://nvidia.com/legal/terms-of-use",
    "contact": {
      "name": "NVIDIA Support",
      "url": "https://help.nvidia.com/"
    }
  },
  "servers": [
    {
      "url": "https://integrate.api.nvidia.com/v1"
    }
  ],
  "paths": {
    "/embeddings": {
      "post": {
        "tags": [
          "Embeddings"
        ],
        "summary": "Creates an embedding vector from the input text, image, or text and image.",
        "operationId": "nvidia-nemotron-3_5-embed-8b-infer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "description": "Input to embed. Each item is text, one image, or text followed by one image. Send an image as a base64 data URL, for example `data:image/png;base64,<data>`, or as an `<img src=\"data:image/png;base64,<data>\">` tag. PNG and JPEG images are supported, with one image per item. Max length is 10240 tokens.\n",
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    ],
                    "minLength": 1,
                    "title": "Input"
                  },
                  "model": {
                    "type": "string",
                    "description": "ID of the embedding model.",
                    "example": "nvidia/nemotron-3.5-embed-8b",
                    "default": "nvidia/nemotron-3.5-embed-8b",
                    "title": "Model"
                  },
                  "input_type": {
                    "type": "string",
                    "enum": [
                      "passage",
                      "query"
                    ],
                    "description": "nvidia/nemotron-3.5-embed-8b operates in `passage` or `query` mode, and thus requires the `input_type` parameter. `passage` is used when generating embeddings during indexing. `query` is used when generating embeddings during querying. Inputs that contain an image must use `passage`. It is very important to use the correct `input_type`. Failure to do so will result in large drops in retrieval accuracy.\n",
                    "title": "Input Type"
                  },
                  "modality": {
                    "type": "string",
                    "enum": [
                      "text",
                      "image",
                      "text_image"
                    ],
                    "description": "The modality of each input item: `text`, `image`, or `text_image`. Give one value for all items, or one value per item. If omitted, the modality is inferred from the input.\n",
                    "title": "Modality"
                  },
                  "encoding_format": {
                    "type": "string",
                    "description": "The format to return the embeddings in.",
                    "enum": [
                      "float",
                      "base64"
                    ],
                    "default": "float",
                    "title": "Encoding Format"
                  },
                  "truncate": {
                    "type": "string",
                    "description": "Specifies how inputs longer than the maximum token length (10240) are handled. `END` discards the end of the text until the input fits. `NONE` returns an error when the input exceeds the maximum. `START` is not supported. The image and the passage prefix must always fit; an image block that alone exceeds the maximum is rejected in every mode.\n",
                    "enum": [
                      "NONE",
                      "END"
                    ],
                    "default": "END",
                    "title": "Truncate"
                  },
                  "dimensions": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4096,
                    "description": "Number of dimensions of the returned embedding, from 1 through the native dimension of 4096. Shortened vectors are L2-normalized again. Omit to receive the native 4096-dimensional embedding.\n",
                    "title": "Dimensions"
                  },
                  "embedding_type": {
                    "type": "string",
                    "description": "Output representation of each embedding value. Quantized representations pack several dimensions into each output element.\n",
                    "enum": [
                      "float",
                      "int8",
                      "uint8",
                      "binary",
                      "ubinary"
                    ],
                    "default": "float",
                    "title": "Embedding Type"
                  },
                  "longest_edge": {
                    "type": "integer",
                    "minimum": 256,
                    "maximum": 1540,
                    "description": "Maximum image size before patch-grid alignment. Larger images are downsized while preserving the aspect ratio; smaller images are not enlarged. Omit to use the model default of 1120. Use the same value when indexing and querying.\n",
                    "title": "Longest Edge"
                  },
                  "user": {
                    "type": "string",
                    "maxLength": 512,
                    "description": "Optional identifier for the end user. If provided it must be non-blank and at most 512 characters. It does not select the model or authorize the request.\n",
                    "title": "User"
                  }
                },
                "required": [
                  "input",
                  "model"
                ]
              }
            }
          }
        },
        "x-nvai-meta": {
          "name": "Create Embedding",
          "description": "Generates an embedding vector from the provided text, image,\nor text and image using a specified model. The embedding can be\nreturned in either float array or base64-encoded format.\n",
          "path": "create",
          "examples": [
            {
              "name": "Example 1",
              "shouldShowImage": true,
              "requestJson": "{\n  \"input\": \"AI enables robots to perceive, plan, and act autonomously.\",\n  \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n  \"input_type\": \"passage\",\n  \"modality\": \"text_image\",\n  \"image\": \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-rerank-vl/example1.jpg\",\n  \"image_name\": \"example1.jpg\",\n  \"encoding_format\": \"float\",\n  \"truncate\": \"END\"\n}\n"
            },
            {
              "name": "Example 2",
              "shouldShowText": true,
              "requestJson": "{\n  \"input\": \"Genomic foundation models can be trained on DNA, RNA, and/or protein sequences to support prediction and generation tasks.\",\n  \"image\": \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-rerank-vl/example2.jpg\",\n  \"image_name\": \"example2.jpg\",\n  \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n  \"input_type\": \"passage\",\n  \"modality\": \"text_image\",\n  \"encoding_format\": \"float\",\n  \"truncate\": \"END\"\n}\n"
            },
            {
              "name": "Example 3",
              "shouldShowText": true,
              "requestJson": "{\n  \"input\": \"How is AI improving the intelligence and capabilities of robots?\",\n  \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n  \"input_type\": \"query\",\n  \"modality\": \"text\",\n  \"encoding_format\": \"float\",\n  \"truncate\": \"END\"\n}\n"
            }
          ],
          "templates": [
            {
              "title": "Synchronous requests",
              "requestEjs": {
                "curl": "<% if (request.input_type === 'query') { %>\ncurl -X POST https://integrate.api.nvidia.com/v1/embeddings \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $NVIDIA_API_KEY\" \\\n  -d '{\n    \"input\": [\"<%- request.input.replaceAll('\"', '\\\\\"').replaceAll(\"'\", \"'\\\"'\\\"'\") %>\"],\n    \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n    \"modality\": [\"text\"],\n    \"input_type\": \"<%- request.input_type %>\",\n    \"encoding_format\": \"<%- request.encoding_format %>\",\n    \"truncate\": \"<%- request.truncate %>\"\n  }'\n<% } else { %>\nimage_source=\"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-rerank-vl/example1.jpg\"\nif [[ $image_source == http* ]]; then\n  base64_image=$(curl -s \"${image_source}\" | base64 -w 0)\nelse\n  base64_image=$(base64 -w 0 < \"${image_source}\")\nfi\n\njson_payload='{\n  \"input\": [\"<% if (request.input) { %><%- request.input.replaceAll('\"', '\\\\\"').replaceAll(\"'\", \"'\\\"'\\\"'\") %> <% } %>data:image/png;base64,'\"${base64_image}\"'\"],\n  \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n  \"modality\": [<% if (request.input) { %>\"text_image\"<% } else { %>\"image\"<% } %>],\n  \"input_type\": \"<%- request.input_type %>\",\n  \"encoding_format\": \"<%- request.encoding_format %>\",\n  \"truncate\": \"<%- request.truncate %>\"\n}'\n\necho \"${json_payload}\" | \\\n  curl -X POST https://integrate.api.nvidia.com/v1/embeddings \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $NVIDIA_API_KEY\" \\\n  -d @-\n<% } %>\n",
                "python": "<% if (request.input_type === 'query') { %>\nfrom openai import OpenAI\n\nclient = OpenAI(\n  api_key=\"$NVIDIA_API_KEY\",\n  base_url=\"https://integrate.api.nvidia.com/v1\"\n)\n\nresponse = client.embeddings.create(\n    input=[<%- JSON.stringify(request.input) %>],\n    model=\"nvidia/nemotron-3.5-embed-8b\",\n    encoding_format=\"<%- request.encoding_format %>\",\n    extra_body={\"modality\": [\"text\"], \"input_type\": \"<%- request.input_type %>\", \"truncate\": \"<%- request.truncate %>\"}\n)\n\nprint(response.data[0].embedding)\n<% } else { %>\nimport base64\nimport requests\nfrom openai import OpenAI\n\nimage_source = \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-rerank-vl/example1.jpg\"\n\nif image_source.startswith(('http://', 'https://')):\n    response = requests.get(image_source)\n    image_b64 = base64.b64encode(response.content).decode()\nelse:\n    with open(image_source, \"rb\") as image_file:\n        image_b64 = base64.b64encode(image_file.read()).decode()\n\nclient = OpenAI(\n  api_key=\"$NVIDIA_API_KEY\",\n  base_url=\"https://integrate.api.nvidia.com/v1\"\n)\n\nresponse = client.embeddings.create(\n    input=[<% if (request.input) { %>f\"<%- request.input.replaceAll('\"', '\\\\\"') %> data:image/png;base64,{image_b64}\"<% } else { %>f\"data:image/png;base64,{image_b64}\"<% } %>],\n    model=\"nvidia/nemotron-3.5-embed-8b\",\n    encoding_format=\"<%- request.encoding_format %>\",\n    extra_body={\"modality\": [<% if (request.input) { %>\"text_image\"<% } else { %>\"image\"<% } %>], \"input_type\": \"<%- request.input_type %>\", \"truncate\": \"<%- request.truncate %>\"}\n)\n\nprint(response.data[0].embedding)\n<% } %>\n",
                "langchain": "<% if (request.input_type === 'query') { %>\nfrom langchain_nvidia_ai_endpoints import NVIDIAEmbeddings\n\nclient = NVIDIAEmbeddings(\n  model=\"nvidia/nemotron-3.5-embed-8b\",\n  api_key=\"$NVIDIA_API_KEY\",\n  truncate=\"<%- request.truncate %>\",\n  )\n\nembedding = client.embed_query(<%- JSON.stringify(request.input) %>)\nprint(embedding)\n<% } else { %>\nimport base64\nimport requests\nfrom langchain_nvidia_ai_endpoints import NVIDIAEmbeddings\n\nimage_source = \"https://assets.ngc.nvidia.com/products/api-catalog/nemotron-rerank-vl/example1.jpg\"\n\nif image_source.startswith(('http://', 'https://')):\n    response = requests.get(image_source)\n    image_b64 = base64.b64encode(response.content).decode()\nelse:\n    with open(image_source, \"rb\") as image_file:\n        image_b64 = base64.b64encode(image_file.read()).decode()\n\nclient = NVIDIAEmbeddings(\n  model=\"nvidia/nemotron-3.5-embed-8b\",\n  api_key=\"$NVIDIA_API_KEY\",\n  truncate=\"<%- request.truncate %>\",\n  )\n\nimage_input = <% if (request.input) { %>f\"<%- request.input.replaceAll('\"', '\\\\\"') %> data:image/png;base64,{image_b64}\"<% } else { %>f\"data:image/png;base64,{image_b64}\"<% } %>\n\nembedding = client.embed_documents([image_input])\nprint(embedding)\n<% } %>\n"
              },
              "response": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"embedding\",\n      \"embedding\": [\n        0.0\n      ],\n      \"index\": 0\n    }\n  ],\n  \"model\": \"nvidia/nemotron-3.5-embed-8b\",\n  \"usage\": {\n    \"prompt_tokens\": 0,\n    \"total_tokens\": 0\n  }\n}\n"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response containing embedding vectors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "example": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmbeddingObject"
                      }
                    },
                    "model": {
                      "type": "string",
                      "example": "nvidia/nemotron-3.5-embed-8b"
                    },
                    "usage": {
                      "type": "object",
                      "description": "Number of tokens",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer"
                        },
                        "total_tokens": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request – invalid parameters."
          },
          "401": {
            "description": "Unauthorized – invalid or missing API key."
          },
          "404": {
            "description": "Not found – unknown model."
          },
          "413": {
            "description": "Payload too large – the request or an image exceeds the size limit."
          },
          "422": {
            "description": "Unprocessable entity – validation error."
          },
          "500": {
            "description": "Internal server error."
          },
          "503": {
            "description": "Service unavailable."
          }
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ],
  "components": {
    "securitySchemes": {
      "Token": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "EmbeddingObject": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "example": "embedding"
          },
          "embedding": {
            "oneOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array",
                "description": "The embedding vector as a list of floats. The length of the vector depends on the model."
              },
              {
                "type": "string",
                "description": "The embedding vector as a Base64 string. The length of the string depends on the model."
              }
            ]
          },
          "index": {
            "type": "integer",
            "description": "The index of the embedding in the list of embeddings."
          }
        },
        "required": [
          "object",
          "embedding",
          "index"
        ]
      }
    }
  }
}
```