Replace API key inference limits

http
PUT /api-keys/{id}/limits

Replace API key limits. Requires project.api_keys.manage.

Parameters

NameInRequiredDescription
idpathYes

Request body

FieldTypeRequiredDescription
allowed_modelsarray,nullAllowed catalog model IDs from GET /ai/models. Aliases are normalized to <vendor>/<model>, and duplicates are removed. Retired models return 422 with a replacement; unknown models return 400. Null or omitted means no model restriction. A model excluded by project policy can be stored, but is excluded from effective_allowed_models and rejected at request time.
requests_per_minuteinteger,nullInference requests this key may make per minute. Null or omitted: no rate limit.

Responses

StatusDescription
200The key’s limits as they now stand. All limits are replaced; omitted limits are removed. allowed_models stores canonical catalog IDs; models the project policy excludes are stored but left out of effective_allowed_models and rejected at request time, so key limits cannot broaden the policy. The gateway applies stored limits only when enforced is true. Requires a signed-in administrator or owner with project.api_keys.manage; API keys, service accounts, and agent runs are rejected. The change is audited.
400Bad request
401Unauthorized
403Forbidden
404Not found
500Server error