Create virtual model config
POST
https://api.vercel.com/ai-gateway/virtual-model-configsCreate a virtual model config (VMC)
https://api.vercel.com/ai-gateway/virtual-model-configs
const response = await fetch('https://api.vercel.com/ai-gateway/virtual-model-configs?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
{ "allowFallbackFromFast": "false", "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", "tps": "value", "ttft": "value" }, "serviceTier": "fast", "sort": "cost", "speed": "fast", "status": "string", "updatedAt": "123", "updatedBy": "string", "virtualModelSlug": "string", "visibility": "string", "zeroDataRetention": "false"}AuthorizationbearerToken
Default authentication mechanism
201Success
Region pinned on the VMC for system-credential routing (alias/router only).
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.Canonical model slug this VMC maps to (e.g. "creator/model"). Not used by kind=router.
Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials.
For kind=router: option slices keyed by selector name; each selector owns its slice's shape.
400Error
401The request is not authorized.
403You do not have permission to access this resource.
404Error
409Error
410Error
429Error
500Error