GRGlobalRouter Docs
Console

API keys / PATCH

Update API key

Updates an API key's name, scopes, model ranges, source IPs, or rate limit.

Endpoints

Mobile only shows the endpoint list. View parameter details and examples on desktop.

MethodEndpointDescription
GET/api/v1/keyReads masked information for the API key used by the current request.
GET/api/v1/keysLists API keys owned by the current calling key's owner.
GET/api/v1/keys/{key_ref}Reads masked information for one API key by key reference.
POST/api/v1/keysCreates a new tenant API key.
PATCH/api/v1/keys/{key_ref}Updates an API key's name, scopes, model ranges, source IPs, or rate limit.
DELETE/api/v1/keys/{key_ref}Revokes an API key.
PATCH/api/v1/keys/{key_ref}

Only fields present in the request body are updated, and the target must belong to the calling key's owner. Management cannot be added or removed; an existing management key must preserve it when updating scopes.

Back to API keys endpoint list

Request parameters

FieldTypeRequiredDescription
key_refpathYesKey ID, prefix, or supported key reference.
namestringNoNew key name.
scopesstring[]NoNew scopes; the presence of management cannot be changed.
statusstringNoKey status, such as active or disabled.
rate_limit_per_minuteintegerNoNew per-minute rate limit.
allowed_modelsstring[]NoNew model allowlist.
blocked_modelsstring[]NoNew model blocklist.
allowed_ipsstring[]NoNew source IP allowlist.
expires_atstringNo新过期时间,传 null 可清除。

Response fields

FieldTypeRequiredDescription
data.idstringYesAPI key record ID.
data.tenant_idstringYesKey 所属租户 ID。
data.namestringYesUpdated key name.
data.key_prefixstringYesKey 前缀,用于识别与排查。
data.scopesstring[]YesUpdated scopes.
data.statusstringYesUpdated key status.
data.allowed_modelsstring[]Noupdate后的models allowlist。
data.blocked_modelsstring[]Noupdate后的models blocklist。
data.allowed_ipsstring[]Noupdate后的来源 IP allowlist。
data.rate_limit_per_minuteintegerNoUpdated rate limit.
data.expires_atstringNoupdate后的过期时间。
data.last_used_atstringNo最近使用时间。