{"openapi":"3.1.0","info":{"title":"Agent-Native Middleware API","description":"## MCP Trust Plane\n\nAgent Middleware API is a **governed MCP trust plane** for autonomous agent tool calls — not a full agent middleware platform.\n\nCredible wedge: exactly-once gateway authorization, debit, and receipt finalization for metered MCP calls. Remote side effects require the upstream to honor the forwarded idempotency key. See `/WEDGE.md` and `/SECURITY_LIMITATIONS.md`.\n\n### Canonical Loop\n\n`discover -> authenticate -> authorize -> invoke -> meter -> receipt -> audit -> govern`\n\n### Product Surface\n\n- **Scoped signed permits** — tool, wallet, budget, expiry, nonce\n- **Governed MCP invoke** — permit check, policy, idempotency, charge\n- **Wallet metering** — ledger-backed credits with exact decimals\n- **Signed receipts + evidence** — verifiable attempt outcomes\n- **Wallet audit chain** — tamper-evident per-wallet events\n- **Discovery** — `.well-known/agent.json`, `/mcp/tools.json`, `/llms.txt`, `/v1/discover`\n\n### Proof Surfaces\n\nAWI, browser, content, oracle, sandbox, media, IoT, red-team, and telemetry demos are labeled scaffolding. They mount only when `ENABLE_PROOF_SURFACES=true` and do not define the product.\n\n### Authentication\n\nProtected endpoints require an API key via the `X-API-Key` header.\n\n### For Agents\n\nStart at `/.well-known/agent.json`, then `/llms.txt` and `/mcp/tools.json`. Prefer `PUBLIC_URL` over any localhost server entry.","contact":{"name":"Agent-Native Middleware","email":"support@agent-middleware.dev"},"license":{"name":"MIT"},"version":"1.2.0"},"servers":[{"url":"https://api-service-production-433c.up.railway.app","description":"Public API (set PUBLIC_URL)"}],"paths":{"/v1/auth/token":{"post":{"tags":["Authentication"],"summary":"Exchange Api Key For Tokens","description":"Exchange a wallet API key for short-lived JWT tokens.\n\nReturns an access token (15 min) and refresh token (7 days).\nThe refresh token can be used at /v1/auth/refresh to obtain\na new access token without re-presenting the API key.","operationId":"exchange_api_key_for_tokens_v1_auth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh Access Token","description":"Exchange a refresh token for a new access token.\n\nRefresh token rotation: a new refresh token is issued on each use,\nand the old one is marked as revoked.","operationId":"refresh_access_token_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRefreshResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/revoke":{"post":{"tags":["Authentication"],"summary":"Revoke Refresh Token","description":"Revoke a refresh token by JTI.\n\nPrevents the token from being used at /v1/auth/refresh.","operationId":"revoke_refresh_token_v1_auth_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Revoke Refresh Token V1 Auth Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/events":{"get":{"tags":["Control Plane Audit"],"summary":"Get Audit Events","operationId":"get_audit_events_v1_audit_events_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"}},{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"}},{"name":"policy_decision_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Decision Id"}},{"name":"request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},{"name":"ok","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ok"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"summary","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Summary"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/summary":{"get":{"tags":["Control Plane Audit"],"summary":"Get Audit Summary","operationId":"get_audit_summary_v1_audit_summary_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/verify-chain":{"post":{"tags":["Control Plane Audit"],"summary":"Verify Chain","operationId":"verify_chain_v1_audit_verify_chain_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditChainVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditChainVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/policies":{"post":{"tags":["Policy Bundles"],"summary":"Create Policy","operationId":"create_policy_v1_policies_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Policy Bundles"],"summary":"List Policies","operationId":"list_policies_v1_policies_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundleListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/policies/{policy_id}":{"get":{"tags":["Policy Bundles"],"summary":"Get Policy","operationId":"get_policy_v1_policies__policy_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Policy Bundles"],"summary":"Patch Policy","operationId":"patch_policy_v1_policies__policy_id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundlePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBundleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/sponsor":{"post":{"tags":["Agent Financial Gateways"],"summary":"Create a sponsor wallet (liability sink)","description":"Bootstrap operator provisioning only. Create a human-owned root account that acts as the 'liability sink' for agent spending. Sponsors ingest fiat currency via payment rails and convert it to ecosystem credits. Agent wallets are provisioned from sponsor balances.","operationId":"create_sponsor_wallet_v1_billing_wallets_sponsor_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSponsorWalletRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"403":{"description":"Bootstrap administrator access required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/agent":{"post":{"tags":["Agent Financial Gateways"],"summary":"Provision an agent wallet","description":"Create a pre-paid wallet for an autonomous agent, funded from a sponsor's balance. The agent can then transact autonomously up to its budget without human intervention. Supports daily spend limits and automatic refills.","operationId":"create_agent_wallet_v1_billing_wallets_agent_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentWalletRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/child":{"post":{"tags":["Agent Financial Gateways"],"summary":"Spawn a child sub-agent wallet","description":"Create a spend-capped child wallet from a parent agent's balance. Enables hierarchical swarm budgeting: a master agent building a complex tool can spin up specialized sub-agents (code-writer, tester, deployer), each with a micro-budget and hard lifetime cap. Supports TTL for auto-expiry.","operationId":"create_child_wallet_v1_billing_wallets_child_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChildWalletRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChildWalletResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"403":{"description":"Parent wallet expired or wallet access denied"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/{wallet_id}/reclaim":{"post":{"tags":["Agent Financial Gateways"],"summary":"Reclaim unspent credits from a child wallet","description":"Close a child wallet and return unspent credits to the parent. Use this when a sub-agent completes its task or you want to reallocate budget.","operationId":"reclaim_child_wallet_v1_billing_wallets__wallet_id__reclaim_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReclaimResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/{wallet_id}/swarm":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get swarm budget summary","description":"Hierarchical budget summary for an agent's child wallets.","operationId":"get_swarm_budget_v1_billing_wallets__wallet_id__swarm_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwarmBudgetSummary"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/{wallet_id}":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get wallet details","operationId":"get_wallet_v1_billing_wallets__wallet_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets":{"get":{"tags":["Agent Financial Gateways"],"summary":"List wallets","operationId":"list_wallets_v1_billing_wallets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by wallet type","title":"Wallet Type"},"description":"Filter by wallet type"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletListResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/ledger/{wallet_id}":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get wallet ledger","operationId":"get_ledger_v1_billing_ledger__wallet_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/charge":{"post":{"tags":["Agent Financial Gateways"],"summary":"Charge a wallet for API usage","operationId":"charge_wallet_v1_billing_charge_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"query","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"service_category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}],"title":"Service Category"}},{"name":"service","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}],"description":"Service category (alias for service_category)","title":"Service"},"description":"Service category (alias for service_category)"},{"name":"units","in":"query","required":false,"schema":{"type":"number","exclusiveMinimum":0,"description":"Number of units consumed","default":1.0,"title":"Units"},"description":"Number of units consumed"},{"name":"request_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Path"}},{"name":"description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"403":{"description":"Wallet expired, frozen, or denied by policy"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/top-up":{"post":{"tags":["Agent Financial Gateways"],"summary":"Direct top-ups are disabled","description":"Deprecated. Direct requests cannot prove payment settlement. Use `POST /v1/billing/top-up/prepare`; credits are minted only after the payment provider's verified webhook.","operationId":"top_up_wallet_v1_billing_top_up_post","deprecated":true,"security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpRequest"}}}},"responses":{"410":{"description":"Direct top-ups are disabled; use `/v1/billing/top-up/prepare`.","content":{"application/json":{"schema":{},"example":{"detail":{"error":"direct_top_up_disabled","message":"Direct top-ups cannot verify payment settlement. Create a Stripe PaymentIntent; credits are minted only after its verified webhook.","prepare_url":"/v1/billing/top-up/prepare"}}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/top-up/prepare":{"post":{"tags":["Agent Financial Gateways"],"summary":"Prepare a fiat top-up via Stripe","description":"Create a Stripe PaymentIntent for fiat payment. After payment succeeds, credits are minted automatically via webhook. Requires KYC verification if enabled for the wallet.","operationId":"prepare_top_up_v1_billing_top_up_prepare_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"query","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"amount_fiat","in":"query","required":true,"schema":{"type":"number","exclusiveMinimum":0,"description":"Amount in fiat currency (USD)","title":"Amount Fiat"},"description":"Amount in fiat currency (USD)"},{"name":"currency","in":"query","required":false,"schema":{"type":"string","description":"Fiat currency code","default":"USD","title":"Currency"},"description":"Fiat currency code"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/transfer":{"post":{"tags":["Agent Financial Gateways"],"summary":"Transfer credits between wallets","description":"Transfer credits from one wallet to another (agent-to-agent handoff).","operationId":"transfer_wallets_v1_billing_transfer_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"from_wallet_id","in":"query","required":true,"schema":{"type":"string","description":"Source wallet ID","title":"From Wallet Id"},"description":"Source wallet ID"},{"name":"to_wallet_id","in":"query","required":true,"schema":{"type":"string","description":"Destination wallet ID","title":"To Wallet Id"},"description":"Destination wallet ID"},{"name":"amount","in":"query","required":true,"schema":{"type":"number","exclusiveMinimum":0,"description":"Amount of credits to transfer","title":"Amount"},"description":"Amount of credits to transfer"},{"name":"description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional transfer description","title":"Description"},"description":"Optional transfer description"},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional ID to link related transfers","title":"Correlation Id"},"description":"Optional ID to link related transfers"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"403":{"description":"Source wallet expired or wallet access denied"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/pricing":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get pricing table","operationId":"get_pricing_v1_billing_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingTableResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/billing/arbitrage":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get arbitrage report","operationId":"get_arbitrage_report_v1_billing_arbitrage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArbitrageReport"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/billing/alerts":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get billing alerts","operationId":"get_alerts_v1_billing_alerts_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertListResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/services":{"post":{"tags":["Agent Financial Gateways"],"summary":"Register a billable service","description":"Register a new service in the marketplace that agents can discover and pay for.","operationId":"register_service_v1_billing_services_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterServiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRegistration"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Agent Financial Gateways"],"summary":"List available services","description":"List all registered billable services in the marketplace.","operationId":"list_services_v1_billing_services_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}],"title":"Category"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return active services","default":true,"title":"Active Only"},"description":"Only return active services"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/wallets/{wallet_id}/velocity":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get spend velocity status","description":"Get current spend velocity metrics for a wallet.","operationId":"get_velocity_status_v1_billing_wallets__wallet_id__velocity_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/dry-run/session":{"post":{"tags":["Agent Financial Gateways"],"summary":"Start a dry-run session","description":"Create a new dry-run session for simulating billing operations. All charges simulated within this session use a virtual balance derived from the wallet's real balance minus simulated charges. Sessions expire after 15 minutes.\n\nUse this to:\n- Test if a multi-step workflow fits within your budget\n- Estimate total cost before committing to execution\n- Plan complex agent workflows safely","operationId":"create_dry_run_session_v1_billing_dry_run_session_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDryRunSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunSessionResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/dry-run/session/{session_id}":{"get":{"tags":["Agent Financial Gateways"],"summary":"Get dry-run session status","description":"Retrieve current state of a dry-run session.","operationId":"get_dry_run_session_v1_billing_dry_run_session__session_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent Financial Gateways"],"summary":"End a dry-run session","description":"End a dry-run session and get a summary of all simulated charges. This does NOT affect the real wallet - it's purely informational.","operationId":"end_dry_run_session_v1_billing_dry_run_session__session_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/dry-run/session/{session_id}/commit":{"post":{"tags":["Agent Financial Gateways"],"summary":"Commit sandbox session to billing","description":"Commit all simulated charges to real billing. This applies all sandbox charges to the wallet's real balance. Use this after reviewing the simulation results and deciding to proceed.","operationId":"commit_dry_run_session_v1_billing_dry_run_session__session_id__commit_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/dry-run/session/{session_id}/revert":{"post":{"tags":["Agent Financial Gateways"],"summary":"Revert sandbox session","description":"Revert a sandbox session and discard all simulated charges. No changes are made to the real wallet. This is useful when the simulation shows the operation would fail or you're not ready to proceed.","operationId":"revert_dry_run_session_v1_billing_dry_run_session__session_id__revert_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/dry-run/charge":{"post":{"tags":["Agent Financial Gateways"],"summary":"Simulate a charge","description":"Simulate a charge without affecting real balance or triggering velocity monitoring. Returns cost estimate and virtual balance impact.\n\nOptions:\n- Use session_id for multi-step simulation (tracks cumulative cost)\n- Omit session_id for single-shot estimation","operationId":"simulate_charge_v1_billing_dry_run_charge_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedChargeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedChargeResponse"}}}},"401":{"description":"Missing API key"},"402":{"description":"Insufficient funds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientFundsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permits":{"get":{"tags":["Trust Permits"],"summary":"List Permits","operationId":"list_permits_v1_permits_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"subject_key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Key Id"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"expires_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires After"}},{"name":"expires_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Trust Permits"],"summary":"Create Permit","operationId":"create_permit_v1_permits_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permits/{permit_id}":{"get":{"tags":["Trust Permits"],"summary":"Get Permit","operationId":"get_permit_v1_permits__permit_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permits/{permit_id}/receipts":{"get":{"tags":["Trust Permits"],"summary":"List Permit Receipts","operationId":"list_permit_receipts_v1_permits__permit_id__receipts_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permits/{permit_id}/revoke":{"post":{"tags":["Trust Permits"],"summary":"Revoke Permit","operationId":"revoke_permit_v1_permits__permit_id__revoke_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/permits/verify":{"post":{"tags":["Trust Permits"],"summary":"Verify Permit","operationId":"verify_permit_v1_permits_verify_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts":{"get":{"tags":["Trust Receipts"],"summary":"List Receipts","operationId":"list_receipts_v1_receipts_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Permit Id"}},{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/permit/{permit_id}":{"get":{"tags":["Trust Receipts"],"summary":"List Receipts For Permit","operationId":"list_receipts_for_permit_v1_receipts_permit__permit_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"path","required":true,"schema":{"type":"string","title":"Permit Id"}},{"name":"wallet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/reconciliation/refunds":{"get":{"tags":["Trust Receipts"],"summary":"List Refund Reconciliations","operationId":"list_refund_reconciliations_v1_receipts_reconciliation_refunds_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","resolved"],"type":"string"},{"type":"null"}],"default":"pending","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundReconciliationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/reconciliation/refunds/{receipt_id}/retry":{"post":{"tags":["Trust Receipts"],"summary":"Retry Refund Reconciliation","operationId":"retry_refund_reconciliation_v1_receipts_reconciliation_refunds__receipt_id__retry_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundReconciliationRetryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/{receipt_id}":{"get":{"tags":["Trust Receipts"],"summary":"Get Receipt","operationId":"get_receipt_v1_receipts__receipt_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/{receipt_id}/evidence":{"get":{"tags":["Trust Receipts"],"summary":"Get Receipt Evidence","operationId":"get_receipt_evidence_v1_receipts__receipt_id__evidence_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptEvidenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/receipts/verify":{"post":{"tags":["Trust Receipts"],"summary":"Verify Receipt","operationId":"verify_receipt_v1_receipts_verify_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/evidence/{receipt_id}":{"get":{"tags":["Trust / Evidence"],"summary":"Buyer-facing trust evidence bundle","description":"Returns the single, verifiable artifact for a receipt: the signed receipt, its permit, the linked ledger entry and audit event, and a `verification` map (receipt signature, permit signature, audit chain, request hash). This is the artifact a buyer can hand to an auditor.","operationId":"get_evidence_bundle_v1_evidence__receipt_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceBundleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/launch/preflight":{"post":{"tags":["Preflight"],"summary":"Pre-flight Readiness Check","description":"Runs a comprehensive validation sweep before production launch:\n\n1. **KEYS** — Reject test-key/placeholder API keys, validate Stripe tokens\n2. **DOMAIN** — Verify BASE_URL is a real domain, manifests will resolve\n3. **ORACLE** — Validate agent directory registration URLs\n4. **ASSETS** — Check content source URLs and crawl targets\n\nReturns a GO/NO-GO verdict with per-check details.","operationId":"run_preflight_v1_launch_preflight_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightRequest","default":{"base_url":"","stripe_secret_key":"","campaign_source_url":""}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/webhooks/stripe":{"post":{"tags":["Webhooks"],"summary":"Handle Stripe Webhook","description":"Receive and process Stripe webhook events.\n\nStripe will retry this endpoint if we return non-200.\nOur service layer handles idempotency internally via\nUNIQUE constraint on payment_intent_id + IntegrityError catch.\n\nEvents handled:\n- payment_intent.succeeded → Mint credits to wallet\n- payment_intent.payment_failed → Log and notify\n- charge.refunded → Debit wallet\n- identity.verification_session.verified → Approve KYC\n- identity.verification_session.requires_input → Log\n- identity.verification_session.redacted → Expire verification","operationId":"handle_stripe_webhook_v1_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/webhooks/stripe/identity":{"post":{"tags":["Webhooks"],"summary":"Handle Stripe Identity Webhook","description":"Receive and process Stripe Identity webhook events.\n\nThese events are for KYC verification status updates.\nNote: Stripe often sends these to the same /webhooks/stripe endpoint,\nbut we handle them separately here for clarity.","operationId":"handle_stripe_identity_webhook_v1_webhooks_stripe_identity_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/tools.json":{"get":{"tags":["MCP"],"summary":"Mcp Tools Manifest","description":"Return the MCP tools.json manifest.\n\nThis is an unauthenticated HTTP mirror of tool metadata exposed by this\nproject's governed JSON-RPC subset. Clients can obtain the same list by\nsending ``tools/list`` to ``/mcp/messages``; that endpoint does not\nimplement the complete MCP initialization lifecycle.\n\nQuery Parameters:\n    category: Optional service category filter\n\nReturns:\n    MCP tools.json manifest with tool definitions","operationId":"MCP_Tools_Manifest_mcp_tools_json_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/messages":{"post":{"tags":["MCP"],"summary":"Mcp Json-Rpc Messages","description":"Handle MCP JSON-RPC messages.\n\nSupports:\n- tools/list: List available tools\n- tools/call: Execute a tool\n\nThe request body is a JSON-RPC 2.0 request.","operationId":"MCP_JSON_RPC_Messages_mcp_messages_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/tools/{service_id}/invoke":{"post":{"tags":["MCP"],"summary":"Invoke a registered MCP tool","description":"Invoke an MCP-enabled service.\n\nThis endpoint verifies the API key, applies the governed billing path, and\nexecutes either a registered local callable or the single configured\nupstream MCP tool. Metadata-only database service registrations are not\nexecutable through MCP.","operationId":"Invoke_MCP_Tool_mcp_tools__service_id__invoke_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"service_id","in":"path","required":true,"schema":{"type":"string","title":"Service Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/tools":{"get":{"tags":["MCP"],"summary":"List all available MCP tools (paginated)","description":"List all available MCP-enabled services with pagination.\n\nQuery Parameters:\n    category: Optional service category filter\n    limit: Maximum number of tools to return (default 100, max 500)\n    offset: Number of tools to skip for pagination\n\nReturns:\n    Paginated list of tool definitions with schemas","operationId":"List_MCP_Tools_mcp_tools_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}],"title":"Category"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max tools to return","default":100,"title":"Limit"},"description":"Max tools to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of tools to skip","default":0,"title":"Offset"},"description":"Number of tools to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Mcp Tools Mcp Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/tools/{service_id}":{"get":{"tags":["MCP"],"summary":"Get a specific MCP tool definition","description":"Get the MCP tool definition for a specific service.\n\nReturns the full tool schema including:\n- inputSchema\n- output schema availability metadata\n- pricing and category annotations","operationId":"Get_MCP_Tool_mcp_tools__service_id__get","parameters":[{"name":"service_id","in":"path","required":true,"schema":{"type":"string","title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Mcp Tool Mcp Tools  Service Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kyc/sessions":{"post":{"tags":["KYC Verification"],"summary":"Create KYC verification session","description":"Create a Stripe Identity verification session for a sponsor wallet. This returns a URL that the user should be redirected to for completing identity verification. After verification, the wallet's kyc_status will be updated via webhook.\n\nOnly sponsor wallets require KYC. Agent and child wallets inherit trust.","operationId":"create_kyc_session_v1_kyc_sessions_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKYCSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KYCSessionResponse"}}}},"401":{"description":"Missing API key"},"403":{"description":"KYC verification required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kyc/status/{wallet_id}":{"get":{"tags":["KYC Verification"],"summary":"Get KYC status for a wallet","description":"Get the current KYC verification status for a wallet.","operationId":"get_kyc_status_v1_kyc_status__wallet_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KYCStatusResponse"}}}},"401":{"description":"Missing API key"},"403":{"description":"KYC verification required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/kyc/verifications/{verification_id}":{"get":{"tags":["KYC Verification"],"summary":"Get verification details","description":"Get detailed information about a specific verification.","operationId":"get_verification_details_v1_kyc_verifications__verification_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"verification_id","in":"path","required":true,"schema":{"type":"string","title":"Verification Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KYCVerificationDetails"}}}},"401":{"description":"Missing API key"},"403":{"description":"KYC verification required"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys":{"post":{"tags":["API Key Management"],"summary":"Create a new API key","description":"Create a new API key for a wallet. The key is only shown once - store it securely.","operationId":"create_api_key_v1_api_keys_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyWithSecret"}}}},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{wallet_id}":{"get":{"tags":["API Key Management"],"summary":"List API keys for a wallet","description":"Get all API keys for a wallet. Keys are masked for security.","operationId":"list_api_keys_v1_api_keys__wallet_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyListResponse"}}}},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/rotate":{"post":{"tags":["API Key Management"],"summary":"Rotate an API key","description":"Rotate an API key by creating a new one and optionally revoking the old one. Returns the new key which is only shown once.","operationId":"rotate_api_key_v1_api_keys_rotate_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateAPIKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotationResponse"}}}},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{wallet_id}/{key_id}":{"delete":{"tags":["API Key Management"],"summary":"Revoke an API key","description":"Immediately revoke an API key. This action cannot be undone.","operationId":"revoke_api_key_v1_api_keys__wallet_id___key_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"reason","in":"query","required":false,"schema":{"type":"string","default":"user_request","title":"Reason"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/emergency-revoke":{"post":{"tags":["API Key Management"],"summary":"Emergency key revocation","description":"Immediately revoke ALL API keys for a wallet. Use for security incidents.","operationId":"emergency_revoke_v1_api_keys_emergency_revoke_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyKeyRevocationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{wallet_id}/logs":{"get":{"tags":["API Key Management"],"summary":"Get rotation audit logs","description":"Get audit logs for API key rotations on a wallet.","operationId":"get_rotation_logs_v1_api_keys__wallet_id__logs_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"wallet_id","in":"path","required":true,"schema":{"type":"string","title":"Wallet Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeyRotationLogEntry"},"title":"Response Get Rotation Logs V1 Api Keys  Wallet Id  Logs Get"}}}},"401":{"description":"Missing API key"},"403":{"description":"Insufficient permissions"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/signing-keys/active":{"get":{"tags":["Trust Signing Keys"],"summary":"Get Active Signing Key","description":"Return public metadata for the active trust-plane signing key.","operationId":"get_active_signing_key_v1_signing_keys_active_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningKeyMetadataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/signing-keys/{key_id}":{"get":{"tags":["Trust Signing Keys"],"summary":"Get Signing Key","description":"Return public metadata for an active or retired signing key.","operationId":"get_signing_key_v1_signing_keys__key_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningKeyMetadataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/alerts":{"get":{"tags":["Agent Self Inspection"],"summary":"List My Alerts","operationId":"list_my_alerts_v1_me_alerts_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/permits":{"get":{"tags":["Agent Self Inspection"],"summary":"List My Permits","operationId":"list_my_permits_v1_me_permits_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"expires_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires After"}},{"name":"expires_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermitListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/receipts":{"get":{"tags":["Agent Self Inspection"],"summary":"List My Receipts","operationId":"list_my_receipts_v1_me_receipts_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"permit_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Permit Id"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/audit/events":{"get":{"tags":["Agent Self Inspection"],"summary":"List My Audit Events","operationId":"list_my_audit_events_v1_me_audit_events_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"}},{"name":"policy_decision_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Decision Id"}},{"name":"request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},{"name":"ok","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ok"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/discover":{"get":{"tags":["Agent Discovery"],"summary":"Agent Discovery Manifest","description":"Aggregated capability index: services, MCP tools, AWI endpoints, and pricing. Bootstrap order is defined in `/.well-known/agent.json` under `agent_first.bootstrap_sequence` (this endpoint is optional after those hints).","operationId":"get_discovery_manifest_v1_discover_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryManifest"}}}}}}},"/v1/discover/tools":{"get":{"tags":["Agent Discovery"],"summary":"List Available MCP Tools","description":"Returns all available MCP tools with their schemas and pricing.","operationId":"list_mcp_tools_v1_discover_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/discover/awi":{"get":{"tags":["Agent Discovery"],"summary":"List AWI Endpoints","description":"Returns all Agentic Web Interface endpoints and the action vocabulary.","operationId":"list_awi_endpoints_v1_discover_awi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/planner/optimize":{"post":{"tags":["optimizer"],"summary":"Optimize Endpoint","operationId":"optimize_endpoint_v1_planner_optimize_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/agent.json":{"get":{"tags":["Agent Discovery"],"summary":"Agent Discovery Manifest","description":"Returns this project's agent bootstrap manifest for discovery clients. It is not an A2A Agent Card. Product capabilities are the MCP trust plane; proof_surfaces are labeled demo/workload scaffolding.","operationId":"get_agent_json__well_known_agent_json_get","responses":{"200":{"description":"Project agent bootstrap manifest","content":{"application/json":{"schema":{}}}}}}},"/.well-known/awi.json":{"get":{"tags":["Agent Discovery"],"summary":"AWI Discovery Manifest","description":"Returns the draft AWI-over-MCP manifest with action vocabulary, representation types, endpoints, safety capabilities, and known limits. Marked as a proof surface — not the product wedge.","operationId":"get_awi_json__well_known_awi_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AWIDiscoveryManifest"}}}}}}},"/.well-known/mcp/tools.json":{"get":{"tags":["Agent Discovery"],"summary":"MCP Tools Manifest","description":"Compatibility mirror of the project's public MCP-shaped tool list.","operationId":"get_mcp_tools_json__well_known_mcp_tools_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llm.txt":{"get":{"tags":["Static"],"summary":"Legacy LLM-Readable Instructions Alias","description":"Backward-compatible singular alias for /llms.txt; both routes serve identical plain-text instructions.","operationId":"get_llm_txt_llm_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms.txt":{"get":{"tags":["Static"],"summary":"LLM-Readable Instructions","description":"Plain-text instructions at the plural llms.txt proposal path. The legacy /llm.txt route serves identical content.","operationId":"get_llm_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/WEDGE.md":{"get":{"tags":["Static"],"summary":"Product wedge","description":"Exactly-once MCP permits wedge definition.","operationId":"get_wedge_md_WEDGE_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/SECURITY_LIMITATIONS.md":{"get":{"tags":["Static"],"summary":"Security limitations","description":"Honest non-claims and production posture requirements.","operationId":"get_security_limitations_md_SECURITY_LIMITATIONS_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/DESIGN_PARTNER_GUIDE.md":{"get":{"tags":["Static"],"summary":"Design partner guide","description":"Trust-plane demo and dogfood path for design partners.","operationId":"get_design_partner_guide_md_DESIGN_PARTNER_GUIDE_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/docs/partner-api-key-bootstrap.md":{"get":{"tags":["Static"],"summary":"Partner API key bootstrap","description":"Gated operator flow to provision wallet-scoped agent API keys.","operationId":"get_partner_api_key_bootstrap_md_docs_partner_api_key_bootstrap_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/dashboard":{"get":{"tags":["Static"],"summary":"Human Control Deck","description":"Human-accessible control plane, audit visualizer, and telemetry dashboard.","operationId":"get_human_dashboard_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Dashboard not found"}}}},"/docs/index":{"get":{"tags":["Documentation & Discovery"],"summary":"Structured documentation index","description":"Returns a JSON index of documentation resources. Trust-plane sections always; proof-surface service entries only when mounted.","operationId":"get_doc_index_docs_index_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["Discovery"],"summary":"API root — service index & human dashboard negotiation","description":"Returns a broad service catalog for API callers or HTML dashboard for browsers. For agent-first bootstrap, follow `GET /.well-known/agent.json` → field `agent_first`.","operationId":"root__get","responses":{"200":{"description":"JSON service index or HTML control deck","content":{"application/json":{"schema":{}},"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"tags":["Discovery"],"summary":"Liveness check","description":"Returns 200 if the API is running. Use for Kubernetes livenessProbe.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"tags":["Discovery"],"summary":"Readiness check","description":"Returns 200 if all dependencies are ready. Use for Kubernetes readinessProbe.","operationId":"health_ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/dependencies":{"get":{"tags":["Discovery"],"summary":"Dependency health check","description":"Probes every external dependency (PostgreSQL, Redis, MQTT broker, Stripe, LLM provider, signing key) in parallel with a short timeout. Each entry reports status, latency_ms, and an error message when unreachable. Deps whose consumers are in simulation mode return `not_used` so the health verdict doesn't degrade on mock-only deployments.","operationId":"health_dependencies_health_dependencies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"APIKeyListResponse":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"keys":{"items":{"$ref":"#/components/schemas/APIKeyResponse"},"type":"array","title":"Keys"},"total_active":{"type":"integer","title":"Total Active"},"total_revoked":{"type":"integer","title":"Total Revoked"}},"type":"object","required":["wallet_id","keys","total_active","total_revoked"],"title":"APIKeyListResponse","description":"List of API keys for a wallet."},"APIKeyResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"masked_key":{"type":"string","title":"Masked Key"},"status":{"$ref":"#/components/schemas/APIKeyStatus"},"key_name":{"type":"string","title":"Key Name","default":"default"},"rotation_count":{"type":"integer","title":"Rotation Count","default":0},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["key_id","wallet_id","key_prefix","masked_key","status","created_at"],"title":"APIKeyResponse","description":"API key response with masked key for display."},"APIKeyStatus":{"type":"string","enum":["active","revoked","expired","suspended"],"title":"APIKeyStatus"},"APIKeyWithSecret":{"properties":{"key_id":{"type":"string","title":"Key Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"api_key":{"type":"string","title":"Api Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"status":{"$ref":"#/components/schemas/APIKeyStatus"},"key_name":{"type":"string","title":"Key Name","default":"default"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"warning":{"type":"string","title":"Warning","default":"Store this key securely. It will not be shown again."}},"type":"object","required":["key_id","wallet_id","api_key","key_prefix","status","created_at"],"title":"APIKeyWithSecret","description":"API key response including the actual key (only shown once)."},"AWIActionCategory":{"type":"string","enum":["navigation","search","interaction","extraction","transaction","auth"],"title":"AWIActionCategory","description":"Categories of standardized AWI actions."},"AWIActionDefinitionResponse":{"properties":{"action":{"$ref":"#/components/schemas/AWIStandardAction"},"category":{"$ref":"#/components/schemas/AWIActionCategory"},"description":{"type":"string","title":"Description"},"parameters":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Parameters"},"required_preconditions":{"items":{"type":"string"},"type":"array","title":"Required Preconditions"},"postconditions":{"items":{"type":"string"},"type":"array","title":"Postconditions"},"estimated_cost":{"type":"number","title":"Estimated Cost"},"tier":{"$ref":"#/components/schemas/AWIActionTier"},"status":{"$ref":"#/components/schemas/AWIActionStatus"},"risk_level":{"$ref":"#/components/schemas/AWIActionRiskLevel"},"sensitive_parameters":{"items":{"type":"string"},"type":"array","title":"Sensitive Parameters"}},"type":"object","required":["action","category","description","parameters","required_preconditions","postconditions","estimated_cost","tier","status","risk_level"],"title":"AWIActionDefinitionResponse","description":"Public action vocabulary entry exposed by AWI discovery surfaces."},"AWIActionRiskLevel":{"type":"string","enum":["low","medium","high"],"title":"AWIActionRiskLevel","description":"Risk level for policy and human-approval decisions."},"AWIActionStatus":{"type":"string","enum":["stable","provisional","deprecated"],"title":"AWIActionStatus","description":"Maturity status for AWI action contracts."},"AWIActionTier":{"type":"string","enum":["semantic","compatibility"],"title":"AWIActionTier","description":"How directly an action expresses AWI semantic intent."},"AWIDiscoveryManifest":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"awi_version":{"type":"string","title":"Awi Version"},"status":{"type":"string","title":"Status"},"profile":{"type":"string","title":"Profile"},"surface":{"type":"string","title":"Surface","description":"Discovery honesty label. AWI HTTP routes are proof-surface scaffolding unless invoked through governed MCP.","default":"proof_surface"},"transport":{"$ref":"#/components/schemas/AWIManifestTransport"},"description":{"type":"string","title":"Description"},"endpoints":{"additionalProperties":{"type":"string"},"type":"object","title":"Endpoints"},"representation_types":{"items":{"$ref":"#/components/schemas/AWIRepresentationType"},"type":"array","title":"Representation Types"},"actions":{"items":{"$ref":"#/components/schemas/AWIActionDefinitionResponse"},"type":"array","title":"Actions"},"safety_capabilities":{"$ref":"#/components/schemas/AWIManifestSafetyCapabilities"},"known_limitations":{"items":{"type":"string"},"type":"array","title":"Known Limitations"}},"type":"object","required":["schema_version","awi_version","status","profile","transport","description","endpoints","representation_types","actions","safety_capabilities","known_limitations"],"title":"AWIDiscoveryManifest","description":"Draft AWI-over-MCP discovery manifest."},"AWIEndpoint":{"properties":{"path":{"type":"string","title":"Path"},"method":{"type":"string","title":"Method"},"description":{"type":"string","title":"Description"},"action_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Type"}},"type":"object","required":["path","method","description"],"title":"AWIEndpoint"},"AWIManifestSafetyCapabilities":{"properties":{"wallet_scoped_authorization":{"type":"boolean","title":"Wallet Scoped Authorization"},"human_intervention":{"items":{"type":"string"},"type":"array","title":"Human Intervention"},"passkey_high_risk_actions":{"type":"boolean","title":"Passkey High Risk Actions"},"signed_permits":{"type":"boolean","title":"Signed Permits"},"tamper_evident_audit_chain":{"type":"boolean","title":"Tamper Evident Audit Chain"},"sensitive_parameter_redaction":{"type":"boolean","title":"Sensitive Parameter Redaction"}},"type":"object","required":["wallet_scoped_authorization","human_intervention","passkey_high_risk_actions","signed_permits","tamper_evident_audit_chain","sensitive_parameter_redaction"],"title":"AWIManifestSafetyCapabilities","description":"Safety capabilities advertised by the AWI discovery manifest."},"AWIManifestTransport":{"properties":{"primary":{"type":"string","title":"Primary"},"mcp_compatible":{"type":"boolean","title":"Mcp Compatible"},"mcp_manifest":{"type":"string","title":"Mcp Manifest"}},"type":"object","required":["primary","mcp_compatible","mcp_manifest"],"title":"AWIManifestTransport","description":"Transport metadata for the AWI discovery manifest."},"AWIRepresentationType":{"type":"string","enum":["full_dom","summary","embedding","low_res_screenshot","accessibility_tree","json_structure","text_extraction"],"title":"AWIRepresentationType","description":"Types of progressive representations an agent can request."},"AWIStandardAction":{"type":"string","enum":["search_and_sort","add_to_cart","checkout","fill_form","login","logout","navigate_to","click_button","scroll","select_option","upload_file","extract_data","get_representation"],"title":"AWIStandardAction","description":"Standardized higher-level actions (from paper's unified action vocabulary)."},"AlertListResponse":{"properties":{"alerts":{"items":{"$ref":"#/components/schemas/BillingAlert"},"type":"array","title":"Alerts"},"total":{"type":"integer","title":"Total"},"unacknowledged":{"type":"integer","title":"Unacknowledged"}},"type":"object","required":["alerts","total","unacknowledged"],"title":"AlertListResponse"},"AlertSeverity":{"type":"string","enum":["info","warning","error","critical"],"title":"AlertSeverity"},"AlertType":{"type":"string","enum":["low_balance","insufficient_funds","budget_exceeded","anomalous_spend","kyc_pending","kyc_rejected","suspicious_activity"],"title":"AlertType"},"ArbitrageReport":{"properties":{"period":{"type":"string","title":"Period"},"total_revenue":{"type":"number","title":"Total Revenue"},"total_revenue_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Revenue Exact"},"total_compute_cost":{"type":"number","title":"Total Compute Cost"},"total_compute_cost_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Compute Cost Exact"},"gross_margin":{"type":"number","title":"Gross Margin"},"gross_margin_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gross Margin Exact"},"margin_percentage":{"type":"number","title":"Margin Percentage"},"margin_percentage_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Margin Percentage Exact"},"by_service":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"By Service"},"top_profitable_actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Profitable Actions"}},"type":"object","required":["period","total_revenue","total_compute_cost","gross_margin","margin_percentage"],"title":"ArbitrageReport","description":"Swarm arbitrage profitability report."},"AuditChainVerifyRequest":{"properties":{"wallet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"},"created_after":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"},"created_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},"type":"object","title":"AuditChainVerifyRequest"},"AuditChainVerifyResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"checked_events":{"type":"integer","title":"Checked Events"},"first_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Event Id"},"last_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event Id"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"broken_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broken Event Id"}},"type":"object","required":["valid","checked_events"],"title":"AuditChainVerifyResponse"},"AuditEventListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AuditEventResponse"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit","default":50},"offset":{"type":"integer","title":"Offset","default":0},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["events","total"],"title":"AuditEventListResponse"},"AuditEventResponse":{"properties":{"event_id":{"type":"string","title":"Event Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"event":{"type":"string","title":"Event"},"wallet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"auth_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Source"},"key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"},"policy_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Decision Id"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"ok":{"type":"boolean","title":"Ok"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"payload_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payload Hash"},"previous_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Hash"},"chain_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chain Hash"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"},"signature_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature Key Id"}},"type":"object","required":["event_id","created_at","event","wallet_id","tool","endpoint","auth_source","key_id","policy_decision_id","request_id","ok","error","metadata"],"title":"AuditEventResponse"},"AuditSummaryResponse":{"properties":{"total":{"type":"integer","title":"Total"},"by_event":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Event"},"by_outcome":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Outcome"},"by_wallet":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Wallet"},"by_policy_reason":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Policy Reason"}},"type":"object","required":["total","by_event","by_outcome","by_wallet","by_policy_reason"],"title":"AuditSummaryResponse"},"BillingAlert":{"properties":{"alert_id":{"type":"string","title":"Alert Id"},"alert_type":{"$ref":"#/components/schemas/AlertType"},"wallet_id":{"type":"string","title":"Wallet Id"},"message":{"type":"string","title":"Message"},"threshold_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Amount"},"threshold_amount_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threshold Amount Exact"},"current_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Balance"},"current_balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Balance Exact"},"severity":{"$ref":"#/components/schemas/AlertSeverity","default":"info"},"acknowledged":{"type":"boolean","title":"Acknowledged","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["alert_id","alert_type","wallet_id","message","created_at"],"title":"BillingAlert","description":"Billing alert for sponsors or agents."},"ChildWalletResponse":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"wallet_type":{"$ref":"#/components/schemas/WalletType"},"parent_wallet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Wallet Id"},"child_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Child Agent Id"},"balance":{"type":"number","title":"Balance"},"balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Exact"},"max_spend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Spend"},"max_spend_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Spend Exact"},"spent":{"type":"number","title":"Spent","default":0.0},"spent_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spent Exact"},"task_description":{"type":"string","title":"Task Description","default":""},"ttl_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ttl Seconds"},"auto_reclaim":{"type":"boolean","title":"Auto Reclaim","default":true},"status":{"$ref":"#/components/schemas/WalletStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["wallet_id","wallet_type","balance","status","created_at"],"title":"ChildWalletResponse","description":"Child wallet details with parent lineage."},"CreateAPIKeyRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet ID to create key for."},"key_name":{"type":"string","maxLength":50,"title":"Key Name","description":"Human-readable name for this key.","default":"default"},"expires_in_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Expires In Days","description":"Optional expiration in days. None = no expiration."},"max_uses":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Uses","description":"Optional max uses. None = unlimited."}},"type":"object","required":["wallet_id"],"title":"CreateAPIKeyRequest","description":"Request to create a new API key for a wallet."},"CreateAgentWalletRequest":{"properties":{"sponsor_wallet_id":{"type":"string","title":"Sponsor Wallet Id","description":"ID of the sponsor wallet funding this agent."},"agent_id":{"type":"string","title":"Agent Id","description":"Agent ID from the comms registry."},"budget_credits":{"type":"number","exclusiveMinimum":0.0,"title":"Budget Credits","description":"Credits to provision from the sponsor's balance."},"daily_limit":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Daily Limit","description":"Optional daily spend cap."},"auto_refill":{"type":"boolean","title":"Auto Refill","description":"Auto-refill from sponsor when balance drops below threshold.","default":false},"auto_refill_threshold":{"type":"number","minimum":0.0,"title":"Auto Refill Threshold","description":"Refill trigger threshold.","default":100.0},"auto_refill_amount":{"type":"number","minimum":0.0,"title":"Auto Refill Amount","description":"Amount to refill.","default":1000.0}},"type":"object","required":["sponsor_wallet_id","agent_id","budget_credits"],"title":"CreateAgentWalletRequest","description":"Provision a pre-paid agent wallet under a sponsor."},"CreateChildWalletRequest":{"properties":{"parent_wallet_id":{"type":"string","title":"Parent Wallet Id","description":"ID of the parent agent wallet funding this child."},"child_agent_id":{"type":"string","title":"Child Agent Id","description":"Identifier for the child sub-agent."},"budget_credits":{"type":"number","exclusiveMinimum":0.0,"title":"Budget Credits","description":"Credits to provision from parent's balance."},"max_spend":{"type":"number","exclusiveMinimum":0.0,"title":"Max Spend","description":"Hard lifetime spend cap in credits."},"task_description":{"type":"string","title":"Task Description","description":"What this child agent is supposed to accomplish.","default":""},"ttl_seconds":{"anyOf":[{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Ttl Seconds","description":"Time-to-live in seconds."},"auto_reclaim":{"type":"boolean","title":"Auto Reclaim","description":"Reclaim unspent credits when child completes.","default":true}},"type":"object","required":["parent_wallet_id","child_agent_id","budget_credits","max_spend"],"title":"CreateChildWalletRequest","description":"Spawn a sub-agent child wallet from an agent wallet."},"CreateDryRunSessionRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet to simulate charges against"}},"type":"object","required":["wallet_id"],"title":"CreateDryRunSessionRequest","description":"Start a dry-run session for simulating billing operations."},"CreateKYCSessionRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet ID requiring KYC verification."},"return_url":{"type":"string","title":"Return Url","description":"URL to redirect after verification completes.","examples":["https://yourapp.com/kyc-callback"]},"document_type":{"type":"string","title":"Document Type","description":"Type of document to verify (passport, driver_license, id_card).","default":"document"}},"type":"object","required":["wallet_id","return_url"],"title":"CreateKYCSessionRequest","description":"Request to create a KYC verification session."},"CreateSponsorWalletRequest":{"properties":{"sponsor_name":{"type":"string","maxLength":128,"minLength":1,"title":"Sponsor Name","description":"Human or organization name for the liability sink.","examples":["Acme Corp Engineering"]},"email":{"type":"string","title":"Email","description":"Contact email for billing alerts and top-up requests.","examples":["billing@acme.com"]},"initial_credits":{"type":"number","minimum":0.0,"title":"Initial Credits","description":"Initial credit balance (in ecosystem credits).","default":0.0},"currency":{"type":"string","title":"Currency","description":"Fiat currency for external payment rails.","default":"USD"},"require_kyc":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Kyc","description":"Require KYC verification before allowing fiat top-ups. Defaults to system setting."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Arbitrary metadata (Stripe customer ID, org info, etc.)."}},"type":"object","required":["sponsor_name","email"],"title":"CreateSponsorWalletRequest","description":"Create a human sponsor (liability sink) root account."},"DiscoveryManifest":{"properties":{"name":{"type":"string","title":"Name","description":"Service name"},"version":{"type":"string","title":"Version","description":"API version"},"description":{"type":"string","title":"Description","description":"What this service provides"},"capabilities":{"items":{"$ref":"#/components/schemas/ServiceCapability"},"type":"array","title":"Capabilities","description":"List of service capabilities"},"mcp_tools":{"items":{"$ref":"#/components/schemas/MCPToolInfo"},"type":"array","title":"Mcp Tools","description":"Available MCP tools"},"awi_endpoints":{"items":{"$ref":"#/components/schemas/AWIEndpoint"},"type":"array","title":"Awi Endpoints","description":"AWI (Agentic Web Interface) endpoints"},"pricing":{"items":{"$ref":"#/components/schemas/PricingTier"},"type":"array","title":"Pricing","description":"Pricing tiers"},"authentication":{"additionalProperties":true,"type":"object","title":"Authentication"},"rate_limits":{"additionalProperties":true,"type":"object","title":"Rate Limits"},"documentation":{"additionalProperties":true,"type":"object","title":"Documentation"},"integration_guides":{"additionalProperties":true,"type":"object","title":"Integration Guides","description":"Integration entry points; proof-surface guides only when mounted."},"agent_first":{"additionalProperties":true,"type":"object","title":"Agent First","description":"Same metadata as /.well-known/agent.json agent_first: bootstrap order and where to read simulation vs real state."}},"type":"object","required":["name","version","description"],"title":"DiscoveryManifest"},"DispatchEvidenceResponse":{"properties":{"attempt_id":{"type":"string","title":"Attempt Id"},"state":{"type":"string","title":"State"},"public_tool_id":{"type":"string","title":"Public Tool Id"},"upstream_tool_name":{"type":"string","title":"Upstream Tool Name"},"upstream_origin":{"type":"string","title":"Upstream Origin"},"request_hash":{"type":"string","title":"Request Hash"},"response_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Hash"},"ledger_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Entry Id"},"credits_authorized":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits Authorized"},"credits_charged":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits Charged"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"dispatched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dispatched At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["attempt_id","state","public_tool_id","upstream_tool_name","upstream_origin","request_hash","credits_authorized","credits_charged","created_at"],"title":"DispatchEvidenceResponse","description":"Sanitized upstream-dispatch evidence; result payloads and secrets stay private."},"DryRunSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"real_balance":{"type":"number","title":"Real Balance"},"real_balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Real Balance Exact"},"virtual_balance":{"type":"number","title":"Virtual Balance"},"virtual_balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Virtual Balance Exact"},"created_at":{"type":"string","title":"Created At"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds","default":900}},"type":"object","required":["session_id","wallet_id","real_balance","virtual_balance","created_at"],"title":"DryRunSessionResponse","description":"Response when creating a dry-run session."},"EmergencyKeyRevocationRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet ID to revoke keys for."},"reason":{"type":"string","maxLength":255,"title":"Reason","description":"Reason for emergency revocation.","default":"security_incident"},"create_new_key":{"type":"boolean","title":"Create New Key","description":"Whether to create a new emergency key.","default":true}},"type":"object","required":["wallet_id"],"title":"EmergencyKeyRevocationRequest","description":"Request to immediately revoke all keys for a wallet."},"EvidenceBundleResponse":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"valid":{"type":"boolean","title":"Valid"},"receipt":{"$ref":"#/components/schemas/ReceiptResponse"},"permit":{"anyOf":[{"$ref":"#/components/schemas/PermitResponse"},{"type":"null"}]},"ledger_entry":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ledger Entry"},"audit_event":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Audit Event"},"dispatch":{"anyOf":[{"$ref":"#/components/schemas/DispatchEvidenceResponse"},{"type":"null"}]},"verification":{"additionalProperties":{"type":"string"},"type":"object","title":"Verification"}},"type":"object","required":["receipt_id","valid","receipt"],"title":"EvidenceBundleResponse","description":"Flat, buyer-facing trust artifact for a single receipt."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InsufficientFundsResponse":{"properties":{"error":{"type":"string","title":"Error","default":"insufficient_funds"},"wallet_id":{"type":"string","title":"Wallet Id"},"current_balance":{"type":"number","title":"Current Balance"},"current_balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Balance Exact"},"required_amount":{"type":"number","title":"Required Amount"},"required_amount_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Required Amount Exact"},"shortfall":{"type":"number","title":"Shortfall"},"shortfall_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortfall Exact"},"top_up_url":{"type":"string","title":"Top Up Url"},"message":{"type":"string","title":"Message","default":"Wallet balance insufficient."}},"type":"object","required":["wallet_id","current_balance","required_amount","shortfall","top_up_url"],"title":"InsufficientFundsResponse","description":"Structured 402 Payment Required response."},"KYCSessionResponse":{"properties":{"verification_id":{"type":"string","title":"Verification Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"session_id":{"type":"string","title":"Session Id"},"session_url":{"type":"string","title":"Session Url"},"status":{"$ref":"#/components/schemas/KYCStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["verification_id","wallet_id","session_id","session_url","status","created_at","expires_at"],"title":"KYCSessionResponse","description":"Response with Stripe Identity session details."},"KYCStatus":{"type":"string","enum":["not_required","pending","verified","rejected","expired"],"title":"KYCStatus"},"KYCStatusResponse":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"kyc_status":{"$ref":"#/components/schemas/KYCStatus"},"verification_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Id"},"stripe_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Session Id"},"last_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Verified At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"requires_verification":{"type":"boolean","title":"Requires Verification","default":false},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["wallet_id","kyc_status"],"title":"KYCStatusResponse","description":"Current KYC verification status for a wallet."},"KYCVerificationDetails":{"properties":{"verification_id":{"type":"string","title":"Verification Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"status":{"$ref":"#/components/schemas/KYCStatus"},"stripe_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Session Id"},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type"},"first_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Verified At"},"last_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Verified At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["verification_id","wallet_id","status","created_at","updated_at"],"title":"KYCVerificationDetails","description":"Detailed verification information."},"KeyRotationLogEntry":{"properties":{"log_id":{"type":"string","title":"Log Id"},"key_id":{"type":"string","title":"Key Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"rotation_type":{"$ref":"#/components/schemas/RotationType"},"old_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Key Id"},"new_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Key Id"},"trigger_reason":{"type":"string","title":"Trigger Reason"},"triggered_by":{"type":"string","title":"Triggered By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["log_id","key_id","wallet_id","rotation_type","trigger_reason","triggered_by","created_at"],"title":"KeyRotationLogEntry","description":"Audit log entry for key rotation."},"LedgerAction":{"type":"string","enum":["credit","debit","transfer","refund","arbitrage_margin"],"title":"LedgerAction"},"LedgerEntry":{"properties":{"entry_id":{"type":"string","title":"Entry Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"action":{"$ref":"#/components/schemas/LedgerAction"},"amount":{"type":"number","title":"Amount","description":"Credit amount (positive=credit, negative=debit)."},"amount_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Exact","description":"Exact transaction amount as a decimal string."},"balance_after":{"type":"number","title":"Balance After","description":"Wallet balance after this transaction."},"balance_after_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance After Exact","description":"Exact post-transaction balance as a decimal string."},"service_category":{"anyOf":[{"$ref":"#/components/schemas/ServiceCategory"},{"type":"null"}]},"description":{"type":"string","title":"Description","default":""},"request_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Path"},"compute_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Compute Cost"},"compute_cost_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compute Cost Exact"},"margin":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin"},"margin_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Margin Exact"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["entry_id","wallet_id","action","amount","balance_after","timestamp"],"title":"LedgerEntry","description":"A single atomic transaction in the billing ledger."},"LedgerResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LedgerEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total"},"wallet_id":{"type":"string","title":"Wallet Id"},"period_credits":{"type":"number","title":"Period Credits"},"period_credits_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Credits Exact"},"period_debits":{"type":"number","title":"Period Debits"},"period_debits_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Debits Exact"}},"type":"object","required":["entries","total","wallet_id","period_credits","period_debits"],"title":"LedgerResponse","description":"Paginated ledger entries."},"MCPToolInfo":{"properties":{"service_id":{"type":"string","title":"Service Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"credits_per_call":{"type":"number","title":"Credits Per Call"},"unit_name":{"type":"string","title":"Unit Name"}},"type":"object","required":["service_id","name","description","category","credits_per_call","unit_name"],"title":"MCPToolInfo"},"McpContext":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet to charge for this call"},"request_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Path","description":"Optional request path for tracking"},"permit_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Permit Id","description":"Signed permit for governed calls"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key","description":"Replay key for governed calls"}},"type":"object","required":["wallet_id"],"title":"McpContext","description":"MCP execution context passed in tool calls."},"OptimizerRequest":{"properties":{"state":{"$ref":"#/components/schemas/OptimizerState"},"objective_overrides":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Objective Overrides"},"max_actions":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Actions","default":5},"require_real_effects":{"type":"boolean","title":"Require Real Effects","default":false}},"type":"object","required":["state"],"title":"OptimizerRequest"},"OptimizerResponse":{"properties":{"status":{"type":"string","enum":["Optimal","HeuristicFallback","Infeasible"],"title":"Status"},"selected_actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Selected Actions"},"rejected_actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rejected Actions"},"policy_reasons":{"additionalProperties":{"type":"string"},"type":"object","title":"Policy Reasons"},"expected_utility":{"type":"number","title":"Expected Utility"},"totals":{"additionalProperties":{"type":"number"},"type":"object","title":"Totals"},"constraint_margins":{"additionalProperties":{"type":"number"},"type":"object","title":"Constraint Margins"},"governance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Governance"}},"type":"object","required":["status","selected_actions","rejected_actions","policy_reasons","expected_utility","totals","constraint_margins"],"title":"OptimizerResponse"},"OptimizerState":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"agent_id":{"type":"string","title":"Agent Id"},"task_id":{"type":"string","title":"Task Id"},"request_id":{"type":"string","title":"Request Id"},"wallet_balance":{"type":"number","minimum":0.0,"title":"Wallet Balance"},"daily_spend_used":{"type":"number","minimum":0.0,"title":"Daily Spend Used"},"daily_limit":{"type":"number","minimum":0.0,"title":"Daily Limit"},"rate_limit_headroom":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Rate Limit Headroom"},"service_health":{"additionalProperties":{"type":"string","enum":["healthy","degraded","down"]},"type":"object","title":"Service Health"},"simulation_flags":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Simulation Flags"},"auth_scope":{"items":{"type":"string"},"type":"array","title":"Auth Scope"},"task_context":{"additionalProperties":true,"type":"object","title":"Task Context"},"remaining_budget":{"type":"number","minimum":0.0,"title":"Remaining Budget"},"slo_window_seconds":{"type":"integer","minimum":1.0,"title":"Slo Window Seconds","default":30}},"type":"object","required":["wallet_id","agent_id","task_id","request_id","wallet_balance","daily_spend_used","daily_limit","rate_limit_headroom","service_health","simulation_flags","auth_scope","task_context","remaining_budget"],"title":"OptimizerState"},"PermitCreateRequest":{"properties":{"issuer_wallet_id":{"type":"string","title":"Issuer Wallet Id"},"subject_wallet_id":{"type":"string","title":"Subject Wallet Id"},"subject_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Key Id"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"max_credits":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Max Credits"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"nonce":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nonce"},"requires_human_approval":{"type":"boolean","title":"Requires Human Approval","default":false},"max_calls_per_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"Max Calls Per Tool"},"aggregate_value_cap":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Aggregate Value Cap"},"forbidden_fields":{"items":{"type":"string"},"type":"array","title":"Forbidden Fields"},"recipient_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Domain"}},"type":"object","required":["issuer_wallet_id","subject_wallet_id","max_credits","expires_at"],"title":"PermitCreateRequest"},"PermitListResponse":{"properties":{"permits":{"items":{"$ref":"#/components/schemas/PermitResponse"},"type":"array","title":"Permits"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["permits","total","limit","offset","has_more"],"title":"PermitListResponse"},"PermitResponse":{"properties":{"permit_id":{"type":"string","title":"Permit Id"},"issuer_wallet_id":{"type":"string","title":"Issuer Wallet Id"},"subject_wallet_id":{"type":"string","title":"Subject Wallet Id"},"subject_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Key Id"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"max_credits":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Max Credits"},"spent_credits":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Spent Credits"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"nonce":{"type":"string","title":"Nonce"},"status":{"type":"string","title":"Status"},"requires_human_approval":{"type":"boolean","title":"Requires Human Approval","default":false},"signature":{"type":"string","title":"Signature"},"key_id":{"type":"string","title":"Key Id"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"max_calls_per_tool":{"additionalProperties":{"type":"integer"},"type":"object","title":"Max Calls Per Tool"},"aggregate_value_cap":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Aggregate Value Cap"},"forbidden_fields":{"items":{"type":"string"},"type":"array","title":"Forbidden Fields"},"recipient_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Domain"}},"type":"object","required":["permit_id","issuer_wallet_id","subject_wallet_id","subject_key_id","scopes","allowed_tools","max_credits","spent_credits","expires_at","nonce","status","signature","key_id","issued_at"],"title":"PermitResponse"},"PermitVerifyRequest":{"properties":{"permit_id":{"type":"string","title":"Permit Id"},"wallet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Id"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"},"estimated_credits":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Estimated Credits"}},"type":"object","required":["permit_id"],"title":"PermitVerifyRequest"},"PermitVerifyResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"permit":{"anyOf":[{"$ref":"#/components/schemas/PermitResponse"},{"type":"null"}]}},"type":"object","required":["valid"],"title":"PermitVerifyResponse"},"PolicyBundleCreate":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"name":{"type":"string","minLength":1,"title":"Name"},"allowed_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Tools"},"allowed_service_categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Service Categories"},"max_cost_per_action":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Max Cost Per Action"},"daily_spend_limit":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Daily Spend Limit"},"require_real_effects":{"type":"boolean","title":"Require Real Effects","default":false},"risk_tier":{"type":"string","title":"Risk Tier","default":"medium"},"human_approval_required":{"type":"boolean","title":"Human Approval Required","default":false},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["wallet_id","name"],"title":"PolicyBundleCreate"},"PolicyBundleListResponse":{"properties":{"policies":{"items":{"$ref":"#/components/schemas/PolicyBundleResponse"},"type":"array","title":"Policies"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["policies","total"],"title":"PolicyBundleListResponse"},"PolicyBundlePatch":{"properties":{"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"},"allowed_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Tools"},"allowed_service_categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Service Categories"},"max_cost_per_action":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Max Cost Per Action"},"daily_spend_limit":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Daily Spend Limit"},"require_real_effects":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Real Effects"},"risk_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Tier"},"human_approval_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Human Approval Required"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"PolicyBundlePatch"},"PolicyBundleResponse":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"name":{"type":"string","title":"Name"},"allowed_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Tools"},"allowed_service_categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Service Categories"},"max_cost_per_action":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Cost Per Action"},"daily_spend_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Spend Limit"},"require_real_effects":{"type":"boolean","title":"Require Real Effects"},"risk_tier":{"type":"string","title":"Risk Tier"},"human_approval_required":{"type":"boolean","title":"Human Approval Required"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["policy_id","wallet_id","name","allowed_tools","allowed_service_categories","max_cost_per_action","daily_spend_limit","require_real_effects","risk_tier","human_approval_required","is_active","created_at","updated_at"],"title":"PolicyBundleResponse"},"PreflightCheckResult":{"properties":{"name":{"type":"string","title":"Name"},"passed":{"type":"boolean","title":"Passed"},"severity":{"type":"string","title":"Severity","description":"critical, warning, or info"},"message":{"type":"string","title":"Message"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["name","passed","severity","message"],"title":"PreflightCheckResult","description":"Single preflight check outcome."},"PreflightRequest":{"properties":{"base_url":{"type":"string","title":"Base Url","description":"Production BASE_URL to validate (e.g., https://api.mycompany.com).","default":""},"stripe_secret_key":{"type":"string","title":"Stripe Secret Key","description":"Stripe secret key to validate (sk_live_... for production).","default":""},"campaign_source_url":{"type":"string","title":"Campaign Source Url","description":"Campaign content source URL to validate (e.g., a real launch video URL).","default":""}},"type":"object","title":"PreflightRequest","description":"Optional overrides for preflight validation."},"PreflightResponse":{"properties":{"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"verdict":{"type":"string","title":"Verdict","description":"GO or NO-GO"},"total_checks":{"type":"integer","title":"Total Checks"},"passed":{"type":"integer","title":"Passed"},"failed":{"type":"integer","title":"Failed"},"warnings":{"type":"integer","title":"Warnings"},"critical_failures":{"type":"integer","title":"Critical Failures"},"checks":{"items":{"$ref":"#/components/schemas/PreflightCheckResult"},"type":"array","title":"Checks"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["checked_at","verdict","total_checks","passed","failed","warnings","critical_failures","checks","summary"],"title":"PreflightResponse","description":"Pre-flight readiness report — the checklist before you turn the key."},"PricingTableResponse":{"properties":{"pricing":{"items":{"$ref":"#/components/schemas/ServicePricing"},"type":"array","title":"Pricing"},"exchange_rate":{"type":"number","title":"Exchange Rate"},"exchange_rate_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange Rate Exact"},"last_updated":{"type":"string","format":"date-time","title":"Last Updated"}},"type":"object","required":["pricing","exchange_rate","last_updated"],"title":"PricingTableResponse","description":"Full pricing table for all services."},"PricingTier":{"properties":{"tier_name":{"type":"string","title":"Tier Name"},"price_per_credit":{"type":"number","title":"Price Per Credit"},"minimum_purchase":{"type":"number","title":"Minimum Purchase"},"features":{"items":{"type":"string"},"type":"array","title":"Features"}},"type":"object","required":["tier_name","price_per_credit","minimum_purchase","features"],"title":"PricingTier"},"ReceiptEvidenceCheck":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["passed","failed","skipped"],"title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"details":{"additionalProperties":true,"type":"object","title":"Details"}},"type":"object","required":["name","status"],"title":"ReceiptEvidenceCheck"},"ReceiptEvidenceResponse":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"valid":{"type":"boolean","title":"Valid"},"checks":{"items":{"$ref":"#/components/schemas/ReceiptEvidenceCheck"},"type":"array","title":"Checks"},"receipt":{"$ref":"#/components/schemas/ReceiptResponse"},"permit":{"anyOf":[{"$ref":"#/components/schemas/PermitResponse"},{"type":"null"}]},"audit_event":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Audit Event"},"audit_chain":{"anyOf":[{"$ref":"#/components/schemas/AuditChainVerifyResponse"},{"type":"null"}]},"ledger_entry":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ledger Entry"},"dispatch":{"anyOf":[{"$ref":"#/components/schemas/DispatchEvidenceResponse"},{"type":"null"}]}},"type":"object","required":["receipt_id","valid","checks","receipt"],"title":"ReceiptEvidenceResponse"},"ReceiptListResponse":{"properties":{"receipts":{"items":{"$ref":"#/components/schemas/ReceiptResponse"},"type":"array","title":"Receipts"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["receipts","total","limit","offset","has_more"],"title":"ReceiptListResponse"},"ReceiptResponse":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"idempotency_record_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Record Id"},"dispatch_attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dispatch Attempt Id"},"permit_id":{"type":"string","title":"Permit Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"},"tool":{"type":"string","title":"Tool"},"request_hash":{"type":"string","title":"Request Hash"},"response_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Hash"},"ledger_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Entry Id"},"credits_authorized":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits Authorized"},"credits_charged":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits Charged"},"outcome":{"type":"string","title":"Outcome"},"audit_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Event Id"},"approval_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Id"},"constraints_evaluated":{"additionalProperties":true,"type":"object","title":"Constraints Evaluated"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"signature":{"type":"string","title":"Signature"},"signature_key_id":{"type":"string","title":"Signature Key Id"}},"type":"object","required":["receipt_id","permit_id","wallet_id","key_id","tool","request_hash","response_hash","ledger_entry_id","credits_authorized","credits_charged","outcome","audit_event_id","created_at","signature","signature_key_id"],"title":"ReceiptResponse"},"ReceiptVerifyRequest":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"}},"type":"object","required":["receipt_id"],"title":"ReceiptVerifyRequest"},"ReceiptVerifyResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"receipt":{"anyOf":[{"$ref":"#/components/schemas/ReceiptResponse"},{"type":"null"}]}},"type":"object","required":["valid"],"title":"ReceiptVerifyResponse"},"ReclaimResponse":{"properties":{"child_wallet_id":{"type":"string","title":"Child Wallet Id"},"parent_wallet_id":{"type":"string","title":"Parent Wallet Id"},"credits_reclaimed":{"type":"number","title":"Credits Reclaimed"},"credits_reclaimed_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credits Reclaimed Exact"},"parent_balance_after":{"type":"number","title":"Parent Balance After"},"parent_balance_after_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Balance After Exact"},"child_status":{"$ref":"#/components/schemas/WalletStatus"}},"type":"object","required":["child_wallet_id","parent_wallet_id","credits_reclaimed","parent_balance_after","child_status"],"title":"ReclaimResponse","description":"Result of reclaiming unspent credits from a child wallet."},"RefundReconciliationItem":{"properties":{"record_id":{"type":"string","title":"Record Id"},"receipt_id":{"type":"string","title":"Receipt Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"permit_id":{"type":"string","title":"Permit Id"},"ledger_entry_id":{"type":"string","title":"Ledger Entry Id"},"refund_entry_id":{"type":"string","title":"Refund Entry Id"},"credits":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits"},"status":{"type":"string","enum":["pending","resolved"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["record_id","receipt_id","wallet_id","permit_id","ledger_entry_id","refund_entry_id","credits","status","created_at"],"title":"RefundReconciliationItem"},"RefundReconciliationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RefundReconciliationItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["items","total","limit","offset","has_more"],"title":"RefundReconciliationListResponse"},"RefundReconciliationRetryResponse":{"properties":{"item":{"$ref":"#/components/schemas/RefundReconciliationItem"},"replayed":{"type":"boolean","title":"Replayed"}},"type":"object","required":["item","replayed"],"title":"RefundReconciliationRetryResponse"},"RegisterServiceRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"category":{"$ref":"#/components/schemas/ServiceCategory"},"credits_per_unit":{"type":"number","exclusiveMinimum":0.0,"title":"Credits Per Unit"},"unit_name":{"type":"string","maxLength":50,"title":"Unit Name","default":"request"},"mcp_manifest":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Mcp Manifest"}},"type":"object","required":["name","category","credits_per_unit"],"title":"RegisterServiceRequest","description":"Register a new billable service in the marketplace."},"RotateAPIKeyRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet ID owning the key."},"key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id","description":"Specific key ID to rotate. None = create new key only."},"revoke_old":{"type":"boolean","title":"Revoke Old","description":"Whether to revoke the old key after rotation.","default":false},"reason":{"type":"string","maxLength":255,"title":"Reason","description":"Reason for rotation.","default":"manual_rotation"}},"type":"object","required":["wallet_id"],"title":"RotateAPIKeyRequest","description":"Request to rotate an API key."},"RotationResponse":{"properties":{"rotation_id":{"type":"string","title":"Rotation Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"old_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Key Id"},"new_key":{"anyOf":[{"$ref":"#/components/schemas/APIKeyWithSecret"},{"type":"null"}]},"rotation_type":{"$ref":"#/components/schemas/RotationType"},"revoked_keys":{"items":{"type":"string"},"type":"array","title":"Revoked Keys","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["rotation_id","wallet_id","rotation_type","created_at"],"title":"RotationResponse","description":"Response after key rotation."},"RotationType":{"type":"string","enum":["manual","automatic","emergency","scheduled"],"title":"RotationType"},"ServiceCapability":{"properties":{"name":{"type":"string","title":"Name"},"version":{"type":"string","title":"Version"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"requires_auth":{"type":"boolean","title":"Requires Auth","default":true},"surface":{"type":"string","title":"Surface","description":"'product' = MCP trust-plane wedge; 'proof_surface' = labeled demo/workload scaffolding (often simulated).","default":"product"},"simulation_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Simulation Default","description":"When true, this surface defaults to simulation mode."}},"type":"object","required":["name","version","description","category"],"title":"ServiceCapability"},"ServiceCategory":{"type":"string","enum":["iot_bridge","telemetry_pm","media_engine","agent_comms","content_factory","red_team","oracle","platform_fee","swarm_delegation","protocol_gen","sandbox","rtaas"],"title":"ServiceCategory"},"ServicePricing":{"properties":{"service_category":{"$ref":"#/components/schemas/ServiceCategory"},"unit":{"type":"string","title":"Unit"},"credits_per_unit":{"type":"number","title":"Credits Per Unit"},"credits_per_unit_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credits Per Unit Exact"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["service_category","unit","credits_per_unit"],"title":"ServicePricing","description":"Per-action pricing for a service category."},"ServiceRegistration":{"properties":{"service_id":{"type":"string","title":"Service Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"owner_wallet_id":{"type":"string","title":"Owner Wallet Id"},"category":{"$ref":"#/components/schemas/ServiceCategory"},"credits_per_unit":{"type":"number","title":"Credits Per Unit"},"credits_per_unit_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credits Per Unit Exact"},"unit_name":{"type":"string","title":"Unit Name"},"mcp_manifest":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Mcp Manifest"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["service_id","name","description","owner_wallet_id","category","credits_per_unit","unit_name","is_active","created_at"],"title":"ServiceRegistration","description":"A registered billable service in the marketplace."},"SigningKeyMetadataResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"alg":{"type":"string","title":"Alg"},"public_key_b64":{"type":"string","title":"Public Key B64"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"activated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Activated At"},"retired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retired At"}},"type":"object","required":["key_id","alg","public_key_b64","status","created_at"],"title":"SigningKeyMetadataResponse"},"SimulatedChargeRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Wallet being simulated"},"service":{"$ref":"#/components/schemas/ServiceCategory","description":"Service category to simulate"},"units":{"type":"number","title":"Units","description":"Number of units","default":1.0},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description"},"dry_run_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dry Run Session Id","description":"Session ID for session-based simulation"}},"type":"object","required":["wallet_id","service"],"title":"SimulatedChargeRequest","description":"Simulate a charge without affecting real balance."},"SimulatedChargeResponse":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run","default":true},"session_id":{"type":"string","title":"Session Id"},"wallet_id":{"type":"string","title":"Wallet Id"},"service_category":{"type":"string","title":"Service Category"},"units":{"type":"number","title":"Units"},"credits_would_charge":{"type":"number","title":"Credits Would Charge"},"credits_would_charge_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credits Would Charge Exact"},"simulated_balance_before":{"type":"number","title":"Simulated Balance Before"},"simulated_balance_before_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Simulated Balance Before Exact"},"simulated_balance_after":{"type":"number","title":"Simulated Balance After"},"simulated_balance_after_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Simulated Balance After Exact"},"would_succeed":{"type":"boolean","title":"Would Succeed"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["session_id","wallet_id","service_category","units","credits_would_charge","simulated_balance_before","simulated_balance_after","would_succeed"],"title":"SimulatedChargeResponse","description":"Result of a simulated charge."},"SwarmBudgetSummary":{"properties":{"parent_wallet_id":{"type":"string","title":"Parent Wallet Id"},"parent_balance":{"type":"number","title":"Parent Balance"},"parent_balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Balance Exact"},"total_delegated":{"type":"number","title":"Total Delegated"},"total_delegated_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Delegated Exact"},"total_reclaimed":{"type":"number","title":"Total Reclaimed"},"total_reclaimed_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Reclaimed Exact"},"active_children":{"type":"integer","title":"Active Children"},"completed_children":{"type":"integer","title":"Completed Children"},"frozen_children":{"type":"integer","title":"Frozen Children"},"children":{"items":{"$ref":"#/components/schemas/WalletResponse"},"type":"array","title":"Children"}},"type":"object","required":["parent_wallet_id","parent_balance","total_delegated","total_reclaimed","active_children","completed_children","frozen_children","children"],"title":"SwarmBudgetSummary","description":"Hierarchical budget summary for an agent's child swarm."},"TokenExchangeRequest":{"properties":{"api_key":{"type":"string","minLength":8,"title":"Api Key","description":"Wallet API key to exchange"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Requested scopes (default: billing:charge tool:invoke)"}},"type":"object","required":["api_key"],"title":"TokenExchangeRequest"},"TokenExchangeResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"},"scope":{"type":"string","title":"Scope"}},"type":"object","required":["access_token","refresh_token","expires_in","scope"],"title":"TokenExchangeResponse"},"TokenRefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"TokenRefreshRequest"},"TokenRefreshResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","refresh_token","expires_in"],"title":"TokenRefreshResponse"},"TokenRevokeRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"TokenRevokeRequest"},"ToolCallRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Tool name (service_id)"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments","description":"Tool arguments"},"mcp_context":{"anyOf":[{"$ref":"#/components/schemas/McpContext"},{"type":"null"}],"description":"Billing context"}},"type":"object","required":["name"],"title":"ToolCallRequest","description":"MCP tool call request (tools/call method)."},"ToolCallResponse":{"properties":{"content":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Content"},"isError":{"type":"boolean","title":"Iserror","default":false},"structuredContent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structuredcontent"},"receipt":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Receipt"}},"type":"object","required":["content"],"title":"ToolCallResponse","description":"MCP tool call response."},"TopUpRequest":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id","description":"Sponsor wallet to top up."},"amount_fiat":{"type":"number","exclusiveMinimum":0.0,"title":"Amount Fiat","description":"Amount in fiat currency (e.g., USD)."},"payment_method":{"type":"string","title":"Payment Method","description":"Payment rail to use.","default":"stripe"},"payment_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Token","description":"Payment method token."}},"type":"object","required":["wallet_id","amount_fiat"],"title":"TopUpRequest","description":"Request to add credits to a sponsor wallet via fiat payment."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WalletListResponse":{"properties":{"wallets":{"items":{"$ref":"#/components/schemas/WalletResponse"},"type":"array","title":"Wallets"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["wallets","total"],"title":"WalletListResponse"},"WalletResponse":{"properties":{"wallet_id":{"type":"string","title":"Wallet Id"},"wallet_type":{"$ref":"#/components/schemas/WalletType"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"balance":{"type":"number","title":"Balance","description":"Current credit balance."},"balance_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Exact","description":"Exact current credit balance as a decimal string."},"lifetime_credits":{"type":"number","title":"Lifetime Credits","description":"Total credits ever deposited."},"lifetime_credits_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifetime Credits Exact"},"lifetime_debits":{"type":"number","title":"Lifetime Debits","description":"Total credits ever consumed."},"lifetime_debits_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifetime Debits Exact"},"status":{"$ref":"#/components/schemas/WalletStatus"},"kyc_status":{"$ref":"#/components/schemas/KYCStatus","default":"not_required"},"daily_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Limit"},"daily_limit_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Daily Limit Exact"},"auto_refill":{"type":"boolean","title":"Auto Refill","default":false},"auto_refill_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Auto Refill Threshold"},"auto_refill_threshold_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Refill Threshold Exact"},"auto_refill_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Auto Refill Amount"},"auto_refill_amount_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Refill Amount Exact"},"sponsor_wallet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sponsor Wallet Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"child_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Child Agent Id"},"max_spend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Spend"},"max_spend_exact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Spend Exact"},"task_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Description"},"ttl_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ttl Seconds"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["wallet_id","wallet_type","balance","lifetime_credits","lifetime_debits","status","created_at"],"title":"WalletResponse","description":"Wallet details."},"WalletStatus":{"type":"string","enum":["active","suspended","frozen","closed","pending_kyc"],"title":"WalletStatus"},"WalletType":{"type":"string","enum":["sponsor","agent","child"],"title":"WalletType","description":"Wallet types in the three-tier system."}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"API key for agent authentication. Pass in the X-API-Key header.","in":"header","name":"X-API-Key"}}}}