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

# List VirtualModels

GET https://host.com/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://nemo-platform.docs.buildwithfern.com/nemo/platform/nemo/platform/documentation/reference/api-reference/virtual-models/list-virtual-models

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/inference-gateway/v2/workspaces/{workspace}/virtual-models:
    get:
      operationId: list-virtual-models
      summary: List VirtualModels
      description: >-
        List VirtualModels for the given workspace.


        Use ``workspace=-`` to list across all workspaces accessible to the
        caller.
      tags:
        - subpackage_virtualModels
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: Page number (1-indexed).
          required: false
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          description: Number of results per page.
          required: false
          schema:
            type: integer
            default: 20
        - name: sort
          in: query
          description: Sort field.  Prefix with ``-`` for descending order.
          required: false
          schema:
            type: string
            default: '-created_at'
      responses:
        '200':
          description: Paginated list of virtual models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualModelsPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    BackendFormat:
      type: string
      enum:
        - OPENAI_CHAT
        - ANTHROPIC_MESSAGES
      description: >-
        Inference backend API wire formats understood by IGW and middleware
        plugins.
      title: BackendFormat
    VirtualModelInferenceConfig:
      type: object
      properties:
        model:
          type: string
        backend_format:
          oneOf:
            - $ref: '#/components/schemas/BackendFormat'
            - type: 'null'
          description: Optional backend format override for this VirtualModel entry.
      required:
        - model
      description: >-
        Inference configuration for one model entity referenced by a
        VirtualModel.
      title: VirtualModelInferenceConfig
    MiddlewareCall:
      type: object
      properties:
        name:
          type: string
        config_type:
          type: string
        config:
          type: object
          additionalProperties:
            description: Any type
        config_id:
          type: string
      required:
        - name
        - config_type
      description: >-
        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.
      title: MiddlewareCall
    VirtualModel:
      type: object
      properties:
        name:
          type: string
          default: ''
          description: Entity name within the workspace
        workspace:
          type: string
          description: Workspace identifier
        project:
          type: string
          description: The name of the project associated with this entity.
        default_model_entity:
          type: string
        autoprovisioned:
          type: boolean
          default: false
          description: >-
            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:
          type: array
          items:
            $ref: '#/components/schemas/VirtualModelInferenceConfig'
        request_middleware:
          type: array
          items:
            $ref: '#/components/schemas/MiddlewareCall'
          default: []
        response_middleware:
          type: array
          items:
            $ref: '#/components/schemas/MiddlewareCall'
          default: []
        post_response_middleware:
          type: array
          items:
            $ref: '#/components/schemas/MiddlewareCall'
          default: []
        override_proxy:
          type: string
        id:
          type: string
        created_at:
          type: string
          format: date-time
        created_by:
          type:
            - string
            - 'null'
        updated_at:
          type: string
          format: date-time
        updated_by:
          type:
            - string
            - 'null'
        entity_id:
          type: string
          description: Alias for id for backwards compatibility.
        parent:
          type: string
          description: Parent entity ID for nested entities.
      required:
        - workspace
        - id
        - created_at
        - created_by
        - updated_at
        - updated_by
        - entity_id
        - parent
      description: >-
        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.
      title: VirtualModel
    PaginationData:
      type: object
      properties:
        page:
          type: integer
          description: The current page number.
        page_size:
          type: integer
          description: The page size used for the query.
        current_page_size:
          type: integer
          description: The size for the current page.
        total_pages:
          type: integer
          description: The total number of pages.
        total_results:
          type: integer
          description: The total number of results.
      required:
        - page
        - page_size
        - current_page_size
        - total_pages
        - total_results
      title: PaginationData
    VirtualModelsPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VirtualModel'
        pagination:
          $ref: '#/components/schemas/PaginationData'
          description: Pagination information.
        sort:
          type: string
          description: The field on which the results are sorted.
        filter:
          type: object
          additionalProperties:
            description: Any type
          description: Filtering information.
      required:
        - data
      title: VirtualModelsPage
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          type: object
          additionalProperties:
            description: Any type
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "data": [
    {
      "workspace": "team-alpha",
      "id": "vm-123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2024-01-15T09:30:00Z",
      "created_by": "alice@example.com",
      "updated_at": "2024-04-10T14:45:00Z",
      "updated_by": "bob@example.com",
      "entity_id": "vm-123e4567-e89b-12d3-a456-426614174000",
      "parent": "workspace-team-alpha",
      "name": "customer-support-bot",
      "project": "support-automation",
      "default_model_entity": "team-alpha/gpt4-customer-support",
      "autoprovisioned": false,
      "models": [
        {
          "model": "team-alpha/gpt4-customer-support",
          "backend_format": "OPENAI_CHAT"
        }
      ],
      "request_middleware": [
        {
          "name": "nemo-authenticator",
          "config_type": "auth_config",
          "config": {
            "auth_method": "oauth2",
            "token_url": "https://auth.example.com/token"
          },
          "config_id": ""
        }
      ],
      "response_middleware": [
        {
          "name": "nemo-logger",
          "config_type": "logging_config",
          "config": {
            "log_level": "info",
            "destination": "cloud-logs"
          },
          "config_id": ""
        }
      ],
      "post_response_middleware": [
        {
          "name": "nemo-metrics",
          "config_type": "metrics_config",
          "config": {
            "metrics_endpoint": "https://metrics.example.com/collect",
            "enabled": true
          },
          "config_id": ""
        }
      ],
      "override_proxy": "https://proxy.team-alpha.example.com"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "current_page_size": 1,
    "total_pages": 1,
    "total_results": 1
  },
  "sort": "-created_at",
  "filter": {}
}
```

**SDK Code**

```python
import requests

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

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models';
const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{}")

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

	req.Header.Add("Content-Type", "application/json")

	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://host.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)
request["Content-Type"] = 'application/json'
request.body = "{}"

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://host.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://host.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://host.com/apis/inference-gateway/v2/workspaces/workspace/virtual-models");
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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()
```