---
updatedAt: 2026-08-06T09:59:50.000Z
---

# Request response from the model

Invokes inference using the model chat parameters.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "NVIDIA NIM API for google/diffusiongemma-26b-a4b-it",
    "description": "The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim/reference/google-diffusiongemma-26b-a4b-it for more details.",
    "version": "1.0.0",
    "termsOfService": "https://nvidia.com/legal/terms-of-use",
    "contact": {
      "name": "NVIDIA Support",
      "url": "https://help.nvidia.com/"
    },
    "license": {
      "name": "Gemma Terms of Use",
      "url": "https://ai.google.dev/gemma/terms"
    }
  },
  "servers": [
    {
      "url": "https://integrate.api.nvidia.com/v1"
    }
  ],
  "tags": [
    {
      "name": "Multimodal API",
      "description": "This API performs inference using visual language understanding models"
    }
  ],
  "paths": {
    "/chat/completions": {
      "post": {
        "tags": [
          "Multimodal API"
        ],
        "summary": "Request response from the model",
        "description": "Invokes inference using the model chat parameters.",
        "operationId": "invokeFunction",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NIMLLMChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invocation is fulfilled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionStreamResponse"
                }
              }
            }
          },
          "202": {
            "description": "Result is pending. Client should poll using the requestId.\n",
            "content": {
              "application/json": {
                "example": {},
                "schema": {}
              }
            },
            "headers": {
              "NVCF-REQID": {
                "description": "requestId required for pooling",
                "schema": {
                  "type": "string",
                  "format": "uuid",
                  "maxLength": 36
                }
              },
              "NVCF-STATUS": {
                "description": "Invocation status",
                "schema": {
                  "type": "string",
                  "format": "^[a-zA-Z-]{1,64}$",
                  "maxLength": 64
                }
              }
            }
          },
          "422": {
            "description": "Validation failed, provided entity could not be processed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "type": "urn:nvcf-worker-service:problem-details:unprocessable-entity",
                  "title": "Unprocessable Entity",
                  "status": 422,
                  "detail": "string",
                  "instance": "/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48",
                  "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                }
              }
            }
          },
          "500": {
            "description": "The invocation ended with an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "type": "urn:nvcf-worker-service:problem-details:internal-server-error",
                  "title": "Internal Server Error",
                  "status": 500,
                  "detail": "string",
                  "instance": "/v2/nvcf/pexec/functions/e598bfc1-b058-41af-869d-556d3c7e1b48",
                  "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                }
              }
            }
          }
        },
        "x-nvai-meta": {
          "name": "Create chat completion",
          "returns": "Returns a [chat completion](/docs/api-reference/chat/object) object, or a streamed sequence of [chat completion chunk](/docs/api-reference/chat/streaming) objects if the request is streamed.\n",
          "path": "create",
          "examples": [
            {
              "name": "dogs.jpeg",
              "input": {
                "text": "What is in this image?",
                "images": [
                  "https://assets.ngc.nvidia.com/products/api-catalog/phi-3-5-vision/example1b.jpg"
                ]
              },
              "output": {
                "text": "The image showcases a serene landscape featuring a wooden boardwalk that cuts through a vast, grassy area. The boardwalk is the central focus, inviting viewers to imagine strolling through this peaceful environment. The grass surrounding the boardwalk is very tall, giving a sense of immersion in nature. In the distance, a variety of trees can be seen, their varied foliage adding complexity to the scene."
              },
              "requestJson": "{ \"model\": \"google/diffusiongemma-26b-a4b-it\", \"messages\": [ { \"role\": \"user\", \"content\": [ { \"type\": \"text\", \"text\": \"<%- input.text %>\" }, { \"type\": \"image_url\", \"image_url\": { \"url\": \"<%- input.images[0] %>\" } } ] } ], \"max_tokens\": 1024, \"temperature\": 1.0, \"top_p\": 0.95, \"stream\": false }"
            },
            {
              "name": "video.mp4",
              "input": {
                "text": "Describe what you see in this video.",
                "videos": [
                  "https://assets.ngc.nvidia.com/products/api-catalog/nvidia-nemotron-nano-12b-v2-vl/nvidia-studio-itns-wk53-scene-in-omniverse-1280w.mp4"
                ]
              },
              "output": {
                "text": "The video displays a 3D model of a small, rustic cabin with a thatched roof, situated in a snowy landscape. The cabin is constructed with wooden planks and has a stone chimney. Surrounding the cabin are various objects such as logs, a wooden table, and a barrel."
              },
              "requestJson": "{ \"model\": \"google/diffusiongemma-26b-a4b-it\", \"messages\": [ { \"role\": \"user\", \"content\": [ { \"type\": \"text\", \"text\": \"<%- input.text %>\" }, { \"type\": \"video_url\", \"video_url\": { \"url\": \"<%- input.videos[0] %>\" } } ] } ], \"max_tokens\": 1024, \"temperature\": 1.0, \"top_p\": 0.95, \"stream\": false }"
            }
          ],
          "templates": [
            {
              "title": "Default",
              "response": "{\n  \"choices\": [{\n    \"index\": 0,\n    \"model\": \"google/diffusiongemma-26b-a4b-it\",\n    \"message\": {\n      \"role\": \"assistant\",\n      \"content\": \"...\",\n    },\n    \"finish_reason\": \"stop\"\n  }],\n  \"usage\": {\n    \"prompt_tokens\": 9,\n    \"completion_tokens\": 12,\n    \"total_tokens\": 21\n  }\n}\n",
              "requestEjs": {
                "python": "<%\n  // Catalog ejs locals replace JSON with {stringify} only (spread skips non-enumerable parse).\n  const deepClone = (value) => {\n    if (Array.isArray(value)) return value.map(deepClone);\n    if (value && typeof value === \"object\") {\n      const out = {};\n      for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\n      return out;\n    }\n    return value;\n  };\n  const mediaConfig = {\"image\": {\"mimeTypes\": {\".png\": \"image/png\", \".jpg\": \"image/jpeg\", \".jpeg\": \"image/jpeg\", \".webp\": \"image/webp\"}}, \"video\": {\"mimeTypes\": {\".mp4\": \"video/mp4\"}}, \"audio\": {\"mimeTypes\": {}, \"defaultFormat\": \"wav\"}};\n  const stripNulls = (value) => {\n    if (Array.isArray(value)) return value.map(stripNulls);\n    if (value && typeof value === \"object\") {\n      const out = {};\n      for (const [key, item] of Object.entries(value)) {\n        if (item === null || item === undefined) continue;\n        out[key] = stripNulls(item);\n      }\n      return out;\n    }\n    return value;\n  };\n  const payloadForSnippet = stripNulls(deepClone(request || {}));\n  const hasStream = payloadForSnippet.stream !== undefined && payloadForSnippet.stream !== null;\n  const pyStream = payloadForSnippet.stream ? \"True\" : \"False\";\n  if (hasStream) payloadForSnippet.stream = \"__STREAM__\";\n\n  const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\n  const isInlineDataUrl = (url, kind) => (\n    typeof url === \"string\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \"i\").test(url)\n  );\n\n  const mediaUrl = (part, key) => {\n    const slot = part?.[key];\n    return typeof slot === \"string\" ? slot : slot?.url;\n  };\n  const setMediaUrl = (part, key, url) => {\n    if (typeof part[key] === \"string\") part[key] = url;\n    else {\n      if (!part[key] || typeof part[key] !== \"object\") part[key] = {};\n      part[key].url = url;\n    }\n  };\n\n  let imageCount = 0;\n  let videoCount = 0;\n  let audioCount = 0;\n\n  (payloadForSnippet.messages || []).forEach((message) => {\n    if (!Array.isArray(message?.content)) return;\n    message.content.forEach((part) => {\n      const imageUrl = mediaUrl(part, \"image_url\");\n      const videoUrl = mediaUrl(part, \"video_url\");\n      const audioUrl = mediaUrl(part, \"audio_url\");\n      // File helpers only for inline base64; http(s) URLs stay as-is in the payload.\n      if (hasMediaKind(\"image\") && part?.type === \"image_url\" && isInlineDataUrl(imageUrl, \"image\")) {\n        setMediaUrl(part, \"image_url\", `__IMAGE_DATA_URL_${imageCount}__`);\n        imageCount += 1;\n      } else if (hasMediaKind(\"video\") && part?.type === \"video_url\" && isInlineDataUrl(videoUrl, \"video\")) {\n        setMediaUrl(part, \"video_url\", `__VIDEO_DATA_URL_${videoCount}__`);\n        videoCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"audio_url\" && isInlineDataUrl(audioUrl, \"audio\")) {\n        setMediaUrl(part, \"audio_url\", `__AUDIO_DATA_URL_${audioCount}__`);\n        audioCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"input_audio\" && part.input_audio?.data) {\n        part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\n        part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\n        audioCount += 1;\n      }\n    });\n  });\n\n  const pyRepr = (value, level = 0) => {\n    if (value === null) return \"None\";\n    if (typeof value === \"boolean\") return value ? \"True\" : \"False\";\n    if (typeof value === \"number\") return String(value);\n    if (typeof value === \"string\") return JSON.stringify(value);\n    const pad = \" \".repeat(level);\n    const innerPad = \" \".repeat(level + 2);\n    if (Array.isArray(value)) {\n      if (value.length === 0) return \"[]\";\n      return \"[\\n\" + value.map((item) => `${innerPad}${pyRepr(item, level + 2)}`).join(\",\\n\") + \"\\n\" + pad + \"]\";\n    }\n    if (typeof value === \"object\") {\n      const entries = Object.entries(value);\n      if (entries.length === 0) return \"{}\";\n      return \"{\\n\" + entries.map(([key, item]) => `${innerPad}${JSON.stringify(key)}: ${pyRepr(item, level + 2)}`).join(\",\\n\") + \"\\n\" + pad + \"}\";\n    }\n    return \"None\";\n  };\n\n  const replaceAll = (s, a, b) => s.split(a).join(b);\n  let renderedPayload = pyRepr(payloadForSnippet);\n  if (hasStream) renderedPayload = replaceAll(renderedPayload, '\"__STREAM__\"', \"stream\");\n  for (let i = 0; i < imageCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__IMAGE_DATA_URL_${i}__\"`, `image_data_urls[${i}]`);\n  }\n  for (let i = 0; i < videoCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__VIDEO_DATA_URL_${i}__\"`, `video_data_urls[${i}]`);\n  }\n  for (let i = 0; i < audioCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_DATA_URL_${i}__\"`, `audio_data_urls[${i}]`);\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_B64_${i}__\"`, `audio_b64s[${i}]`);\n  }\n\n  // Either file helpers XOR inline base64 - never emit unused helpers.\n  const usesFileHelpers =\n    imageCount + videoCount + audioCount > 0 &&\n    [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`image_data_urls[${i}]`)) &&\n    [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`video_data_urls[${i}]`)) &&\n    [...Array(audioCount).keys()].every(\n      (i) => renderedPayload.includes(`audio_data_urls[${i}]`) || renderedPayload.includes(`audio_b64s[${i}]`)\n    );\n  if (!usesFileHelpers) {\n    imageCount = 0;\n    videoCount = 0;\n    audioCount = 0;\n    const restored = stripNulls(deepClone(request || {}));\n    const restoredStream = restored.stream !== undefined && restored.stream !== null;\n    if (restoredStream) restored.stream = \"__STREAM__\";\n    renderedPayload = pyRepr(restored);\n    if (restoredStream) renderedPayload = replaceAll(renderedPayload, '\"__STREAM__\"', \"stream\");\n  }\n  const hasMedia = usesFileHelpers;\n  const mimePy = (mimes) =>\n    \"{\" + Object.entries(mimes).map(([k, v]) => `${JSON.stringify(k)}: ${JSON.stringify(v)}`).join(\", \") + \"}\";\n%>\n<% if (hasMedia) { %>import base64\nfrom pathlib import Path\n<% } %>import requests\n\ninvoke_url = \"https://integrate.api.nvidia.com/v1/chat/completions\"\nstream = <%- pyStream %>\n<% if (hasMedia) { %>\ndef media_data_url(kind, index, mime_types):\n    for suffix, mime in mime_types.items():\n        path = Path(f\"{kind}_{index}{suffix}\")\n        if path.exists():\n            return f\"data:{mime};base64,{base64.b64encode(path.read_bytes()).decode()}\"\n    raise FileNotFoundError(f\"Expected {kind}_{index} with suffix in {list(mime_types)}\")\n<% if (imageCount > 0) { %>\nimage_data_urls = [media_data_url(\"image\", i, <%- mimePy(mediaConfig.image.mimeTypes) %>) for i in <%- imageCount === 1 ? \"[1]\" : (\"range(1, \" + (imageCount + 1) + \")\") %>]\n<% } %><% if (videoCount > 0) { %>\nvideo_data_urls = [media_data_url(\"video\", i, <%- mimePy(mediaConfig.video.mimeTypes) %>) for i in <%- videoCount === 1 ? \"[1]\" : (\"range(1, \" + (videoCount + 1) + \")\") %>]\n<% } %><% if (audioCount > 0) { %>\naudio_data_urls = [media_data_url(\"audio\", i, <%- mimePy(mediaConfig.audio.mimeTypes) %>) for i in <%- audioCount === 1 ? \"[1]\" : (\"range(1, \" + (audioCount + 1) + \")\") %>]\naudio_b64s = [url.split(\",\", 1)[1] for url in audio_data_urls]\n<% } %><% } %>\nheaders = {\n    \"Authorization\": \"Bearer $NVIDIA_API_KEY\",\n    \"Accept\": \"text/event-stream\" if stream else \"application/json\",\n}\n\npayload = <%- renderedPayload %>\n\nresponse = requests.post(invoke_url, headers=headers, json=payload, stream=stream)\nif stream:\n    for line in response.iter_lines():\n        if line:\n            print(line.decode(\"utf-8\"))\nelse:\n    print(response.json())\n",
                "langChain": "<%\n  const deepClone = (value) => {\n    if (Array.isArray(value)) return value.map(deepClone);\n    if (value && typeof value === \"object\") {\n      const out = {};\n      for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\n      return out;\n    }\n    return value;\n  };\n  const mediaConfig = {\"image\": {\"mimeTypes\": {\".png\": \"image/png\", \".jpg\": \"image/jpeg\", \".jpeg\": \"image/jpeg\", \".webp\": \"image/webp\"}}, \"video\": {\"mimeTypes\": {\".mp4\": \"video/mp4\"}}, \"audio\": {\"mimeTypes\": {}, \"defaultFormat\": \"wav\"}};\n  const payloadForSnippet = deepClone(request || {});\n  const messagesForSnippet = deepClone(payloadForSnippet.messages || []);\n  const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\n  const isInlineDataUrl = (url, kind) => (\n    typeof url === \"string\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \"i\").test(url)\n  );\n\n  const mediaUrl = (part, key) => {\n    const slot = part?.[key];\n    return typeof slot === \"string\" ? slot : slot?.url;\n  };\n  const setMediaUrl = (part, key, url) => {\n    if (typeof part[key] === \"string\") part[key] = url;\n    else {\n      if (!part[key] || typeof part[key] !== \"object\") part[key] = {};\n      part[key].url = url;\n    }\n  };\n\n  let imageCount = 0;\n  let hasUnsupportedMedia = false;\n  messagesForSnippet.forEach((message) => {\n    if (!Array.isArray(message?.content)) return;\n    message.content.forEach((part) => {\n      const imageUrl = mediaUrl(part, \"image_url\");\n      if (hasMediaKind(\"image\") && part?.type === \"image_url\" && isInlineDataUrl(imageUrl, \"image\")) {\n        setMediaUrl(part, \"image_url\", `__IMAGE_DATA_URL_${imageCount}__`);\n        imageCount += 1;\n      } else if (part?.type === \"video_url\" && isInlineDataUrl(mediaUrl(part, \"video_url\"), \"video\")) {\n        // LangChain cannot ship local file helpers for video; reject inline only.\n        hasUnsupportedMedia = true;\n        setMediaUrl(part, \"video_url\", \"__UNSUPPORTED_MEDIA_DATA__\");\n      } else if (part?.type === \"audio_url\" && isInlineDataUrl(mediaUrl(part, \"audio_url\"), \"audio\")) {\n        hasUnsupportedMedia = true;\n        setMediaUrl(part, \"audio_url\", \"__UNSUPPORTED_MEDIA_DATA__\");\n      } else if (part?.type === \"input_audio\" && part.input_audio?.data) {\n        hasUnsupportedMedia = true;\n        part.input_audio.data = \"__UNSUPPORTED_MEDIA_DATA__\";\n      }\n    });\n  });\n\n  const pyRepr = (value, level = 0) => {\n    if (value === null) return \"None\";\n    if (typeof value === \"boolean\") return value ? \"True\" : \"False\";\n    if (typeof value === \"number\") return String(value);\n    if (typeof value === \"string\") return JSON.stringify(value);\n    const pad = \" \".repeat(level);\n    const innerPad = \" \".repeat(level + 2);\n    if (Array.isArray(value)) {\n      if (value.length === 0) return \"[]\";\n      return \"[\\n\" + value.map((item) => `${innerPad}${pyRepr(item, level + 2)},`).join(\"\\n\") + \"\\n\" + pad + \"]\";\n    }\n    if (typeof value === \"object\") {\n      const entries = Object.entries(value);\n      if (entries.length === 0) return \"{}\";\n      return \"{\\n\" + entries.map(([key, item]) => `${innerPad}${JSON.stringify(key)}: ${pyRepr(item, level + 2)},`).join(\"\\n\") + \"\\n\" + pad + \"}\";\n    }\n    return \"None\";\n  };\n\n  const replaceAll = (s, a, b) => s.split(a).join(b);\n  let renderedMessages = pyRepr(messagesForSnippet);\n  for (let i = 0; i < imageCount; i++) {\n    renderedMessages = replaceAll(renderedMessages, `\"__IMAGE_DATA_URL_${i}__\"`, `image_data_urls[${i}]`);\n  }\n  // Either file helpers XOR inline base64 - never emit unused helpers.\n  const usesFileHelpers =\n    imageCount > 0 &&\n    [...Array(imageCount).keys()].every((i) => renderedMessages.includes(`image_data_urls[${i}]`));\n  if (!usesFileHelpers) {\n    imageCount = 0;\n    renderedMessages = pyRepr(deepClone((request || {}).messages || []));\n  }\n%>\nfrom langchain_nvidia_ai_endpoints import ChatNVIDIA\n<% if (imageCount > 0) { %>from pathlib import Path\nimport base64\n<% } %>\n\nclient = ChatNVIDIA(\n  model=\"<%- request.model %>\",\n  api_key=\"$NVIDIA_API_KEY\",\n  temperature=<%- request.temperature %>,\n  top_p=<%- request.top_p %>,\n  max_completion_tokens=<%- request.max_tokens %>,\n)\n<% if (imageCount > 0) { %>\ndef find_image_path(index):\n  image_mime_types = <%- pyRepr(mediaConfig.image.mimeTypes) %>\n  for suffix in image_mime_types:\n    path = Path(f\"image_{index}{suffix}\")\n    if path.exists():\n      return path\n  expected = \"/\".join(f\".{suffix.lstrip('.')}\" for suffix in image_mime_types)\n  raise FileNotFoundError(f\"Expected image_{index}{expected}\")\n\ndef read_image_data_url(path):\n  image_mime_types = <%- pyRepr(mediaConfig.image.mimeTypes) %>\n  with open(path, \"rb\") as f:\n    image_b64 = base64.b64encode(f.read()).decode()\n  return f\"data:{image_mime_types[path.suffix.lower()]};base64,{image_b64}\"\n\nimage_data_urls = [read_image_data_url(find_image_path(i)) for i in range(1, <%- imageCount + 1 %>)]\n<% } %><% if (hasUnsupportedMedia) { %>\nraise ValueError(\"LangChain snippet currently supports text and image input. Use Python, Node.js, or Shell for video or audio input.\")\n<% } %>\nlc_messages = <%- renderedMessages %>\n<% if (request.stream) { %>\nfor chunk in client.stream(lc_messages<%= request.chat_template_kwargs ? ', chat_template_kwargs=' + pyRepr(request.chat_template_kwargs) : '' %>):\n  if chunk.additional_kwargs and \"reasoning_content\" in chunk.additional_kwargs:\n    print(chunk.additional_kwargs[\"reasoning_content\"], end=\"\")\n  print(chunk.content, end=\"\")\n<% } else { %>\nresponse = client.invoke(lc_messages<%= request.chat_template_kwargs ? ', chat_template_kwargs=' + pyRepr(request.chat_template_kwargs) : '' %>)\nif response.additional_kwargs and \"reasoning_content\" in response.additional_kwargs:\n  print(response.additional_kwargs[\"reasoning_content\"])\nprint(response.content)\n<% } %>\n",
                "node.js": "<%\n  const deepClone = (value) => {\n    if (Array.isArray(value)) return value.map(deepClone);\n    if (value && typeof value === \"object\") {\n      const out = {};\n      for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\n      return out;\n    }\n    return value;\n  };\n  const mediaConfig = {\"image\": {\"mimeTypes\": {\".png\": \"image/png\", \".jpg\": \"image/jpeg\", \".jpeg\": \"image/jpeg\", \".webp\": \"image/webp\"}}, \"video\": {\"mimeTypes\": {\".mp4\": \"video/mp4\"}}, \"audio\": {\"mimeTypes\": {}, \"defaultFormat\": \"wav\"}};\n  const payloadForSnippet = deepClone(request || {});\n  const hasStream = payloadForSnippet.stream !== undefined && payloadForSnippet.stream !== null;\n  if (hasStream) payloadForSnippet.stream = \"__STREAM__\";\n\n  const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\n  const isInlineDataUrl = (url, kind) => (\n    typeof url === \"string\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \"i\").test(url)\n  );\n\n  let imageCount = 0;\n  let videoCount = 0;\n  let audioCount = 0;\n  (payloadForSnippet.messages || []).forEach((message) => {\n    if (!Array.isArray(message?.content)) return;\n    message.content.forEach((part) => {\n      if (hasMediaKind(\"image\") && part?.type === \"image_url\" && isInlineDataUrl(part.image_url?.url, \"image\")) {\n        part.image_url.url = `__IMAGE_DATA_URL_${imageCount}__`;\n        imageCount += 1;\n      } else if (hasMediaKind(\"video\") && part?.type === \"video_url\" && isInlineDataUrl(part.video_url?.url, \"video\")) {\n        part.video_url.url = `__VIDEO_DATA_URL_${videoCount}__`;\n        videoCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"audio_url\" && isInlineDataUrl(part.audio_url?.url, \"audio\")) {\n        part.audio_url.url = `__AUDIO_DATA_URL_${audioCount}__`;\n        audioCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"input_audio\" && part.input_audio?.data) {\n        part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\n        part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\n        audioCount += 1;\n      }\n    });\n  });\n\n  const replaceAll = (s, a, b) => s.split(a).join(b);\n  let renderedPayload = JSON.stringify(payloadForSnippet, null, 2);\n  if (hasStream) renderedPayload = replaceAll(renderedPayload, '\"__STREAM__\"', \"stream\");\n  for (let i = 0; i < imageCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__IMAGE_DATA_URL_${i}__\"`, `imageDataUrls[${i}]`);\n  }\n  for (let i = 0; i < videoCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__VIDEO_DATA_URL_${i}__\"`, `videoDataUrls[${i}]`);\n  }\n  for (let i = 0; i < audioCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_DATA_URL_${i}__\"`, `audioDataUrls[${i}]`);\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_B64_${i}__\"`, `audioB64s[${i}]`);\n  }\n  // Either file helpers XOR inline base64 - never emit unused helpers.\n  const usesFileHelpers =\n    imageCount + videoCount + audioCount > 0 &&\n    [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`imageDataUrls[${i}]`)) &&\n    [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`videoDataUrls[${i}]`)) &&\n    [...Array(audioCount).keys()].every(\n      (i) => renderedPayload.includes(`audioDataUrls[${i}]`) || renderedPayload.includes(`audioB64s[${i}]`)\n    );\n  if (!usesFileHelpers) {\n    imageCount = 0;\n    videoCount = 0;\n    audioCount = 0;\n    const restored = deepClone(request || {});\n    const restoredStream = restored.stream !== undefined && restored.stream !== null;\n    if (restoredStream) restored.stream = \"__STREAM__\";\n    renderedPayload = JSON.stringify(restored, null, 2);\n    if (restoredStream) renderedPayload = replaceAll(renderedPayload, '\"__STREAM__\"', \"stream\");\n  }\n  const hasMedia = usesFileHelpers;\n%>\nimport axios from 'axios';\n<% if (hasMedia) { %>import { existsSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\n<% } %>\n\nconst invokeUrl = \"https://integrate.api.nvidia.com/v1/chat/completions\";\nconst stream = <%- request.stream %>;\n\nconst headers = {\n  \"Authorization\": \"Bearer $NVIDIA_API_KEY\",\n  \"Accept\": stream ? \"text/event-stream\" : \"application/json\"\n};\n<% if (hasMedia) { %>\nfunction findMediaPath(kind, index, mimeTypes) {\n  for (const suffix of Object.keys(mimeTypes)) {\n    const path = `${kind}_${index}${suffix}`;\n    if (existsSync(path)) {\n      return path;\n    }\n  }\n  const expected = Object.keys(mimeTypes).join(\"/\");\n  throw new Error(`Expected ${kind}_${index}${expected}`);\n}\n\nasync function readMediaB64(path) {\n  return Buffer.from(await readFile(path)).toString('base64');\n}\n\nfunction mediaDataUrl(path, mediaB64, mimeTypes) {\n  return `data:${mimeTypes[extname(path).toLowerCase()]};base64,${mediaB64}`;\n}\n<% } %>\nasync function main() {\n<% if (imageCount > 0) { %>  const imageMimeTypes = <%- JSON.stringify(mediaConfig.image.mimeTypes, null, 2) %>;\n  const imagePaths = [<% for (let i = 1; i <= imageCount; i++) { %>findMediaPath(\"image\", <%- i %>, imageMimeTypes)<%- i < imageCount ? \", \" : \"\" %><% } %>];\n  const imageB64s = await Promise.all(imagePaths.map(readMediaB64));\n  const imageDataUrls = imagePaths.map((path, index) => mediaDataUrl(path, imageB64s[index], imageMimeTypes));\n<% } %><% if (videoCount > 0) { %>  const videoMimeTypes = <%- JSON.stringify(mediaConfig.video.mimeTypes, null, 2) %>;\n  const videoPaths = [<% for (let i = 1; i <= videoCount; i++) { %>findMediaPath(\"video\", <%- i %>, videoMimeTypes)<%- i < videoCount ? \", \" : \"\" %><% } %>];\n  const videoB64s = await Promise.all(videoPaths.map(readMediaB64));\n  const videoDataUrls = videoPaths.map((path, index) => mediaDataUrl(path, videoB64s[index], videoMimeTypes));\n<% } %><% if (audioCount > 0) { %>  const audioMimeTypes = <%- JSON.stringify(mediaConfig.audio.mimeTypes, null, 2) %>;\n  const audioPaths = [<% for (let i = 1; i <= audioCount; i++) { %>findMediaPath(\"audio\", <%- i %>, audioMimeTypes)<%- i < audioCount ? \", \" : \"\" %><% } %>];\n  const audioB64s = await Promise.all(audioPaths.map(readMediaB64));\n  const audioDataUrls = audioPaths.map((path, index) => mediaDataUrl(path, audioB64s[index], audioMimeTypes));\n<% } %>  const payload = <%- renderedPayload %>;\n\n  const response = await axios.post(invokeUrl, payload, {\n    headers: headers,\n    responseType: stream ? 'stream' : 'json'\n  });\n\n  if (stream) {\n    response.data.on('data', (chunk) => {\n      console.log(chunk.toString());\n    });\n  } else {\n    console.log(JSON.stringify(response.data));\n  }\n}\n\nmain().catch(error => {\n  if (error.response) {\n    console.error(`HTTP ${error.response.status}`);\n    if (error.response.data?.on) {\n      error.response.data.on('data', (chunk) => console.error(chunk.toString()));\n    } else {\n      console.error(error.response.data);\n    }\n  } else {\n    console.error(error);\n  }\n});\n",
                "curl": "<%\n  const deepClone = (value) => {\n    if (Array.isArray(value)) return value.map(deepClone);\n    if (value && typeof value === \"object\") {\n      const out = {};\n      for (const key of Object.keys(value)) out[key] = deepClone(value[key]);\n      return out;\n    }\n    return value;\n  };\n  const mediaConfig = {\"image\": {\"mimeTypes\": {\".png\": \"image/png\", \".jpg\": \"image/jpeg\", \".jpeg\": \"image/jpeg\", \".webp\": \"image/webp\"}}, \"video\": {\"mimeTypes\": {\".mp4\": \"video/mp4\"}}, \"audio\": {\"mimeTypes\": {}, \"defaultFormat\": \"wav\"}};\n  const payloadForSnippet = deepClone(request || {});\n  const hasMediaKind = (kind) => Object.keys(mediaConfig[kind].mimeTypes || {}).length > 0;\n  const isInlineDataUrl = (url, kind) => (\n    typeof url === \"string\" && new RegExp(`^data:${kind}/[^;]+;base64,`, \"i\").test(url)\n  );\n\n  let imageCount = 0;\n  let videoCount = 0;\n  let audioCount = 0;\n  (payloadForSnippet.messages || []).forEach((message) => {\n    if (!Array.isArray(message?.content)) return;\n    message.content.forEach((part) => {\n      if (hasMediaKind(\"image\") && part?.type === \"image_url\" && isInlineDataUrl(part.image_url?.url, \"image\")) {\n        part.image_url.url = `__IMAGE_DATA_URL_${imageCount}__`;\n        imageCount += 1;\n      } else if (hasMediaKind(\"video\") && part?.type === \"video_url\" && isInlineDataUrl(part.video_url?.url, \"video\")) {\n        part.video_url.url = `__VIDEO_DATA_URL_${videoCount}__`;\n        videoCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"audio_url\" && isInlineDataUrl(part.audio_url?.url, \"audio\")) {\n        part.audio_url.url = `__AUDIO_DATA_URL_${audioCount}__`;\n        audioCount += 1;\n      } else if (hasMediaKind(\"audio\") && part?.type === \"input_audio\" && part.input_audio?.data) {\n        part.input_audio.data = `__AUDIO_B64_${audioCount}__`;\n        part.input_audio.format = part.input_audio.format || mediaConfig.audio.defaultFormat;\n        audioCount += 1;\n      }\n    });\n  });\n\n  const replaceAll = (s, a, b) => s.split(a).join(b);\n  let renderedPayload = JSON.stringify(payloadForSnippet, null, 2);\n  for (let i = 0; i < imageCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__IMAGE_DATA_URL_${i}__\"`, `\"${\"${\"}image_${i + 1}_data_url}\"`);\n  }\n  for (let i = 0; i < videoCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__VIDEO_DATA_URL_${i}__\"`, `\"${\"${\"}video_${i + 1}_data_url}\"`);\n  }\n  for (let i = 0; i < audioCount; i++) {\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_DATA_URL_${i}__\"`, `\"${\"${\"}audio_${i + 1}_data_url}\"`);\n    renderedPayload = replaceAll(renderedPayload, `\"__AUDIO_B64_${i}__\"`, `\"${\"${\"}audio_${i + 1}_b64}\"`);\n  }\n  // Either file helpers XOR inline base64 - never emit unused helpers.\n  const usesFileHelpers =\n    imageCount + videoCount + audioCount > 0 &&\n    [...Array(imageCount).keys()].every((i) => renderedPayload.includes(`image_${i + 1}_data_url`)) &&\n    [...Array(videoCount).keys()].every((i) => renderedPayload.includes(`video_${i + 1}_data_url`)) &&\n    [...Array(audioCount).keys()].every(\n      (i) => renderedPayload.includes(`audio_${i + 1}_data_url`) || renderedPayload.includes(`audio_${i + 1}_b64`)\n    );\n  if (!usesFileHelpers) {\n    imageCount = 0;\n    videoCount = 0;\n    audioCount = 0;\n    renderedPayload = JSON.stringify(deepClone(request || {}), null, 2);\n  }\n  const hasMedia = usesFileHelpers;\n%>\nstream=<%- request.stream %>\nif [ \"$stream\" = true ]; then\n    accept_header='Accept: text/event-stream'\nelse\n    accept_header='Accept: application/json'\nfi\n<% if (hasMedia) { %>\nmime_type_for() {\n  case \"$1\" in\n<% for (const [suffix, mimeType] of Object.entries({...mediaConfig.image.mimeTypes, ...mediaConfig.video.mimeTypes, ...mediaConfig.audio.mimeTypes})) { %>    *<%- suffix %>) echo \"<%- mimeType %>\" ;;\n<% } %>    *) echo \"Unsupported media file: $1\" >&2; return 1 ;;\n  esac\n}\n\nfind_media_path() {\n  local kind=\"$1\"\n  local index=\"$2\"\n  shift 2\n  local ext path\n  for ext in \"$@\"; do\n    path=\"${kind}_${index}.${ext}\"\n    if [ -f \"$path\" ]; then\n      echo \"$path\"\n      return 0\n    fi\n  done\n  echo \"Expected ${kind}_${index}.$*\" >&2\n  return 1\n}\n\nmedia_b64() {\n  base64 < \"$1\" | tr -d '\\n'\n}\n\nmedia_data_url() {\n  local path=\"$1\"\n  local mime_type media_base64\n  mime_type=$(mime_type_for \"$path\") || return 1\n  media_base64=$(media_b64 \"$path\") || return 1\n  printf 'data:%s;base64,%s' \"$mime_type\" \"$media_base64\"\n}\n<% for (let i = 1; i <= imageCount; i++) { %>\nimage_<%- i %>_path=$(find_media_path image <%- i %><% for (const suffix of Object.keys(mediaConfig.image.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\nimage_<%- i %>_data_url=$(media_data_url \"$image_<%- i %>_path\")\n<% } %><% for (let i = 1; i <= videoCount; i++) { %>\nvideo_<%- i %>_path=$(find_media_path video <%- i %><% for (const suffix of Object.keys(mediaConfig.video.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\nvideo_<%- i %>_data_url=$(media_data_url \"$video_<%- i %>_path\")\n<% } %><% for (let i = 1; i <= audioCount; i++) { %>\naudio_<%- i %>_path=$(find_media_path audio <%- i %><% for (const suffix of Object.keys(mediaConfig.audio.mimeTypes)) { %> <%- suffix.slice(1) %><% } %>)\naudio_<%- i %>_b64=$(media_b64 \"$audio_<%- i %>_path\")\naudio_<%- i %>_data_url=$(media_data_url \"$audio_<%- i %>_path\")\n<% } %><% } %>\ncat > payload.json <<JSON\n<%- renderedPayload %>\nJSON\n\ncurl https://integrate.api.nvidia.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $NVIDIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"$accept_header\" \\\n  -d @payload.json"
              }
            }
          ]
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ],
  "components": {
    "securitySchemes": {
      "Token": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "ChatCompletionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "enum": [
              "chat.completion"
            ],
            "const": "chat.completion",
            "title": "Object",
            "default": "chat.completion"
          },
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/ChatCompletionResponseChoice"
            },
            "type": "array",
            "title": "Choices"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageInfo"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "model",
          "choices",
          "usage"
        ],
        "title": "ChatCompletionResponse"
      },
      "ChatCompletionResponseChoice": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "message": {
            "$ref": "#/components/schemas/ChatMessage"
          },
          "finish_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "stop",
                  "length"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish Reason"
          },
          "stop_reason": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Reason"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "index",
          "message"
        ],
        "title": "ChatCompletionResponseChoice"
      },
      "ChatCompletionResponseStreamChoice": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "delta": {
            "$ref": "#/components/schemas/DeltaMessage"
          },
          "finish_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "stop",
                  "length"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish Reason"
          },
          "stop_reason": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Reason"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "index",
          "delta"
        ],
        "title": "ChatCompletionResponseStreamChoice"
      },
      "ChatCompletionStreamResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "enum": [
              "chat.completion.chunk"
            ],
            "const": "chat.completion.chunk",
            "title": "Object",
            "default": "chat.completion.chunk"
          },
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/ChatCompletionResponseStreamChoice"
            },
            "type": "array",
            "title": "Choices"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageInfo"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "model",
          "choices"
        ],
        "title": "ChatCompletionStreamResponse"
      },
      "ChatMessage": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role"
        ],
        "title": "ChatMessage"
      },
      "DeltaMessage": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DeltaMessage"
      },
      "ErrorResponse": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "error"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "param": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Param"
          },
          "code": {
            "type": "integer",
            "title": "Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type",
          "code"
        ],
        "title": "ErrorResponse"
      },
      "ImageURL": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ImageURL"
      },
      "VideoURL": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "VideoURL"
      },
      "NIMVLMChatCompletionContentPartVideo": {
        "additionalProperties": false,
        "properties": {
          "video_url": {
            "description": "Video url",
            "allOf": [
              {
                "$ref": "#/components/schemas/VideoURL"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "The type of the content part.",
            "enum": [
              "video_url"
            ],
            "const": "video_url",
            "title": "Type"
          }
        },
        "required": [
          "type",
          "video_url"
        ],
        "type": "object",
        "title": "NIMVLMChatCompletionContentPartVideo"
      },
      "NIMLLMChatCompletionMessage": {
        "properties": {
          "role": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Role"
              }
            ],
            "description": "The role of the message's author."
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/NIMVLMChatCompletionContentPartImage"
                    },
                    {
                      "$ref": "#/components/schemas/NIMVLMChatCompletionContentPartVideo"
                    },
                    {
                      "$ref": "#/components/schemas/NIMVLMChatCompletionContentPartText"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Content",
            "description": "The contents of the message.\n<br>To pass media (only with role=`user`):\n<br>    - Use content parts. Text is passed with `type`=`text`.\n<br>    - Images are passed with `type`=`image_url`; set `image_url.url` to an image URL or a base64 data URI like `data:image/{format};base64,{base64encodedimage}`.\n<br>    - Videos are passed with `type`=`video_url`; set `video_url.url` to a video URL or a base64 data URI like `data:video/{format};base64,{base64encodedvideo}`.\n<br>For `system` and `assistant` roles, the object list format is not supported.\n"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "NIMLLMChatCompletionMessage"
      },
      "NIMLLMChatCompletionRequest": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/NIMLLMChatCompletionMessage"
            },
            "type": "array",
            "minItems": 1,
            "title": "Messages",
            "description": "A list of messages comprising the conversation so far.",
            "example": [
              {
                "role": "user",
                "content": [
                  {
                    "type": "text",
                    "text": "What is in this image?"
                  },
                  {
                    "type": "image_url",
                    "image_url": {
                      "url": "https://assets.ngc.nvidia.com/products/api-catalog/phi-3-5-vision/example1b.jpg"
                    }
                  }
                ]
              }
            ]
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "The model to use.",
            "default": "google/diffusiongemma-26b-a4b-it"
          },
          "chat_template_kwargs": {
            "type": "object",
            "properties": {
              "enable_thinking": {
                "type": "boolean",
                "default": true,
                "description": "Enable or disable the model's thinking/reasoning mode."
              }
            },
            "title": "Chat Template Kwargs",
            "description": "Additional keyword arguments to pass to the chat template. Use {\"enable_thinking\": true} to enable reasoning or {\"enable_thinking\": false} to disable it.",
            "default": {
              "enable_thinking": true
            }
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 32768,
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens",
            "description": "The maximum number of tokens that can be generated.",
            "default": 4096
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 9223372036854776000,
                "minimum": -9223372036854776000
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed",
            "description": "Changing the seed will produce a different response with similar characteristics. Fixing the seed will reproduce the same results if all other parameters are also kept constant."
          },
          "stream": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stream",
            "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]`",
            "default": false
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature",
            "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.",
            "default": 1
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P",
            "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.",
            "default": 0.95
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "messages",
          "model"
        ],
        "title": "NIMLLMChatCompletionRequest"
      },
      "NIMVLMChatCompletionContentPartImage": {
        "properties": {
          "image_url": {
            "$ref": "#/components/schemas/ImageURL"
          },
          "type": {
            "type": "string",
            "enum": [
              "image_url"
            ],
            "const": "image_url",
            "title": "Type"
          }
        },
        "type": "object",
        "required": [
          "image_url",
          "type"
        ],
        "title": "NIMVLMChatCompletionContentPartImage"
      },
      "NIMVLMChatCompletionContentPartText": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "const": "text",
            "title": "Type"
          }
        },
        "type": "object",
        "required": [
          "text",
          "type"
        ],
        "title": "NIMVLMChatCompletionContentPartText"
      },
      "Role": {
        "type": "string",
        "enum": [
          "user",
          "assistant"
        ],
        "title": "Role"
      },
      "UsageInfo": {
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "title": "Prompt Tokens",
            "default": 0
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "default": 0
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UsageInfo"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```