{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nanotoll-dev/json-schema/nanotoll-dev-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nanotoll-dev-openapi.json#/components/schemas/AccountResponse",
  "type": "object",
  "required": [
    "key_type",
    "tier",
    "internal",
    "credit_balance",
    "funding_address",
    "chain",
    "token",
    "trial_inflight_limit",
    "usage",
    "limits_endpoint",
    "key_status"
  ],
  "properties": {
    "key_type": {
      "type": "string",
      "description": "Storage class: deposit (paying), free (trial grant), glama (service key)."
    },
    "tier": {
      "type": "string",
      "description": "Derived tier: trial (free grant), paid (funded key), internal (operator).",
      "enum": [
        "trial",
        "paid",
        "internal"
      ]
    },
    "key_status": {
      "type": "string",
      "enum": [
        "active",
        "expired"
      ],
      "description": "Derived label: expired only for a free key past its expires_at. Credit 0.0 is not a state - paid keys never expire."
    },
    "internal": {
      "type": "boolean"
    },
    "credit_balance": {
      "type": "number",
      "format": "double",
      "description": "Current credit in USDC."
    },
    "funding_address": {
      "type": "string",
      "description": "USDC (Base) top-up address for this account."
    },
    "chain": {
      "type": "string"
    },
    "token": {
      "type": "string"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-key expiry, RFC3339 UTC (e.g. 2026-11-23T06:21:21Z). null = never expires."
    },
    "trial_inflight_limit": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Trial keys hold at most this many requests in flight; paid keys queue instead. null for non-trial tiers."
    },
    "usage": {
      "type": "object",
      "properties": {
        "charged_requests": {
          "type": "integer"
        },
        "charged_chars": {
          "type": "integer",
          "description": "Total input chars across charged calls."
        },
        "charged_amount": {
          "type": "number",
          "format": "double",
          "description": "Total USDC charged."
        },
        "refunded_requests": {
          "type": "integer",
          "description": "Calls refunded after a server-side failure."
        }
      }
    },
    "limits_endpoint": {
      "type": "string",
      "description": "Service-wide caps and per-mode prices: GET /v1/limits (open)."
    }
  }
}