---
title: update-virtual-model-config
description: Learn about update-virtual-model-config on Vercel.
url: "https://vercel.com/docs/rest-api/ai-gateway/update-virtual-model-config"
last_updated: 2026-11-30
related:
  - /docs/rest-api
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
search_kb_with_vercel_cli: npx vercel@latest kb search "<query>"
---

# Update virtual model config

```http
PATCH /ai-gateway/virtual-model-configs
```

Update a virtual model config

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: No

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "virtualModelSlug"
  ],
  "properties": {
    "virtualModelSlug": {
      "type": "string",
      "description": "The slug of the virtual model to update."
    },
    "displayName": {
      "type": "string",
      "description": "The name shown in the UI."
    },
    "description": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "The lifecycle status: `draft`, `active`, or `archived`. Any value other than `active` stops it serving requests. Defaults to `active`."
    },
    "modelSlug": {
      "type": "string",
      "description": "The model that the virtual model resolves to: a catalog model such as `openai/gpt-4o-mini`, or one of your team's private models as `private/<slug>`. Required on create."
    },
    "models": {
      "type": "array",
      "description": "The ordered fallback models, optionally led by one conditional `{ model, when }` entry.",
      "items": {
        "oneOf": [
          {
            "type": "string",
            "description": "A model ID: a catalog model such as `openai/gpt-4o`, or one of your team's private models as `private/<slug>`. A fallback can also name a virtual model as `vmc/<slug>`."
          },
          {
            "type": "object",
            "description": "A conditional fallback. Only an alias can have one.",
            "required": [
              "model",
              "when"
            ]
          }
        ]
      }
    },
    "providerOrder": {
      "type": "array",
      "description": "The providers to try, in order.",
      "items": {
        "type": "string"
      }
    },
    "providerOnly": {
      "type": "array",
      "description": "Restrict routing to these providers.",
      "items": {
        "type": "string"
      }
    },
    "observabilityTags": {
      "type": "array",
      "description": "Observability tags attached to requests through this virtual model.",
      "items": {
        "type": "string"
      }
    },
    "deleted": {
      "type": "boolean",
      "description": "Set to `false` to restore a deleted virtual model.",
      "enum": [
        false
      ]
    },
    "providerOptions": {
      "type": "object",
      "description": "Provider-specific options, keyed by provider slug. The slug of one of your team's private providers is also valid. `null` removes the stored value.",
      "nullable": true,
      "additionalProperties": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "byokCredentialIds": {
      "type": "array",
      "description": "The BYOK credentials that this virtual model can use. `null` removes the stored value.",
      "nullable": true,
      "items": {
        "type": "string"
      }
    },
    "inferenceRegion": {
      "type": "object",
      "description": "The region that requests are pinned to. `null` removes the stored value.",
      "nullable": true,
      "properties": {
        "scope": {
          "type": "string",
          "description": "The pin scope: `zone` (a geo zone) or `global`.",
          "enum": [
            "zone",
            "global"
          ]
        },
        "geoRegion": {
          "type": "string",
          "description": "The geo zone, for example `us` or `eu`. Required when `scope` is `zone`."
        },
        "providers": {
          "type": "object",
          "description": "Region overrides for each provider, keyed by provider slug.",
          "additionalProperties": {
            "type": "object",
            "nullable": true
          }
        }
      }
    },
    "sort": {
      "type": "string",
      "description": "Rank eligible providers by an attribute. `@default` ignores the value from the inference request. `null` removes the stored value.",
      "enum": [
        "@default",
        "cost",
        "ttft",
        "tps",
        "price",
        "latency",
        "throughput",
        null
      ],
      "nullable": true
    },
    "has": {
      "type": "array",
      "description": "Limit providers to those with these features. `null` removes the stored value.",
      "nullable": true,
      "items": {
        "type": "string",
        "enum": [
          "implicit-caching",
          "reasoning",
          "structured-output",
          "tool-use",
          "vision"
        ]
      }
    },
    "caching": {
      "type": "string",
      "description": "Use caching if available. `@default` ignores the value from the inference request. `null` removes the stored value.",
      "enum": [
        "@default",
        "auto",
        null
      ],
      "nullable": true
    },
    "serviceTier": {
      "type": "string",
      "description": "The service tier for providers that support it. `@default` ignores the value from the inference request. `null` removes the stored value.",
      "enum": [
        "@default",
        "flex",
        "priority",
        "fast",
        null
      ],
      "nullable": true
    },
    "providerTimeouts": {
      "description": "Provider timeouts in milliseconds. `@default` ignores the value from the inference request. `null` removes the stored value.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "@default"
          ]
        },
        {
          "type": "object",
          "nullable": true,
          "properties": {
            "byok": {
              "type": "object",
              "description": "The timeout for each provider that uses a BYOK credential, keyed by provider slug."
            }
          }
        }
      ]
    },
    "zeroDataRetention": {
      "type": "boolean",
      "description": "Only use providers with zero data retention. `null` removes the stored value.",
      "nullable": true
    },
    "hipaaCompliant": {
      "type": "boolean",
      "description": "Only use HIPAA-compliant providers. `null` removes the stored value.",
      "nullable": true
    },
    "disallowPromptTraining": {
      "type": "boolean",
      "description": "Only use providers that do not train on prompts. `null` removes the stored value.",
      "nullable": true
    },
    "speed": {
      "type": "string",
      "description": "Only use the fastest providers, with short timeouts. `null` removes the stored value.",
      "enum": [
        "fast",
        null
      ],
      "nullable": true
    },
    "allowFallbackFromFast": {
      "type": "boolean",
      "description": "Allow fallback from fast to standard providers on failure. `null` removes the stored value.",
      "nullable": true
    }
  }
}
```

## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/ai-gateway/virtual-model-configs?teamId=string&slug=string', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "virtualModelSlug": "string",
    "displayName": "Example Name",
    "description": "string",
    "status": "string",
    "modelSlug": "string",
    "models": [],
    "providerOrder": [],
    "providerOnly": [],
    "observabilityTags": [],
    "deleted": "false",
    "providerOptions": "value",
    "byokCredentialIds": [],
    "inferenceRegion": {
      "scope": "zone",
      "geoRegion": "string",
      "providers": "value"
    },
    "sort": "@default",
    "has": [],
    "caching": "@default",
    "serviceTier": "@default",
    "providerTimeouts": "@default",
    "zeroDataRetention": "true",
    "hipaaCompliant": "true",
    "disallowPromptTraining": "true",
    "speed": "fast",
    "allowFallbackFromFast": "true"
  }),
});

const data = await response.json();
console.log(data);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  const response = await fetch('https://api.vercel.com/ai-gateway/virtual-model-configs?teamId=string&slug=string', {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "virtualModelSlug": "string",
      "displayName": "Example Name",
      "description": "string",
      "status": "string",
      "modelSlug": "string",
      "models": [],
      "providerOrder": [],
      "providerOnly": [],
      "observabilityTags": [],
      "deleted": "false",
      "providerOptions": "value",
      "byokCredentialIds": [],
      "inferenceRegion": {
        "scope": "zone",
        "geoRegion": "string",
        "providers": "value"
      },
      "sort": "@default",
      "has": [],
      "caching": "@default",
      "serviceTier": "@default",
      "providerTimeouts": "@default",
      "zeroDataRetention": "true",
      "hipaaCompliant": "true",
      "disallowPromptTraining": "true",
      "speed": "fast",
      "allowFallbackFromFast": "true"
    }),
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X PATCH 'https://api.vercel.com/ai-gateway/virtual-model-configs?teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d "{
    \"virtualModelSlug\": \"string\",
    \"displayName\": \"Example Name\",
    \"description\": \"string\",
    \"status\": \"string\",
    \"modelSlug\": \"string\",
    \"models\": [],
    \"providerOrder\": [],
    \"providerOnly\": [],
    \"observabilityTags\": [],
    \"deleted\": \"false\",
    \"providerOptions\": \"value\",
    \"byokCredentialIds\": [],
    \"inferenceRegion\": {
      \"scope\": \"zone\",
      \"geoRegion\": \"string\",
      \"providers\": \"value\"
    },
    \"sort\": \"@default\",
    \"has\": [],
    \"caching\": \"@default\",
    \"serviceTier\": \"@default\",
    \"providerTimeouts\": \"@default\",
    \"zeroDataRetention\": \"true\",
    \"hipaaCompliant\": \"true\",
    \"disallowPromptTraining\": \"true\",
    \"speed\": \"fast\",
    \"allowFallbackFromFast\": \"true\"
  }"
```

## Example response

```json
{
  "allowFallbackFromFast": "false",
  "autoRouterDefaultVersion": "123",
  "baseUrl": "https://example.com",
  "byokCredentialIds": [],
  "caching": "auto",
  "createdAt": "123",
  "createdBy": "string",
  "deleted": "false",
  "description": "string",
  "disallowPromptTraining": "false",
  "displayName": "Example Name",
  "has": [],
  "hipaaCompliant": "false",
  "inferenceRegion": {
    "geoRegion": "string",
    "providerRegion": "example_id",
    "providers": "value",
    "scope": "global"
  },
  "instanceId": "example_id",
  "kind": "string",
  "models": [],
  "modelSlug": "string",
  "observabilityTags": [],
  "ownerId": "example_id",
  "providerOnly": [],
  "providerOptions": "value",
  "providerOrder": [],
  "providerTimeouts": {
    "byok": "value"
  },
  "selector": "cost",
  "selectorOptions": {
    "cost": "value",
    "intelligence": "value",
    "tps": "value",
    "ttft": "value"
  },
  "serviceTier": "fast",
  "sort": "cost",
  "speed": "fast",
  "status": "string",
  "updatedAt": "123",
  "updatedBy": "string",
  "virtualModelSlug": "string",
  "visibility": "string",
  "zeroDataRetention": "false"
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "description": "Active and archived router configurations owned by the authenticated team.",
  "required": [
    "createdAt",
    "deleted",
    "kind",
    "ownerId",
    "status",
    "updatedAt",
    "virtualModelSlug"
  ],
  "properties": {
    "allowFallbackFromFast": {
      "type": "boolean",
      "description": "Allow fallback from fast to standard providers on failure.",
      "enum": [
        false,
        true
      ]
    },
    "autoRouterDefaultVersion": {
      "type": "number",
      "description": "For the team's `auto` router: the Vercel default version the team last saved against."
    },
    "baseUrl": {
      "type": "string",
      "description": "For kind=relay: URL the gateway forwards requests to as a transparent proxy."
    },
    "byokCredentialIds": {
      "type": "array",
      "description": "BYOK credential IDs allowed for this VMC.",
      "items": {
        "type": "string"
      }
    },
    "caching": {
      "type": "string",
      "description": "Use caching if available.",
      "enum": [
        "auto"
      ]
    },
    "createdAt": {
      "type": "number",
      "description": "Creation timestamp (epoch ms)."
    },
    "createdBy": {
      "type": "string",
      "description": "User or app id that created this VMC."
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether this VMC is soft-deleted.",
      "enum": [
        false,
        true
      ]
    },
    "description": {
      "type": "string",
      "description": "Optional description for UI."
    },
    "disallowPromptTraining": {
      "type": "boolean",
      "description": "Only use providers that will not train on your prompts.",
      "enum": [
        false,
        true
      ]
    },
    "displayName": {
      "type": "string",
      "description": "Human-readable name for UI."
    },
    "has": {
      "type": "array",
      "description": "Limit providers to those with these features.",
      "items": {
        "type": "string",
        "description": "Limit providers to those with these features.",
        "enum": [
          "implicit-caching",
          "reasoning",
          "structured-output",
          "tool-use",
          "vision"
        ]
      }
    },
    "hipaaCompliant": {
      "type": "boolean",
      "description": "Only use HIPAA-compliant providers.",
      "enum": [
        false,
        true
      ]
    },
    "inferenceRegion": {
      "type": "object",
      "description": "Region pinned on the VMC for system-credential routing (alias/router only).",
      "properties": {
        "geoRegion": {
          "type": "string",
          "description": "Geo zone (e.g. \"us\", \"eu\")."
        },
        "providerRegion": {
          "type": "string",
          "description": "Provider-specific region identifier."
        },
        "providers": {
          "type": "object",
          "description": "Per-provider region overrides keyed by provider slug.",
          "additionalProperties": {
            "type": "object",
            "description": "Per-provider region overrides keyed by provider slug.",
            "nullable": true
          }
        },
        "scope": {
          "type": "string",
          "description": "Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`.",
          "enum": [
            "global",
            "specific",
            "zone"
          ]
        }
      }
    },
    "instanceId": {
      "type": "string",
      "description": "The concrete model-provider instance this VMC resolves to."
    },
    "kind": {
      "type": "string",
      "description": "VMC kind: alias, relay, or router."
    },
    "models": {
      "type": "array",
      "description": "For kind=router: ordered candidates, bare slugs/references or `{ slug, ...attributes }`. For kind=alias: ordered fallback model slugs, optionally led by one conditional `{ model, when }` entry, used when the primary model's answers match `when`.",
      "items": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "description": "For kind=router: ordered candidates, bare slugs/references or `{ slug, ...attributes }`. For kind=alias: ordered fallback model slugs, optionally led by one conditional `{ model, when }` entry, used when the primary model's answers match `when`.",
            "required": [
              "slug"
            ]
          },
          {
            "type": "object",
            "description": "For kind=router: ordered candidates, bare slugs/references or `{ slug, ...attributes }`. For kind=alias: ordered fallback model slugs, optionally led by one conditional `{ model, when }` entry, used when the primary model's answers match `when`.",
            "required": [
              "model",
              "when"
            ]
          }
        ]
      }
    },
    "modelSlug": {
      "type": "string",
      "description": "Canonical model slug this VMC maps to (e.g. \"creator/model\"). Not used by kind=router."
    },
    "observabilityTags": {
      "type": "array",
      "description": "Observability tags attached to requests through this VMC.",
      "items": {
        "type": "string"
      }
    },
    "ownerId": {
      "type": "string",
      "description": "Team (owner) that owns this VMC."
    },
    "providerOnly": {
      "type": "array",
      "description": "Restrict routing to only these providers.",
      "items": {
        "type": "string"
      }
    },
    "providerOptions": {
      "type": "object",
      "description": "Arbitrary per-provider AI SDK options, keyed by gateway provider slug.",
      "additionalProperties": {
        "type": "object",
        "description": "Arbitrary per-provider AI SDK options, keyed by gateway provider slug.",
        "additionalProperties": true
      }
    },
    "providerOrder": {
      "type": "array",
      "description": "Ordered list of providers to try as fallbacks on failure.",
      "items": {
        "type": "string"
      }
    },
    "providerTimeouts": {
      "type": "object",
      "description": "Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials.",
      "properties": {
        "byok": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          }
        }
      }
    },
    "selector": {
      "type": "string",
      "description": "For kind=router: how to order candidates. Absent means declared order.",
      "enum": [
        "cost",
        "intelligence",
        "tps",
        "ttft"
      ]
    },
    "selectorOptions": {
      "type": "object",
      "description": "For kind=router: option slices keyed by selector name; each selector owns its slice's shape.",
      "properties": {
        "cost": {
          "type": "object",
          "description": "For kind=router: option slices keyed by selector name; each selector owns its slice's shape.",
          "additionalProperties": true
        },
        "intelligence": {
          "type": "object",
          "description": "For kind=router: option slices keyed by selector name; each selector owns its slice's shape.",
          "additionalProperties": true
        },
        "tps": {
          "type": "object",
          "description": "For kind=router: option slices keyed by selector name; each selector owns its slice's shape.",
          "additionalProperties": true
        },
        "ttft": {
          "type": "object",
          "description": "For kind=router: option slices keyed by selector name; each selector owns its slice's shape.",
          "additionalProperties": true
        }
      }
    },
    "serviceTier": {
      "type": "string",
      "description": "Service tier for providers that support it.",
      "enum": [
        "fast",
        "flex",
        "priority"
      ]
    },
    "sort": {
      "type": "string",
      "description": "Rank eligible providers by an attribute.",
      "enum": [
        "cost",
        "latency",
        "price",
        "throughput",
        "tps",
        "ttft"
      ]
    },
    "speed": {
      "type": "string",
      "description": "Only use fastest providers with short timeouts.",
      "enum": [
        "fast"
      ]
    },
    "status": {
      "type": "string",
      "description": "UI lifecycle status: draft, active, or archived."
    },
    "updatedAt": {
      "type": "number",
      "description": "Last update timestamp (epoch ms)."
    },
    "updatedBy": {
      "type": "string",
      "description": "User or app id that last updated this VMC."
    },
    "virtualModelSlug": {
      "type": "string",
      "description": "Client-facing alias used as the model slug in Gateway calls."
    },
    "visibility": {
      "type": "string",
      "description": "Visibility in listings: public, internal, or stealth."
    },
    "zeroDataRetention": {
      "type": "boolean",
      "description": "Only use providers with zero data retention.",
      "enum": [
        false,
        true
      ]
    }
  }
}
```

### 400: One of the provided values in the request body is invalid.

### 401: The request is not authorized.

### 403: You do not have permission to access this resource.

### 404: No description

### 410: No description

### 429: No description

### 500: No description

---

## Related

- [ai-gateway endpoints](/docs/rest-api#ai-gateway)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://vercel.com/openapi.json) (machine-readable, all endpoints)

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
