Skip to content
Docs

Update rule

PATCHhttps://api.vercel.com/ai-gateway/rules
Update a routing rule (enabled, action, or description)
https://api.vercel.com/ai-gateway/rules
const response = await fetch('https://api.vercel.com/ai-gateway/rules?teamId=string&slug=string', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"action": {
"reason": "Customer requested refund",
"rewriteModel": "string"
},
"createdAt": "123",
"createdBy": "string",
"deleted": "false",
"description": "string",
"enabled": "false",
"match": {
"model": "string"
},
"ownerId": "example_id",
"ruleId": "example_id",
"type": "deny",
"updatedAt": "123",
"updatedBy": "string"
}
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
actionobjectOptional
createdAtnumberRequired
createdBystringOptional
deletedbooleanOptional
descriptionstringOptional
enabledbooleanRequired
matchobjectOptional
ownerIdstringRequired
ruleIdstringRequired
typestringRequired
updatedAtnumberRequired
updatedBystringOptional
400Error
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
500Error