---
title: "Create, update, or rename one virtual model"
method: PUT
path: "/admin/virtual-models"
tags: ["admin"]
---

# Create, update, or rename one virtual model

`PUT /admin/virtual-models`

## Request body

- AdminUpsertVirtualModelRequest
  - `description` string
  - `enabled` boolean
  - `failover` boolean — Failover retries a failed request on the remaining targets. Omitted means enabled; false serves the chosen target only.
  - `old_source` string
  - `session_affinity` boolean — SessionAffinity keeps a detected session on the target that served it before. Omitted means enabled; false restores stateless balancing.
  - `slowdown` union — Slowdown is an extra-time factor from 0.1 to 10; zero disables it.
    - 0
    - number
  - `source` string, required
  - `strategy` string
  - `target_model` string
  - `targets` AdminVirtualModelTargetRequest[]
    - `model` string
    - `provider` string
    - `weight` number
  - `user_paths` string[]

## Response `200`

OK

- VirtualmodelsView
  - `created_at` string
  - `description` string
  - `enabled` boolean
  - `failover` boolean
  - `kind` string
  - `managed` boolean
  - `model` string
  - `provider_name` string
  - `provider_type` string
  - `resolved_model` string
  - `scope_kind` string
  - `session_affinity` boolean
  - `slowdown` union — Slowdown is an extra-time factor from 0.1 to 10; zero disables it.
    - 0
    - number
  - `source` string
  - `strategy` string
  - `targets` VirtualmodelsTarget[]
    - `model` string
    - `provider` string
    - `weight` number
  - `updated_at` string
  - `user_paths` string[]
  - `valid` boolean

## Other responses

- `204` — No-op access policy removed
- `400` — Bad Request
- `401` — Unauthorized
- `502` — Bad Gateway
- `503` — Service Unavailable

## Changes

- **2026-08-29** `7b5727a74f59` — 2 info
  - added the new optional request property `failover`
  - added the optional property `failover` to the response with the `200` status
- **2026-08-11** `a9c84e4d4f3d` — 2 info
  - added the new optional request property `slowdown`
  - added the optional property `slowdown` to the response with the `200` status
- **2026-07-28** `19ae6eb873aa` — 2 info
  - added the new optional request property `session_affinity`
  - added the optional property `session_affinity` to the response with the `200` status
- **2026-07-22** `12f782cd300b` — 1 info
  - added the success response with the status `204`
- **2026-06-28** `47b6a9727683` — 4 info
  - added the new optional request property `old_source`
  - added the new optional request property `strategy`
  - added the new optional request property `targets`
  - added the optional property `managed` to the response with the `200` status

[Full history](https://skmtc.dev/enterpilot/apis/gomodel-api/changes/admin/virtual-models/put.md)

---

[API](https://skmtc.dev/enterpilot/apis/gomodel-api.md) · [All operations](https://skmtc.dev/enterpilot/apis/gomodel-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/enterpilot/gomodel-api/revisions/7b5727a74f59/schema)
