{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apipass/json-schema/apipass-create-api-key-request-schema.json",
  "title": "CreateApiKeyRequest",
  "description": "创建API Key请求",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apipass-api-keys-api-openapi.yml#/components/schemas/CreateApiKeyRequest",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
      "description": "API Key名称，如'生产环境'、'测试环境'"
    },
    "hourly_credit_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hourly Credit Limit",
      "description": "小时credit限额",
      "default": 1000
    },
    "daily_credit_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Daily Credit Limit",
      "description": "日credit限额",
      "default": 5000
    },
    "total_credit_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Credit Limit",
      "description": "总credit限额",
      "default": 100000
    },
    "ip_whitelist": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ip Whitelist",
      "description": "IP白名单"
    },
    "claude_code_enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Claude Code Enabled",
      "description": "是否启用Claude Code功能",
      "default": false
    },
    "concurrent_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Concurrent Limit",
      "description": "Claude Code并发请求限制",
      "default": 5
    }
  },
  "type": "object",
  "required": [
    "name"
  ]
}