{
    "openapi": "3.1.0",
    "info": {
        "title": "GreenPow Agent Compute API",
        "version": "0.1.0-discovery",
        "description": "Public discovery contract for agent-safe compute quoting, wallet policy, purchase intents, provisioning, scaling, usage, and carbon reporting. Live access requires GreenPow-issued credentials."
    },
    "servers": [
        {
            "url": "https://api.greenpow.cloud/agent/v1"
        }
    ],
    "security": [
        {
            "scopedBearerToken": []
        }
    ],
    "paths": {
        "/catalog": {
            "get": {
                "operationId": "getAgentCatalog",
                "summary": "List agent-safe compute products, workload classes, regions, and policy requirements"
            }
        },
        "/wallets": {
            "post": {
                "operationId": "createAgentComputeWallet",
                "summary": "Create or update a governed Agent Compute Wallet policy"
            }
        },
        "/quote": {
            "post": {
                "operationId": "createAgentComputeQuote",
                "summary": "Quote cost, carbon, SLO, compliance, capacity, and approval state before spend"
            }
        },
        "/purchase-intents": {
            "post": {
                "operationId": "createAgentPurchaseIntent",
                "summary": "Create an auditable intent before provisioning or scaling"
            }
        },
        "/approval-requests": {
            "post": {
                "operationId": "createAgentApprovalRequest",
                "summary": "Request human approval for actions outside wallet policy"
            }
        },
        "/provision": {
            "post": {
                "operationId": "provisionAgentCompute",
                "summary": "Provision compute only after billing, policy, quota, SLO, and compliance checks pass"
            }
        },
        "/resources/{resource_id}": {
            "get": {
                "operationId": "getAgentResource",
                "summary": "Return resource status, placement, spend, emissions, and allowed next actions"
            }
        },
        "/resources/{resource_id}/scale": {
            "post": {
                "operationId": "scaleAgentResource",
                "summary": "Scale an existing resource within wallet and platform limits"
            }
        },
        "/resources/{resource_id}/shutdown": {
            "post": {
                "operationId": "shutdownAgentResource",
                "summary": "Stop a resource and close billing, metering, and Carbon Ledger records"
            }
        },
        "/usage": {
            "get": {
                "operationId": "getAgentUsage",
                "summary": "Return wallet usage, spend, budget remaining, energy, and emissions"
            }
        }
    },
    "components": {
        "securitySchemes": {
            "scopedBearerToken": {
                "type": "http",
                "scheme": "bearer",
                "description": "Scoped token issued from a verified GreenPow platform account."
            }
        }
    },
    "externalDocs": {
        "description": "GreenPow AI Discovery",
        "url": "https://www.greenpow.io/ai-discovery/"
    }
}