API Key Model Access
Set API Key Model Access Policy
PUT
Set or update the model access policy of a single API key. The request body is the
policy object itself.
Permissions
Only the team Owner / Admin can call this endpoint. Developer, Basic, and Billing members cannot set the policy. The target API key must belong to the caller’s team.Request Headers
string
erforderlich
Enum:
application/jsonstring
erforderlich
Bearer authentication format, for example: Bearer {{API Key}}.
Path Parameters
string
erforderlich
The stringId of the target API key.
Request Body
int32
Policy schema version. Currently
1.string
Product scope the policy applies to. Only
model_api is supported when provided.string
erforderlich
Access mode. Possible values:
all_enabled (can access all enabled models), selected (can access only the specified models).object[]
Accessible models. Required when
mode=selected and must contain at least one model; ignored when mode=all_enabled.object[]
Excluded models. Applies when
mode=all_enabled; ignored when mode=selected. Same structure as allowedModels.Write constraints:
modemust beall_enabledorselected.- When
mode=selected,allowedModelsmust contain at least one model. - Every model written must be within the team’s enabled model range and currently available; requests containing offline, unavailable, or not-enabled models are rejected.
- Model arrays that do not apply to the current mode are normalized to empty, and duplicate models are deduplicated. The response reflects the server-normalized object.
sourceis managed by the server and ignored on write.
Response
The response has the same structure as Get API Key Model Access Policy and reflects the latest, normalized policy object.Zuletzt geändert am 10. August 2026