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

# Get VirtualModel

GET https://host.com/apis/inference-gateway/v2/workspaces/{workspace}/virtual-models/{name}

Get a VirtualModel by workspace and name.

Reference: https://docs.nvidia.com/nemo-platform/nemo-platform/documentation/reference/api-reference/virtual-models/get-virtual-model

## 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/{name}:
    get:
      operationId: get-virtual-model
      summary: Get VirtualModel
      description: Get a VirtualModel by workspace and name.
      tags:
        - subpackage_virtualModels
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: name
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: VirtualModel details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualModel'
        '404':
          description: VirtualModel not found.
          content:
            application/json:
              schema:
                description: Any type
        '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
    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
{
  "workspace": "nemo-enterprise",
  "id": "a3f47b9e-8c2d-4f1a-9b7e-2d3f5c6a7e8b",
  "created_at": "2024-01-15T09:30:00Z",
  "created_by": "admin@nemo-enterprise.com",
  "updated_at": "2024-04-10T14:45:00Z",
  "updated_by": "devops@nemo-enterprise.com",
  "entity_id": "a3f47b9e-8c2d-4f1a-9b7e-2d3f5c6a7e8b",
  "parent": "nemo-enterprise/root-virtual-model",
  "name": "customer-support-bot",
  "project": "customer-engagement",
  "default_model_entity": "nemo-enterprise/gpt-4-chat",
  "autoprovisioned": false,
  "models": [
    {
      "model": "nemo-enterprise/gpt-4-chat",
      "backend_format": "OPENAI_CHAT"
    }
  ],
  "request_middleware": [
    {
      "name": "nemo-authenticator",
      "config_type": "auth_config",
      "config": {
        "token_header": "Authorization",
        "token_prefix": "Bearer"
      },
      "config_id": ""
    }
  ],
  "response_middleware": [
    {
      "name": "nemo-logger",
      "config_type": "logging_config",
      "config": {
        "log_level": "INFO",
        "log_format": "json"
      },
      "config_id": ""
    }
  ],
  "post_response_middleware": [
    {
      "name": "nemo-metrics",
      "config_type": "metrics_config",
      "config": {
        "enabled": true,
        "metrics_endpoint": "/metrics"
      },
      "config_id": ""
    }
  ],
  "override_proxy": "https://proxy.nemo-enterprise.com"
}
```

**SDK Code**

```python
import requests

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

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/name';
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/name"

	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/name")

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/name")
  .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/name', [
  '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/name");
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/name")! 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()
```