API Reference#

OpenAPI Schema#

The OpenAPI specification details the endpoints for NVIDIA NIM for VLMs:

  • /v1/models - List available models

  • /v1/health/ready - Health check

  • /v1/health/live - Service liveness check

  • /v1/chat/completions - OpenAI-compatible chat endpoint

API Examples#

Use the examples in this section to help you get started with using the API.

List Models#

cURL Request

Use the following command to list the available models.

curl -X 'GET' 'http://0.0.0.0:8000/v1/models'

Response

{
  "object": "list",
  "data": [
    {
      "id": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1",
      "object": "model",
      "created": 1745870402,
      "owned_by": "system",
      "root": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1",
      "parent": null,
      "max_model_len": 16384,
      "permission": [
        {
          "id": "modelperm-17c91efdfb6148718100ad4204950302",
          "object": "model_permission",
          "created": 1745870402,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": true,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ]
    }
  ]
}

Check Health#

Use the following command to check server health.

cURL Request

curl -X 'GET' 'http://0.0.0.0:8000/v1/health/ready'

Response

{
  "object": "health.response",
  "message": "Service is ready."
}

Check Service Liveness#

Use the following command to check service liveness.

cURL Request

curl -X 'GET' 'http://0.0.0.0:8000/v1/health/live'

Response

{
  "object": "readyhealth.response",
  "message": "Service is live."
}

OpenAI Chat Completions#

Use the following command to query the OpenAI chat completions endpoint.

cURL Request

curl -X 'POST' \
'http://0.0.0.0:8000/v1/chat/completions' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
           "model": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1",
           "messages": [
               {
                   "role":"user",
                   "content": [
                       {
                           "type": "image_url",
                           "image_url":
                               {
                                   "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
                               }
                       },
                       {
                           "type": "text",
                           "text": "What is in this image?"
                       }
                   ]
               }
           ],
           "max_tokens": 256,
           "temperature": 0
    }'

Response

{
  "id": "chat-b24074153a0e424086beb64bde769d27",
  "object": "chat.completion",
  "created": 1745870725,
  "model": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image captures a serene scene of a wooden boardwalk meandering through a lush, green field. The boardwalk serves as a pathway that invites viewers to imagine a peaceful walk amidst nature. The vibrant green grass on either side of the boardwalk is tall and appears to be thriving, suggesting that the area is well-watered and possibly part of a wetland or marsh. The sky above is a clear blue with a few scattered clouds, indicating fair weather. The perspective of the image is from ground level, looking down the boardwalk, which adds a sense of depth and invites the viewer to follow the path into the distance. The overall composition of the image, with its natural elements and tranquil setting, evokes a sense of calm and connection with nature."
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null
    }
  ],
  "usage": {
    "prompt_tokens": 3372,
    "total_tokens": 3524,
    "completion_tokens": 152
  },
  "prompt_logprobs": null
}

Reference#