---
updatedAt: 2026-08-06T09:59:44.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 adept/fuyu-8b",
    "description": "The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim 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": "CC BY-NC",
      "url": "https://creativecommons.org/licenses/by-nc/4.0/legalcode.en"
    }
  },
  "servers": [
    {
      "url": "https://ai.api.nvidia.com/v1"
    }
  ],
  "tags": [
    {
      "name": "Multimodal API",
      "description": "This API performs inference using visual language understanding models"
    }
  ],
  "paths": {
    "/vlm/adept/fuyu-8b": {
      "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/ChatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invocation is fulfilled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionChunk"
                }
              }
            }
          },
          "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/Errors"
                },
                "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/Errors"
                },
                "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",
          "templates": [
            {
              "title": "Default",
              "requestEjs": {
                "python": "<% let pyStream = request.stream.toString()[0].toUpperCase() + request.stream.toString().slice(1) %>\nimport requests, base64\n\ninvoke_url = \"https://ai.api.nvidia.com/v1/vlm/adept/fuyu-8b\"\nstream = <%- pyStream %>\n\nwith open(\"<%- request.image_name.replaceAll('\"', '\\\\\"') %>\", \"rb\") as f:\n    image_b64 = base64.b64encode(f.read()).decode()\n\nassert len(image_b64) < 180_000, \\\n  \"The encoded image is too large for this example.\"\n\nheaders = {\n  \"Authorization\": \"Bearer $NVIDIA_API_KEY\",\n  \"Accept\": \"text/event-stream\" if stream else \"application/json\"\n}\n\npayload = {\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": '<%- request.prompt.replaceAll(\"'\", \"\\\\'\") %>'\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": f\"data:image/<%- request.image_name.split('.').pop() %>;base64,{image_b64}\"\n          }\n        }\n      ]\n    }\n  ],\n  \"max_tokens\": <%- request.max_tokens %>,\n  \"temperature\": <%- request.temperature.toFixed(2) %>,\n  \"top_p\": <%- request.top_p.toFixed(2) %>,\n  \"seed\": <%- request.seed %>,\n  \"stream\": stream\n}\n\nresponse = requests.post(invoke_url, headers=headers, json=payload)\n\nif stream:\n    for line in response.iter_lines():\n        if line:\n            print(line.decode(\"utf-8\"))\nelse:\n    print(response.json())\n",
                "node.js": "import axios from 'axios';\nimport { readFile } from 'node:fs/promises';\n\nconst invokeUrl = \"https://ai.api.nvidia.com/v1/vlm/adept/fuyu-8b\";\nconst stream = <%- request.stream %>;\n\nconst headers = {\n  \"Authorization\": \"Bearer $NVIDIA_API_KEY\",\n  \"Accept\": stream ? \"text/event-stream\" : \"application/json\"\n};\n\nreadFile(\"<%- request.image_name.replaceAll('\"', '\\\\\"') %>\")\n  .then(data => {\n    const imageB64 = Buffer.from(data).toString('base64');\n    if (imageB64.length > 180_000) {\n      throw new Error(\"The encoded image is too large for this example.\");\n    }\n\n    const payload = {\n      \"messages\": [\n        {\n          \"role\": \"user\",\n          \"content\": [\n            {\n              \"type\": \"text\",\n              \"text\": `<%- request.prompt %>`\n            },\n            {\n              \"type\": \"image_url\",\n              \"image_url\": {\n                \"url\": `data:image/<%- request.image_name.split('.').pop() %>;base64,${imageB64}`\n              }\n            }\n          ]\n        }\n      ],\n      \"max_tokens\": <%- request.max_tokens %>,\n      \"temperature\": <%- request.temperature.toFixed(2) %>,\n      \"top_p\": <%- request.top_p.toFixed(2) %>,\n      \"seed\": <%- request.seed %>,\n      \"stream\": stream\n    };\n\n    return axios.post(invokeUrl, payload, { headers: headers, responseType: stream ? 'stream' : 'json' });\n  })\n  .then(response => {\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  .catch(error => {\n    console.error(error);\n  });\n",
                "curl": "image_b64=$( base64 <%- request.image_name %> )\nstream=<%- request.stream %>\n\nif [ \"$stream\" = true ]; then\n    accept_header='Accept: text/event-stream'\nelse\n    accept_header='Accept: application/json'\nfi\n\necho '{\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"<%- request.prompt.replaceAll('\"', '\\\\\"').replaceAll(\"'\", \"'\\\"'\\\"'\") %> \"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"data:image/<%- request.image_name.split('.').pop() %>;base64,'\"$image_b64\"'\"\n          }\n        }\n      ]\n    }\n  ],\n  \"max_tokens\": <%- request.max_tokens %>,\n  \"temperature\": <%- request.temperature.toFixed(2) %>,\n  \"top_p\": <%- request.top_p.toFixed(2) %>,\n  \"seed\": <%- request.seed %>,\n  \"stream\": <%- request.stream %>\n}' > payload.json\n\ncurl https://ai.api.nvidia.com/v1/vlm/adept/fuyu-8b \\\n  -H \"Authorization: Bearer $NVIDIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"$accept_header\" \\\n  -d @payload.json\n"
              },
              "response": "{\n  \"choices\": [{\n    \"index\": 0,\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"
            }
          ]
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ],
  "components": {
    "securitySchemes": {
      "Token": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Errors": {
        "properties": {
          "type": {
            "type": "string",
            "format": "^.{1, 128}$",
            "maxLength": 128,
            "description": "Error type"
          },
          "title": {
            "type": "string",
            "format": "^.{1, 128}$",
            "maxLength": 128,
            "description": "Error title"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 999,
            "description": "Error status code"
          },
          "detail": {
            "type": "string",
            "format": "^.{1, 1024}$",
            "maxLength": 1024,
            "description": "Detailed information about the error"
          },
          "instance": {
            "type": "string",
            "format": "^.{1, 256}$",
            "maxLength": 256,
            "description": "Function instance used to invoke the request"
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "maxLength": 36,
            "description": "UUID of the request"
          }
        },
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "requestId"
        ],
        "title": "InvokeError"
      },
      "ChatCompletion": {
        "properties": {
          "id": {
            "description": "A unique identifier for the completion.",
            "format": "uuid",
            "maxLength": 36,
            "title": "Id",
            "type": "string"
          },
          "choices": {
            "description": "The list of completion choices the model generated for the input prompt.",
            "items": {
              "$ref": "#/components/schemas/Choice"
            },
            "maxItems": 1,
            "title": "Choices",
            "type": "array"
          },
          "usage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Usage"
              }
            ],
            "description": "Usage statistics for the completion request."
          }
        },
        "required": [
          "id",
          "choices",
          "usage"
        ],
        "title": "ChatCompletion",
        "type": "object"
      },
      "ChatCompletionChunk": {
        "properties": {
          "id": {
            "description": "A unique identifier for the completion.",
            "format": "uuid",
            "maxLength": 36,
            "title": "Id",
            "type": "string"
          },
          "choices": {
            "description": "The list of completion choices the model generated for the input prompt.",
            "items": {
              "$ref": "#/components/schemas/ChoiceChunk"
            },
            "maxItems": 1,
            "title": "Choices",
            "type": "array"
          }
        },
        "required": [
          "id",
          "choices"
        ],
        "title": "ChatCompletionChunk",
        "type": "object"
      },
      "ChatRequest": {
        "additionalProperties": false,
        "properties": {
          "messages": {
            "description": "A list of messages comprising the conversation. For VQA task only single message with `user` role and single image is supported.",
            "examples": [
              [
                {
                  "content": [
                    {
                      "type": "text",
                      "text": "Hi! What is in this image?"
                    },
                    {
                      "type": "image_url",
                      "image_url": {
                        "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII=="
                      }
                    }
                  ],
                  "role": "user"
                }
              ],
              [
                {
                  "content": [
                    {
                      "type": "text",
                      "text": "Hi! What is in this image?"
                    },
                    {
                      "type": "image_url",
                      "image_url": {
                        "url": "data:image/png;base64,{base64encodedimage}"
                      }
                    }
                  ],
                  "role": "user"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "maxItems": 1,
            "minItems": 1,
            "title": "Messages",
            "type": "array"
          },
          "temperature": {
            "default": 0.2,
            "description": "The sampling temperature to use for text generation. The higher the temperature value is, the less deterministic the output text will be. It is not recommended to modify both temperature and top_p in the same call.",
            "exclusiveMinimum": 0,
            "maximum": 1,
            "title": "Temperature",
            "type": "number"
          },
          "top_p": {
            "default": 0.7,
            "description": "The top-p sampling mass used for text generation. The top-p value determines the probability mass that is sampled at sampling time. For example, if top_p = 0.2, only the most likely tokens (summing to 0.2 cumulative probability) will be sampled. It is not recommended to modify both temperature and top_p in the same call.",
            "exclusiveMinimum": 0,
            "maximum": 1,
            "title": "Top P",
            "type": "number"
          },
          "max_tokens": {
            "default": 1024,
            "description": "The maximum number of tokens to generate in any given call. Note that the model is not aware of this value, and generation will simply stop at the number of tokens specified.",
            "maximum": 1024,
            "minimum": 1,
            "title": "Max Tokens",
            "type": "integer"
          },
          "seed": {
            "anyOf": [
              {
                "maximum": 18446744073709552000,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.",
            "examples": [
              42
            ],
            "title": "Seed"
          },
          "stream": {
            "default": false,
            "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events (SSE) as they become available (JSON responses are prefixed by `data: `), with the stream terminated by a `data: [DONE]` message.",
            "title": "Stream",
            "type": "boolean"
          }
        },
        "required": [
          "messages"
        ],
        "title": "ChatRequest",
        "type": "object"
      },
      "Choice": {
        "properties": {
          "index": {
            "default": 0,
            "description": "The index of the choice in the list of choices (always 0).",
            "exclusiveMaximum": 1,
            "minimum": 0,
            "title": "Index",
            "type": "integer"
          },
          "message": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Message"
              }
            ],
            "description": "A chat completion message generated by the model.",
            "examples": [
              {
                "content": "The image features a gray and white checkered pattern on a white background.",
                "role": "assistant"
              }
            ]
          },
          "finish_reason": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "length"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, or `length` if the maximum number of tokens specified in the request was reached.",
            "examples": [
              "stop"
            ],
            "title": "Finish Reason"
          }
        },
        "required": [
          "message"
        ],
        "title": "Choice",
        "type": "object"
      },
      "ChoiceChunk": {
        "properties": {
          "index": {
            "default": 0,
            "description": "The index of the choice in the list of choices (always 0).",
            "exclusiveMaximum": 1,
            "minimum": 0,
            "title": "Index",
            "type": "integer"
          },
          "delta": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Message"
              }
            ],
            "description": "A chat completion delta generated by streamed model responses.",
            "examples": [
              {
                "content": "The",
                "role": "assistant"
              }
            ]
          },
          "finish_reason": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "length"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, or `length` if the maximum number of tokens specified in the request was reached. Will be `null` if the model has not finished generating.",
            "title": "Finish Reason"
          }
        },
        "required": [
          "delta"
        ],
        "title": "ChoiceChunk",
        "type": "object"
      },
      "Message": {
        "additionalProperties": false,
        "properties": {
          "role": {
            "description": "The role of the message author.",
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role",
            "type": "string"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/UserTextContent"
                    },
                    {
                      "$ref": "#/components/schemas/UserImageContent"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "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>For `system` and `assistant` roles, the object list format is not supported.\n",
            "title": "Content"
          }
        },
        "required": [
          "role"
        ],
        "title": "Message",
        "type": "object"
      },
      "Usage": {
        "properties": {
          "completion_tokens": {
            "description": "Number of tokens in the generated completion.",
            "examples": [
              19
            ],
            "maximum": 1024,
            "minimum": 0,
            "title": "Completion Tokens",
            "type": "integer"
          },
          "prompt_tokens": {
            "description": "Number of tokens in the prompt.",
            "examples": [
              46
            ],
            "maximum": 3072,
            "minimum": 0,
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "total_tokens": {
            "description": "Total number of tokens used in the request (prompt + completion).",
            "examples": [
              65
            ],
            "maximum": 4096,
            "minimum": 0,
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "completion_tokens",
          "prompt_tokens",
          "total_tokens"
        ],
        "title": "Usage",
        "type": "object"
      },
      "UserImageContent": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "image_url",
            "description": "The type of the content part.",
            "title": "Type"
          },
          "image_url": {
            "additionalProperties": false,
            "properties": {
              "url": {
                "description": "The image URL or base64 data URI.",
                "maxLength": 204800,
                "title": "Url",
                "type": "string"
              }
            },
            "required": [
              "url"
            ],
            "title": "Image Url",
            "type": "object"
          }
        },
        "required": [
          "type",
          "image_url"
        ],
        "title": "UserImageContent",
        "type": "object"
      },
      "UserTextContent": {
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "text",
            "description": "The type of the content part.",
            "title": "Type"
          },
          "text": {
            "description": "The text content.",
            "maxLength": 204800,
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "type",
          "text"
        ],
        "title": "UserTextContent",
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```