登录 access_token

POST /oneaster/v1/keys

Create Key; blank models means all, blank budget unlimited; secret returned at creation

Creation budget may exceed the current wallet balance; it neither adds funds nor guarantees call-time balance. Omitted, null or blank budget_credits means unlimited; a finite budget is a positive exact credit decimal of up to four places within native limits. PATCH has separate validation and may reject a budget exceeding the wallet or below prior spending.

POST/oneaster/v1/keys

身份验证

Authorizationstring必填

使用登录取得的 native access_token(部分接口支持带对应权限的 PAT);身份要求:登录 access_token。

Authorization: Bearer $ONEASTER_ACCESS_TOKEN

请求正文 · application/json

namestring必填

1–50 UTF8 bytes

budget_creditsstring,null

Blank/null/omitted = unlimited; otherwise positive decimal up to four places, exactly representable within native quota bounds. Creation permits a cap above the current wallet balance, including a zero wallet; actual usage remains subject to wallet funds.

modelsarray,null

Blank/empty/null/omitted = all allowed models

expires_atstring,null
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 50,
      "description": "1–50 UTF8 bytes"
    },
    "budget_credits": {
      "type": [
        "string",
        "null"
      ],
      "description": "Blank/null/omitted = unlimited; otherwise positive decimal up to four places, exactly representable within native quota bounds. Creation permits a cap above the current wallet balance, including a zero wallet; actual usage remains subject to wallet funds."
    },
    "models": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "uniqueItems": true,
      "description": "Blank/empty/null/omitted = all allowed models"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}