PATCH
/oneaster/v1/keys/{id}Authorizations
AuthorizationstringrequiredUse a native login access_token (or a scoped PAT where supported); required access: Native access token.
Authorization: Bearer $ONEASTER_ACCESS_TOKEN
Parameters
idstringrequiredpath
Body · application/json
namestringKey 名称最多 50 UTF-8 字节;拒绝首尾空白与 ASCII 控制字符,允许内部空格。
budget_creditsstring,nullPositive canonical decimal string, up to four places; total lifetime cap >= live spent and <= live native wallet; null or blank is unlimited. Omission preserves current cap.
modelsarray,nullnull or [] disables model restrictions; omitted preserves current models.
expires_atstring,nullFuture UTC date-time through year9999; null removes expiry; omitted preserves current expiry.
enabledbooleanJSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "Key 名称最多 50 UTF-8 字节;拒绝首尾空白与 ASCII 控制字符,允许内部空格。"
},
"budget_credits": {
"type": [
"string",
"null"
],
"description": "Positive canonical decimal string, up to four places; total lifetime cap >= live spent and <= live native wallet; null or blank is unlimited. Omission preserves current cap."
},
"models": {
"type": [
"array",
"null"
],
"maxItems": 50,
"uniqueItems": true,
"items": {
"type": "string",
"maxLength": 200
},
"description": "null or [] disables model restrictions; omitted preserves current models."
},
"expires_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Future UTC date-time through year9999; null removes expiry; omitted preserves current expiry."
},
"enabled": {
"type": "boolean"
}
},
"minProperties": 1,
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": [
"enabled"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "Key 名称最多 50 UTF-8 字节;拒绝首尾空白与 ASCII 控制字符,允许内部空格。"
},
"budget_credits": {
"type": [
"string",
"null"
],
"description": "Positive canonical decimal string, up to four places; total lifetime cap >= live spent and <= live native wallet; null or blank is unlimited. Omission preserves current cap."
},
"models": {
"type": [
"array",
"null"
],
"maxItems": 50,
"uniqueItems": true,
"items": {
"type": "string",
"maxLength": 200
},
"description": "null or [] disables model restrictions; omitted preserves current models."
},
"expires_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Future UTC date-time through year9999; null removes expiry; omitted preserves current expiry."
}
},
"minProperties": 1
}
],
"description": "Atomic owned native partial PATCH. enabled must be submitted alone. Metadata cannot enable disabled/expired/exhausted Keys. No automatic write retry; read current metadata after uncertain cache-invalidation failure."
}