{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aginera-ai/json-schema/aginera-ai-credits-schema.json",
  "title": "Credits",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aginera-ai-billing-api-openapi.yml#/components/schemas/Credits",
  "type": "object",
  "properties": {
    "available": {
      "type": "number"
    },
    "held": {
      "type": "number"
    },
    "purchased_total": {
      "type": "number"
    },
    "consumed_total": {
      "type": "number"
    },
    "environment": {
      "$ref": "#/$defs/Environment"
    },
    "billing_mode": {
      "type": "string",
      "enum": [
        "ledger",
        "artifact"
      ]
    },
    "low_balance_threshold": {
      "type": "number"
    },
    "rate_card": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string"
          },
          "credits": {
            "type": "number"
          }
        },
        "required": [
          "operation",
          "credits"
        ]
      }
    }
  },
  "required": [
    "available",
    "held",
    "environment",
    "billing_mode",
    "rate_card"
  ],
  "$defs": {
    "Environment": {
      "type": "string",
      "enum": [
        "sandbox",
        "production"
      ]
    }
  }
}