virtual_model_configs
Creates, updates, deletes, gets or lists a virtual_model_configs resource.
Overview
| Name | virtual_model_configs |
| Type | Resource |
| Id | vercel.ai_gateway.virtual_model_configs |
Fields
The following fields are returned by SELECT queries:
- get_by_slug
- list
Public response shape for virtual model configs. Used so OpenAPI generation can avoid ElectroDB's recursive EntityItem types.
| Name | Datatype | Description |
|---|---|---|
instance_id | string | The concrete model-provider instance this VMC resolves to. (wire: instanceId) |
owner_id | string | Team (owner) that owns this VMC. (wire: ownerId) |
display_name | string | Human-readable name for UI. (wire: displayName) |
allow_fallback_from_fast | boolean | Allow fallback from fast to standard providers on failure. (false, true) (wire: allowFallbackFromFast) |
base_url | string | For kind=relay: URL the gateway forwards requests to as a transparent proxy. (wire: baseUrl) |
byok_credential_ids | array | BYOK credential IDs allowed for this VMC. (wire: byokCredentialIds) |
caching | string | Use caching if available. (auto) |
created_at | number | Creation timestamp (epoch ms). (wire: createdAt) |
deleted | boolean | Whether this VMC is soft-deleted. (false, true) |
description | string | Optional description for UI. |
disallow_prompt_training | boolean | Only use providers that will not train on your prompts. (false, true) (wire: disallowPromptTraining) |
has | array | Limit providers to those with these features. |
hipaa_compliant | boolean | Only use HIPAA-compliant providers. (false, true) (wire: hipaaCompliant) |
inference_region | object | Region pinned on the VMC for system-credential routing (alias/router only). (wire: inferenceRegion) |
kind | string | VMC kind: alias, relay, or router. |
model_slug | string | Canonical model slug this VMC maps to (e.g. "creator/model"). Not used by kind=router. (wire: modelSlug) |
models | array | For kind=router: ordered candidates, model slugs or router references. Otherwise: fallback models. |
observability_tags | array | Observability tags attached to requests through this VMC. (wire: observabilityTags) |
provider_only | array | Restrict routing to only these providers. (wire: providerOnly) |
provider_options | object | Arbitrary per-provider AI SDK options, keyed by gateway provider slug. (wire: providerOptions) |
provider_order | array | Ordered list of providers to try as fallbacks on failure. (wire: providerOrder) |
provider_timeouts | object | Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials. (wire: providerTimeouts) |
requires | array | For kind=router: capability tags a candidate must have. |
selector | string | For kind=router: how to order candidates. (cost, priority, tps, ttft) |
service_tier | string | Service tier for providers that support it. (fast, flex, priority) (wire: serviceTier) |
sort | string | Rank eligible providers by an attribute. (cost, latency, price, throughput, tps, ttft) |
speed | string | Only use fastest providers with short timeouts. (fast) |
status | string | UI lifecycle status: draft, active, or archived. |
updated_at | number | Last update timestamp (epoch ms). (wire: updatedAt) |
updated_by | string | User id that last updated this VMC. (wire: updatedBy) |
virtual_model_slug | string | Client-facing alias used as the model slug in Gateway calls. (wire: virtualModelSlug) |
visibility | string | Visibility in listings: public, internal, or stealth. |
zero_data_retention | boolean | Only use providers with zero data retention. (false, true) (wire: zeroDataRetention) |
Public response shape for virtual model configs. Used so OpenAPI generation can avoid ElectroDB's recursive EntityItem types.
| Name | Datatype | Description |
|---|---|---|
instance_id | string | The concrete model-provider instance this VMC resolves to. (wire: instanceId) |
owner_id | string | Team (owner) that owns this VMC. (wire: ownerId) |
display_name | string | Human-readable name for UI. (wire: displayName) |
allow_fallback_from_fast | boolean | Allow fallback from fast to standard providers on failure. (false, true) (wire: allowFallbackFromFast) |
base_url | string | For kind=relay: URL the gateway forwards requests to as a transparent proxy. (wire: baseUrl) |
byok_credential_ids | array | BYOK credential IDs allowed for this VMC. (wire: byokCredentialIds) |
caching | string | Use caching if available. (auto) |
created_at | number | Creation timestamp (epoch ms). (wire: createdAt) |
deleted | boolean | Whether this VMC is soft-deleted. (false, true) |
description | string | Optional description for UI. |
disallow_prompt_training | boolean | Only use providers that will not train on your prompts. (false, true) (wire: disallowPromptTraining) |
has | array | Limit providers to those with these features. |
hipaa_compliant | boolean | Only use HIPAA-compliant providers. (false, true) (wire: hipaaCompliant) |
inference_region | object | Region pinned on the VMC for system-credential routing (alias/router only). (wire: inferenceRegion) |
kind | string | VMC kind: alias, relay, or router. |
model_slug | string | Canonical model slug this VMC maps to (e.g. "creator/model"). Not used by kind=router. (wire: modelSlug) |
models | array | For kind=router: ordered candidates, model slugs or router references. Otherwise: fallback models. |
observability_tags | array | Observability tags attached to requests through this VMC. (wire: observabilityTags) |
provider_only | array | Restrict routing to only these providers. (wire: providerOnly) |
provider_options | object | Arbitrary per-provider AI SDK options, keyed by gateway provider slug. (wire: providerOptions) |
provider_order | array | Ordered list of providers to try as fallbacks on failure. (wire: providerOrder) |
provider_timeouts | object | Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials. (wire: providerTimeouts) |
requires | array | For kind=router: capability tags a candidate must have. |
selector | string | For kind=router: how to order candidates. (cost, priority, tps, ttft) |
service_tier | string | Service tier for providers that support it. (fast, flex, priority) (wire: serviceTier) |
sort | string | Rank eligible providers by an attribute. (cost, latency, price, throughput, tps, ttft) |
speed | string | Only use fastest providers with short timeouts. (fast) |
status | string | UI lifecycle status: draft, active, or archived. |
updated_at | number | Last update timestamp (epoch ms). (wire: updatedAt) |
updated_by | string | User id that last updated this VMC. (wire: updatedBy) |
virtual_model_slug | string | Client-facing alias used as the model slug in Gateway calls. (wire: virtualModelSlug) |
visibility | string | Visibility in listings: public, internal, or stealth. |
zero_data_retention | boolean | Only use providers with zero data retention. (false, true) (wire: zeroDataRetention) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_slug | select | vmc_slug | owner_id, team_id, slug | Get a virtual model config by path slug |
list | select | owner_id, limit, cursor, team_id, slug | List virtual model configs. With ownerId, returns all of that team's VMCs. Without it, pages through VMCs across all teams (newest-first, limit/cursor). | |
create | insert | team_id, slug | Create a virtual model config (VMC) | |
update_by_slug | update | vmc_slug | team_id, slug | Update a virtual model config by path slug |
update | update | team_id, slug | Update a virtual model config | |
delete_by_slug | delete | vmc_slug | owner_id, updated_by, acting_ip, acting_user_agent, team_id, slug | Delete a virtual model config by path slug (soft delete) |
delete | delete | virtual_model_slug | owner_id, updated_by, acting_ip, acting_user_agent, team_id, slug | Delete a virtual model config (soft delete) |
get_by_query | exec | ownerId, virtualModelSlug, limit, cursor, teamId, slug | Get a virtual model config |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
virtual_model_slug | string | (wire: virtualModelSlug) |
vmc_slug | string | |
acting_ip | string | (wire: actingIp) |
acting_user_agent | string | (wire: actingUserAgent) |
cursor | string | |
limit | integer | |
ownerId | string | |
owner_id | string | (wire: ownerId) |
slug | string | The Team slug to perform the request on behalf of. |
teamId | string | The Team identifier to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
updated_by | string | (wire: updatedBy) |
virtualModelSlug | string |
SELECT examples
- get_by_slug
- list
Get a virtual model config by path slug
SELECT
instance_id,
owner_id,
display_name,
allow_fallback_from_fast,
base_url,
byok_credential_ids,
caching,
created_at,
deleted,
description,
disallow_prompt_training,
has,
hipaa_compliant,
inference_region,
kind,
model_slug,
models,
observability_tags,
provider_only,
provider_options,
provider_order,
provider_timeouts,
requires,
selector,
service_tier,
sort,
speed,
status,
updated_at,
updated_by,
virtual_model_slug,
visibility,
zero_data_retention
FROM vercel.ai_gateway.virtual_model_configs
WHERE vmc_slug = '{{ vmc_slug }}' -- required
AND owner_id = '{{ owner_id }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
List virtual model configs. With ownerId, returns all of that team's VMCs. Without it, pages through VMCs across all teams (newest-first, limit/cursor).
SELECT
instance_id,
owner_id,
display_name,
allow_fallback_from_fast,
base_url,
byok_credential_ids,
caching,
created_at,
deleted,
description,
disallow_prompt_training,
has,
hipaa_compliant,
inference_region,
kind,
model_slug,
models,
observability_tags,
provider_only,
provider_options,
provider_order,
provider_timeouts,
requires,
selector,
service_tier,
sort,
speed,
status,
updated_at,
updated_by,
virtual_model_slug,
visibility,
zero_data_retention
FROM vercel.ai_gateway.virtual_model_configs
WHERE owner_id = '{{ owner_id }}'
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
INSERT examples
- create
- Manifest
Create a virtual model config (VMC)
INSERT INTO vercel.ai_gateway.virtual_model_configs (
team_id,
slug
)
SELECT
'{{ team_id }}',
'{{ slug }}'
RETURNING
instance_id,
owner_id,
display_name,
allow_fallback_from_fast,
base_url,
byok_credential_ids,
caching,
created_at,
deleted,
description,
disallow_prompt_training,
has,
hipaa_compliant,
inference_region,
kind,
model_slug,
models,
observability_tags,
provider_only,
provider_options,
provider_order,
provider_timeouts,
requires,
selector,
service_tier,
sort,
speed,
status,
updated_at,
updated_by,
virtual_model_slug,
visibility,
zero_data_retention
;
# Description fields are for documentation purposes
- name: virtual_model_configs
props:
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.
UPDATE examples
- update_by_slug
- update
Update a virtual model config by path slug
UPDATE vercel.ai_gateway.virtual_model_configs
SET
-- No updatable properties
WHERE
vmc_slug = '{{ vmc_slug }}' --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
instance_id,
owner_id,
display_name,
allow_fallback_from_fast,
base_url,
byok_credential_ids,
caching,
created_at,
deleted,
description,
disallow_prompt_training,
has,
hipaa_compliant,
inference_region,
kind,
model_slug,
models,
observability_tags,
provider_only,
provider_options,
provider_order,
provider_timeouts,
requires,
selector,
service_tier,
sort,
speed,
status,
updated_at,
updated_by,
virtual_model_slug,
visibility,
zero_data_retention;
Update a virtual model config
UPDATE vercel.ai_gateway.virtual_model_configs
SET
-- No updatable properties
WHERE
team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
instance_id,
owner_id,
display_name,
allow_fallback_from_fast,
base_url,
byok_credential_ids,
caching,
created_at,
deleted,
description,
disallow_prompt_training,
has,
hipaa_compliant,
inference_region,
kind,
model_slug,
models,
observability_tags,
provider_only,
provider_options,
provider_order,
provider_timeouts,
requires,
selector,
service_tier,
sort,
speed,
status,
updated_at,
updated_by,
virtual_model_slug,
visibility,
zero_data_retention;
DELETE examples
- delete_by_slug
- delete
Delete a virtual model config by path slug (soft delete)
DELETE FROM vercel.ai_gateway.virtual_model_configs
WHERE vmc_slug = '{{ vmc_slug }}' --required
AND owner_id = '{{ owner_id }}'
AND updated_by = '{{ updated_by }}'
AND acting_ip = '{{ acting_ip }}'
AND acting_user_agent = '{{ acting_user_agent }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Delete a virtual model config (soft delete)
DELETE FROM vercel.ai_gateway.virtual_model_configs
WHERE virtual_model_slug = '{{ virtual_model_slug }}' --required
AND owner_id = '{{ owner_id }}'
AND updated_by = '{{ updated_by }}'
AND acting_ip = '{{ acting_ip }}'
AND acting_user_agent = '{{ acting_user_agent }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Lifecycle Methods
EXEC variables use wire (API) names.
- get_by_query
Get a virtual model config
EXEC vercel.ai_gateway.virtual_model_configs.get_by_query
@ownerId='{{ ownerId }}',
@virtualModelSlug='{{ virtualModelSlug }}',
@limit='{{ limit }}',
@cursor='{{ cursor }}',
@teamId='{{ teamId }}',
@slug='{{ slug }}'
;