openapi: 3.1.0 info: title: NVIDIA NIM for VLMs summary: Accelerated VLM inference for NVIDIA GPUs. version: 1.1.2 paths: /v1/chat/completions: post: summary: OpenAI-compatible chat endpoint operationId: create_chat_completion_v1_chat_completions_post parameters: - name: content-type in: header required: false schema: anyOf: - type: string - type: 'null' title: Content-Type requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NIMLLMChatCompletionRequest' responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/NIMLLMChatCompletionResponse' - $ref: '#/components/schemas/NIMLLMChatCompletionStreamResponse' title: Response Create Chat Completion V1 Chat Completions Post '400': description: Received an invalid request possibly containing unsupported or out-of-range parameter values. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: The requested model does not exist. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '415': description: Unsupported Media Type content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: BaseModel: properties: {} type: object title: BaseModel ChatCompletionLogProb: properties: token: type: string title: Token logprob: type: number title: Logprob default: -9999.0 bytes: anyOf: - items: type: integer type: array - type: 'null' title: Bytes additionalProperties: false type: object required: - token title: ChatCompletionLogProb ChatCompletionLogProbs: properties: content: anyOf: - items: $ref: '#/components/schemas/ChatCompletionLogProbsContent' type: array - type: 'null' title: Content additionalProperties: false type: object title: ChatCompletionLogProbs ChatCompletionLogProbsContent: properties: token: type: string title: Token logprob: type: number title: Logprob default: -9999.0 bytes: anyOf: - items: type: integer type: array - type: 'null' title: Bytes top_logprobs: items: $ref: '#/components/schemas/ChatCompletionLogProb' type: array title: Top Logprobs additionalProperties: false type: object required: - token title: ChatCompletionLogProbsContent ChatCompletionNamedFunction: properties: name: type: string title: Name additionalProperties: false type: object required: - name title: ChatCompletionNamedFunction ChatCompletionNamedToolChoiceParam: properties: function: $ref: '#/components/schemas/ChatCompletionNamedFunction' type: type: string const: function title: Type default: function additionalProperties: false type: object required: - function title: ChatCompletionNamedToolChoiceParam ChatCompletionResponseChoice: properties: index: type: integer title: Index message: $ref: '#/components/schemas/ChatMessage' logprobs: anyOf: - $ref: '#/components/schemas/ChatCompletionLogProbs' - type: 'null' finish_reason: anyOf: - type: string enum: - stop - length - tool_calls - type: 'null' title: Finish Reason default: stop 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' logprobs: anyOf: - $ref: '#/components/schemas/ChatCompletionLogProbs' - type: 'null' finish_reason: anyOf: - type: string enum: - stop - length - tool_calls - 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 ChatCompletionToolsParam: properties: type: type: string const: function title: Type default: function function: $ref: '#/components/schemas/FunctionDefinition' additionalProperties: false type: object required: - function title: ChatCompletionToolsParam ChatMessage: properties: role: type: string title: Role content: anyOf: - type: string - type: 'null' title: Content tool_calls: anyOf: - items: $ref: '#/components/schemas/ToolCall' type: array - type: 'null' title: Tool Calls 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 tool_calls: anyOf: - items: $ref: '#/components/schemas/ToolCall' type: array - type: 'null' title: Tool Calls 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 FunctionCall: properties: name: anyOf: - type: string - type: 'null' title: Name default: '' arguments: anyOf: - type: string - type: 'null' title: Arguments default: '' additionalProperties: false type: object title: FunctionCall FunctionDefinition: properties: name: type: string title: Name description: anyOf: - type: string - type: 'null' title: Description parameters: anyOf: - type: object - type: 'null' title: Parameters additionalProperties: false type: object required: - name title: FunctionDefinition HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ImageURL: properties: url: type: string title: Url type: object required: - url title: ImageURL Logprob: properties: logprob: type: number title: Logprob rank: anyOf: - type: integer - type: 'null' title: Rank decoded_token: anyOf: - type: string - type: 'null' title: Decoded Token type: object required: - logprob title: Logprob NIMLLMChatCompletionMessage: properties: role: $ref: '#/components/schemas/Role' description: The role of the message's author. content: anyOf: - type: string minLength: 1 - items: anyOf: - $ref: '#/components/schemas/NIMVLMChatCompletionContentPartImage' - $ref: '#/components/schemas/NIMVLMChatCompletionContentPartText' - $ref: '#/components/schemas/NIMVLMChatCompletionContentPartVideo' - $ref: '#/components/schemas/NIMVLMChatCompletionContentPartVideoStreaming' type: array title: Content description: "The contents of the message.\n
To pass images (only\ \ with role=`user`):\n
- When content is a string, image\ \ can be passed together with the text with `img` HTML tags that wraps\n\ \ an image URL (``),\n base64 encoded\ \ image data (``),\n or an NVCF asset ID (``)\n when the container is hosted in NVCF and the payload exceeds\ \ 200KB.\n or http link (`https:{image_link}`)\n
\ \ - When content is a list of objects, images can be passed as objects\ \ with type=`image_url`.\n
- In both cases, images can\ \ be PNG, JPG or JPEG.\n
To pass videos (only with role=`user`):\n\ \
- When content is a string, video can be passed together\ \ with the text with `video` HTML tags that wraps\n a video URL\ \ (`