> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server.

# List VirtualModels

GET /apis/inference-gateway/v2/workspaces/{workspace}/virtual-models

List VirtualModels for the given workspace.

Use ``workspace=-`` to list across all workspaces accessible to the caller.

Reference: https://docs.nvidia.com/nemo-helix/v0.5.1/documentation/reference/api-reference/virtual-models/list-virtual-models

## Request

### Path parameters

- `workspace` (string, required)

### Query parameters

- `page` (integer, optional, default: 1) — Page number (1-indexed).
- `page_size` (integer, optional, default: 20) — Number of results per page.
- `sort` (string, optional, default: -created_at) — Sort field. Prefix with ``-`` for descending order.
- `exclude_autoprovisioned` (boolean, optional, default: false) — When true, controller-managed (autoprovisioned) passthrough VirtualModels are excluded from the results.
- `filter` (VirtualModelFilter, optional) — Filter virtual models by workspace, project, name, default_model_entity, guardrail_config, created_at, and updated_at.

## Response

### 200

Paginated list of virtual models

- `data` (list of VirtualModel, required)
- `pagination` (PaginationData, optional) — Pagination information.
- `sort` (string, optional) — The field on which the results are sorted.
- `filter` (map from string to any, optional) — Filtering information.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### VirtualModelFilter

Filter for VirtualModel list queries.

- `workspace` (string, optional) — Filter by workspace.
- `project` (string, optional) — Filter by project URN.
- `name` (VirtualModelFilterName, optional) — Filter by name.
- `default_model_entity` (VirtualModelFilterDefaultModelEntity, optional) — Filter by default model entity.
- `created_at` (DatetimeFilter, optional) — Filter by creation date.
- `updated_at` (DatetimeFilter, optional) — Filter by update date.
- `guardrail_config` (string, optional) — Filter by a guardrail config reference in "workspace/name" form. Matches VirtualModels whose request, response, or post-response middleware applies that stored guardrail config.

### VirtualModel

Logical inference route. Maps a user-facing model name to an optional default model entity and defines ordered middleware pipelines for the request, response, and post-response phases. When a caller sets ``model: "workspace/my-virtual-model"`` in an inference request, IGW resolves the ``VirtualModel`` instead of a ``ModelEntity`` directly. If ``default_model_entity`` is set, IGW writes it into ``request["model"]`` before the request middleware pipeline runs. Middleware may mutate ``request["model"]`` freely. After the pipeline completes, IGW reads ``request["model"]``, resolves it to a ``ModelProvider`` via the ``ModelCache``, and proxies. The ``ModelProviderReconciler`` auto-creates a passthrough ``VirtualModel`` for each discovered model (same workspace and name as the ``ModelEntity``, empty middleware lists, ``default_model_entity`` pointing to that entity). All existing inference requests continue to work without changes.

- `workspace` (string, required) — Workspace identifier
- `id` (string, required)
- `created_at` (datetime, required)
- `created_by` (string, required, nullable)
- `updated_at` (datetime, required)
- `updated_by` (string, required, nullable)
- `entity_id` (string, required) — Alias for id for backwards compatibility.
- `parent` (string, required) — Parent entity ID for nested entities.
- `db_version` (integer, required) — Database version of the entity for optimistic locking.
- `name` (string, optional, default: ) — Entity name within the workspace
- `project` (string, optional) — The name of the project associated with this entity.
- `default_model_entity` (string, optional)
- `autoprovisioned` (boolean, optional, default: false) — Marks this VirtualModel as controller-managed. The Models controller will delete it once no ModelProvider serves the matching entity. Setting this manually opts the VirtualModel into that cleanup behavior.
- `models` (list of VirtualModelInferenceConfig, optional)
- `request_middleware` (list of MiddlewareCall, optional, default: [])
- `response_middleware` (list of MiddlewareCall, optional, default: [])
- `post_response_middleware` (list of MiddlewareCall, optional, default: [])
- `override_proxy` (string, optional)
- `guardrail_config_ids` (list of string, optional) — System-managed. Guardrail configs applied by this VirtualModel's middleware, as "workspace/name" references. Derived from the middleware pipelines on every write and ignored if supplied on a create or update body. Filter on it with filter[guardrail_config].

### PaginationData

- `page` (integer, required) — The current page number.
- `page_size` (integer, required) — The page size used for the query.
- `current_page_size` (integer, required) — The size for the current page.
- `total_pages` (integer, required) — The total number of pages.
- `total_results` (integer, required) — The total number of results.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### VirtualModelFilterName

Filter by name.

### VirtualModelFilterDefaultModelEntity

Filter by default model entity.

### DatetimeFilter

- `$gte` (datetime, optional) — Filter for results greater than or equal to this datetime.
- `$lte` (datetime, optional) — Filter for results less than or equal to this datetime.

### VirtualModelInferenceConfig

Inference configuration for one model entity referenced by a VirtualModel.

- `model` (string, required)
- `backend_format` (enum, optional, nullable) — Optional backend format override for this VirtualModel entry.
  - Allowed values: `OPENAI_CHAT`, `ANTHROPIC_MESSAGES`

### MiddlewareCall

One entry in a VirtualModel middleware pipeline. Declares which plugin to invoke and how to resolve its configuration. Exactly one of ``config`` (inline dict) or ``config_id`` (entity reference) should be provided. ``config_type`` is always required regardless of which is used — it is the discriminator that tells IGW (and the plugin) which config schema applies. Attributes: name: The entry-point key of the plugin to invoke (e.g. ``"nemo-switchyard"``). Must match the plugin's ``nemo.inference_middleware`` entry-point key. config_type: Always required. Maps to the ``entity_type`` of the plugin's config ``NemoEntity`` subclass (e.g. ``"routellm_config"``). Used by IGW to call :meth:`~NemoInferenceMiddleware.validate_middleware_config` with the right discriminator, and by the plugin to dispatch to the correct schema when it supports multiple config types. config: Inline config dict. Mutually exclusive with ``config_id``. config_id: ``"workspace/name"`` reference to a stored config entity. Mutually exclusive with ``config``. IGW resolves this by calling :meth:`~NemoInferenceMiddleware.get_middleware_config` on the plugin.

- `name` (string, required)
- `config_type` (string, required)
- `config` (map from string to any, optional)
- `config_id` (string, optional)

### ValidationErrorLocItems

### StringFilter

- `$eq` (string, optional) — Filter for results equal to this value.
- `$like` (string, optional) — Filter for results matching this pattern.
- `$in` (list of string, optional) — Filter for results in this list of values.
- `$nin` (list of string, optional) — Filter for results not in this list of values.

## Examples

**Response**

```json
{
  "data": [
    {
      "workspace": "string",
      "id": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "created_by": "string",
      "updated_at": "2024-01-15T09:30:00Z",
      "updated_by": "string",
      "entity_id": "string",
      "parent": "string",
      "db_version": 1,
      "name": "",
      "project": "string",
      "default_model_entity": "string",
      "autoprovisioned": false,
      "models": [
        {
          "model": "string",
          "backend_format": "OPENAI_CHAT"
        }
      ],
      "request_middleware": [
        {
          "name": "string",
          "config_type": "string",
          "config": {},
          "config_id": "string"
        }
      ],
      "response_middleware": [
        {
          "name": "string",
          "config_type": "string",
          "config": {},
          "config_id": "string"
        }
      ],
      "post_response_middleware": [
        {
          "name": "string",
          "config_type": "string",
          "config": {},
          "config_id": "string"
        }
      ],
      "override_proxy": "string",
      "guardrail_config_ids": [
        "string"
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 1,
    "current_page_size": 1,
    "total_pages": 1,
    "total_results": 1
  },
  "sort": "string",
  "filter": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```