{"openapi":"3.1.0","info":{"title":"ainfera-os","description":"Ainfera API — the Inference of AI Agents. Drain-proof wallets, signed receipts, hash-chained audit across Claude, GPT, Gemini, Grok, and Mistral.","version":"1.0.0"},"paths":{"/v1/tenants/register":{"post":{"tags":["tenants"],"summary":"Register a new Tenant — returns a one-time API key","operationId":"register_tenant_v1_tenants_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRegistered"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","operationId":"get_tenant_v1_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant 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/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/signup":{"post":{"tags":["agent-signup"],"summary":"Self-serve agent registration — Tenant, Agent, AgentCard, Wallet in one call","operationId":"agent_signup_v1_agents_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/install-from-local":{"post":{"tags":["agent-install"],"summary":"Register agent(s) from a local manifest (SDK CLI path)","operationId":"install_from_local_v1_agents_install_from_local_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocalInstallRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocalInstallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/register":{"post":{"tags":["agents"],"summary":"Register an Agent (provisions an Ed25519 keypair)","operationId":"register_agent_v1_agents_register_post","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/AgentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}":{"get":{"tags":["agents"],"summary":"Get Agent","operationId":"get_agent_v1_agents__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent 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/Agent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/card":{"post":{"tags":["agents"],"summary":"Mint a new JWS-signed AgentCard for an Agent","operationId":"mint_card_v1_agents__agent_id__card_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agents"],"summary":"Get Latest Card","operationId":"get_latest_card_v1_agents__agent_id__card_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/cards/verify":{"post":{"tags":["agents"],"summary":"Verify a JWS-signed AgentCard against the issuing Agent's stored public key","operationId":"verify_card_v1_agents_cards_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCardVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCardVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/spend-policy":{"patch":{"tags":["agents"],"summary":"Update the per-call / daily caps on an Agent's spend policy","operationId":"patch_spend_policy_v1_agents__agent_id__spend_policy_patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}},{"name":"x-ainfera-on-behalf-of","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-On-Behalf-Of"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendPolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/wallets/{agent_id}":{"get":{"tags":["wallets"],"summary":"Get Balance","operationId":"get_balance_v1_wallets__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent 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/WalletBalance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/wallets/topup":{"post":{"tags":["wallets"],"summary":"Top up an Agent's prepaid balance (D9 placeholder)","operationId":"topup_v1_wallets_topup_post","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":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ledger/{agent_id}":{"get":{"tags":["ledger"],"summary":"Get Ledger","operationId":"get_ledger_v1_ledger__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"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/LedgerView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/public":{"get":{"tags":["audit"],"summary":"Recent AuditEvents across all Agents — public, masked feed","operationId":"public_feed_v1_audit_public_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max events to return (1-500).","default":20,"title":"Limit"},"description":"Max events to return (1-500)."},{"name":"since_seq","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"If set, return events with seq > since_seq ordered ascending (cursor mode for live feeds). Otherwise returns the most recent `limit` events ordered by created_at descending.","title":"Since Seq"},"description":"If set, return events with seq > since_seq ordered ascending (cursor mode for live feeds). Otherwise returns the most recent `limit` events ordered by created_at descending."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAuditFeed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/{agent_id}":{"get":{"tags":["audit"],"summary":"Get Chain","operationId":"get_chain_v1_audit__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":1},{"type":"null"}],"description":"Max events to return (1-500). Omit for full chain.","title":"Limit"},"description":"Max events to return (1-500). Omit for full chain."},{"name":"since_seq","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"If set, return events with seq > since_seq.","title":"Since Seq"},"description":"If set, return events with seq > since_seq."},{"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/AuditChainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/{agent_id}/verify":{"get":{"tags":["audit"],"summary":"Verify","operationId":"verify_v1_audit__agent_id__verify_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit/{agent_id}/annex-iv":{"get":{"tags":["audit"],"summary":"Annex IV-style audit export (D14+ adds Sigstore)","operationId":"annex_iv_bundle_v1_audit__agent_id__annex_iv_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent 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/AnnexIVBundle"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/providers":{"get":{"tags":["providers"],"summary":"List Providers","operationId":"list_providers_v1_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Provider"},"type":"array","title":"Response List Providers V1 Providers Get"}}}}}}},"/v1/providers/{provider_id}/models":{"get":{"tags":["providers"],"summary":"List Models","operationId":"list_models_v1_providers__provider_id__models_get","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Model"},"title":"Response List Models V1 Providers  Provider Id  Models Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"tags":["models"],"summary":"Flat list of active Models · filterable for AI-native discovery","operationId":"list_all_models_v1_models_get","parameters":[{"name":"capability","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to models whose capabilities[] contains this string","title":"Capability"},"description":"Filter to models whose capabilities[] contains this string"},{"name":"max_cost_in_per_m","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Max input cost per 1M tokens USD","title":"Max Cost In Per M"},"description":"Max input cost per 1M tokens USD"},{"name":"max_cost_out_per_m","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Max output cost per 1M tokens USD","title":"Max Cost Out Per M"},"description":"Max output cost per 1M tokens USD"},{"name":"min_aa_index","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"description":"Minimum AA Intelligence Index","title":"Min Aa Index"},"description":"Minimum AA Intelligence Index"},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Provider slug filter (e.g., anthropic, novita, groq)","title":"Provider"},"description":"Provider slug filter (e.g., anthropic, novita, groq)"},{"name":"stack","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Geographic/sovereignty stack hint: china, sea, eu, us","title":"Stack"},"description":"Geographic/sovereignty stack hint: china, sea, eu, us"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FlatModel"},"title":"Response List All Models V1 Models Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inference":{"post":{"tags":["inference"],"summary":"Dispatch an inference through L2 Routing","operationId":"post_inference_v1_inference_post","parameters":[{"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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/heartbeat":{"post":{"tags":["heartbeat"],"summary":"Substrate liveness report (NemoClaw → L4) — internal-key gated","operationId":"post_heartbeat_v1_heartbeat_post","parameters":[{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/heartbeat/latest":{"get":{"tags":["heartbeat"],"summary":"Most recent heartbeat for a substrate (defaults to nemoclaw)","operationId":"get_latest_heartbeat_v1_heartbeat_latest_get","parameters":[{"name":"substrate","in":"query","required":false,"schema":{"type":"string","default":"nemoclaw","title":"Substrate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatLatest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/github/connect":{"get":{"tags":["github-oauth"],"summary":"Redirect to github.com to start the OAuth flow","operationId":"github_connect_v1_users_github_connect_get","parameters":[{"name":"return_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Path on app.ainfera.ai to land on after auth. Defaults to /{handle}.","title":"Return To"},"description":"Path on app.ainfera.ai to land on after auth. Defaults to /{handle}."}],"responses":{"307":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/github/callback":{"get":{"tags":["github-oauth"],"summary":"OAuth callback — exchange code, upsert User, set session cookie","operationId":"github_callback_v1_users_github_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"State"}}],"responses":{"307":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/github/me":{"get":{"tags":["github-oauth"],"summary":"Return the currently authenticated User (from session cookie)","operationId":"github_me_v1_users_github_me_get","parameters":[{"name":"ainfera_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ainfera Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/{github_handle}/dashboard":{"get":{"tags":["users-dashboard"],"summary":"Fleet view for the owning GitHub handle","operationId":"get_user_dashboard_v1_users__github_handle__dashboard_get","parameters":[{"name":"github_handle","in":"path","required":true,"schema":{"type":"string","title":"Github Handle"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}},{"name":"x-ainfera-on-behalf-of","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-On-Behalf-Of"}},{"name":"ainfera_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ainfera Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/{github_handle}/agents/{agent_handle}":{"get":{"tags":["users-dashboard"],"summary":"Per-agent detail — recent audit + ledger + wallet balance","operationId":"get_agent_detail_v1_users__github_handle__agents__agent_handle__get","parameters":[{"name":"github_handle","in":"path","required":true,"schema":{"type":"string","title":"Github Handle"}},{"name":"agent_handle","in":"path","required":true,"schema":{"type":"string","title":"Agent Handle"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}},{"name":"x-ainfera-on-behalf-of","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-On-Behalf-Of"}},{"name":"ainfera_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ainfera Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/{github_handle}/wallets":{"get":{"tags":["users-dashboard"],"summary":"Per-agent wallet balances + spend caps for the fleet","operationId":"get_user_wallets_v1_users__github_handle__wallets_get","parameters":[{"name":"github_handle","in":"path","required":true,"schema":{"type":"string","title":"Github Handle"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}},{"name":"x-ainfera-on-behalf-of","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-On-Behalf-Of"}},{"name":"ainfera_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ainfera Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/users/{github_handle}/receipts":{"get":{"tags":["users-dashboard"],"summary":"Fleet receipts (settled L3 events), newest first","operationId":"get_user_receipts_v1_users__github_handle__receipts_get","parameters":[{"name":"github_handle","in":"path","required":true,"schema":{"type":"string","title":"Github Handle"}},{"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"}},{"name":"x-ainfera-internal-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-Internal-Key"}},{"name":"x-ainfera-on-behalf-of","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ainfera-On-Behalf-Of"}},{"name":"ainfera_session","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ainfera Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"AdapterKind":{"type":"string","enum":["anthropic","openai","openai_compat"],"title":"AdapterKind"},"Agent":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"status":{"$ref":"#/components/schemas/AgentStatus"},"public_key_ed25519":{"type":"string","title":"Public Key Ed25519","description":"PEM-encoded Ed25519 public key"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","name","status","public_key_ed25519","created_at"],"title":"Agent"},"AgentCard":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"jws":{"type":"string","title":"Jws","description":"Compact JWS per RFC 7515: header.payload.signature"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["id","agent_id","jws","issued_at"],"title":"AgentCard"},"AgentCardVerifyRequest":{"properties":{"jws":{"type":"string","minLength":1,"title":"Jws"}},"type":"object","required":["jws"],"title":"AgentCardVerifyRequest"},"AgentCardVerifyResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["valid"],"title":"AgentCardVerifyResponse"},"AgentCreate":{"properties":{"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["tenant_id","name"],"title":"AgentCreate"},"AgentDetailResponse":{"properties":{"agent":{"$ref":"#/components/schemas/AgentSummary"},"canonical_uri":{"type":"string","title":"Canonical Uri"},"did_web":{"type":"string","title":"Did Web"},"wallet_balance_usd":{"type":"string","title":"Wallet Balance Usd"},"audit_events":{"items":{"$ref":"#/components/schemas/AuditEventOut"},"type":"array","title":"Audit Events"},"ledger_entries":{"items":{"$ref":"#/components/schemas/LedgerEntryOut"},"type":"array","title":"Ledger Entries"}},"type":"object","required":["agent","canonical_uri","did_web","wallet_balance_usd","audit_events","ledger_entries"],"title":"AgentDetailResponse"},"AgentSignupRequest":{"properties":{"agent_handle":{"type":"string","maxLength":40,"minLength":3,"pattern":"^[a-z0-9][a-z0-9-]*$","title":"Agent Handle"},"owner_handle":{"anyOf":[{"type":"string","maxLength":39,"minLength":1},{"type":"null"}],"title":"Owner Handle","description":"GitHub user/org login. Omit for anonymous (the 'agents' namespace)."},"owner_source":{"anyOf":[{"type":"string","enum":["github_user","github_org","anonymous","internal"]},{"type":"null"}],"title":"Owner Source"},"owner_contact":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Owner Contact"},"per_call_cap_usd":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.001},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Per Call Cap Usd","description":"Per-Inference cap. Gateway-enforced at /v1/inference (B2)."},"daily_cap_usd":{"anyOf":[{"type":"number","maximum":10000.0,"minimum":0.01},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Daily Cap Usd","description":"Per-day cap. Gateway-enforced. Resets at UTC midnight."},"wallet_address":{"anyOf":[{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},{"type":"null"}],"title":"Wallet Address","description":"Base smart wallet address bound to this Agent's Wallet (cdp_address)."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["agent_handle"],"title":"AgentSignupRequest"},"AgentSignupResponse":{"properties":{"canonical_uri":{"type":"string","title":"Canonical Uri"},"did_web":{"type":"string","title":"Did Web"},"tenant_id":{"type":"string","title":"Tenant Id"},"agent_id":{"type":"string","title":"Agent Id"},"owner_handle":{"type":"string","title":"Owner Handle"},"agent_handle":{"type":"string","title":"Agent Handle"},"api_key":{"type":"string","title":"Api Key"},"agent_card_jws":{"type":"string","title":"Agent Card Jws"},"free_tier_inferences_remaining":{"type":"integer","title":"Free Tier Inferences Remaining"},"free_tier_credit_usd":{"type":"number","title":"Free Tier Credit Usd"},"docs_url":{"type":"string","title":"Docs Url"},"api_url":{"type":"string","title":"Api Url"}},"type":"object","required":["canonical_uri","did_web","tenant_id","agent_id","owner_handle","agent_handle","api_key","agent_card_jws","free_tier_inferences_remaining","free_tier_credit_usd","docs_url","api_url"],"title":"AgentSignupResponse"},"AgentStatus":{"type":"string","enum":["active","suspended","revoked"],"title":"AgentStatus"},"AgentSummary":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"handle":{"type":"string","title":"Handle"},"framework":{"type":"string","title":"Framework"},"installed_via":{"type":"string","title":"Installed Via"},"inferences_today":{"type":"integer","title":"Inferences Today"},"spend_today_usd":{"type":"string","title":"Spend Today Usd"},"spend_total_usd":{"type":"string","title":"Spend Total Usd"},"last_inference_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Inference At"},"last_audit_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Audit Hash"},"drain_proof_status":{"type":"string","title":"Drain Proof Status","description":"'protected' or 'no_caps'"},"last_cap_violation_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Cap Violation At"},"spend_policy":{"additionalProperties":true,"type":"object","title":"Spend Policy"}},"type":"object","required":["agent_id","handle","framework","installed_via","inferences_today","spend_today_usd","spend_total_usd","last_inference_at","last_audit_hash","drain_proof_status","last_cap_violation_at","spend_policy"],"title":"AgentSummary"},"AnnexIVBundle":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"issuer":{"type":"string","title":"Issuer"},"chain_genesis_hash":{"type":"string","title":"Chain Genesis Hash"},"event_count":{"type":"integer","title":"Event Count"},"events":{"items":{"$ref":"#/components/schemas/AnnexIVEvent"},"type":"array","title":"Events"}},"type":"object","required":["agent_id","issuer","chain_genesis_hash","event_count","events"],"title":"AnnexIVBundle","description":"Minimal Annex IV-style export. D14+ adds Sigstore signing."},"AnnexIVEvent":{"properties":{"seq":{"type":"integer","title":"Seq"},"event_type":{"$ref":"#/components/schemas/AuditEventType"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"previous_hash":{"type":"string","title":"Previous Hash"},"event_hash":{"type":"string","title":"Event Hash"},"hmac_signature":{"type":"string","title":"Hmac Signature"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["seq","event_type","payload","previous_hash","event_hash","hmac_signature","created_at"],"title":"AnnexIVEvent"},"AuditChainResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"events":{"items":{"$ref":"#/components/schemas/AuditEvent"},"type":"array","title":"Events"}},"type":"object","required":["agent_id","events"],"title":"AuditChainResponse"},"AuditEvent":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"seq":{"type":"integer","minimum":0.0,"title":"Seq"},"event_type":{"$ref":"#/components/schemas/AuditEventType"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"previous_hash":{"type":"string","title":"Previous Hash","description":"SHA-256 hex of preceding event_hash, or genesis hash"},"event_hash":{"type":"string","title":"Event Hash","description":"SHA-256 hex of previous_hash + canonical_json(payload)"},"hmac_signature":{"type":"string","title":"Hmac Signature","description":"HMAC-SHA256 hex of event_hash with rotating secret"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","seq","event_type","payload","previous_hash","event_hash","hmac_signature","created_at"],"title":"AuditEvent"},"AuditEventOut":{"properties":{"seq":{"type":"integer","title":"Seq"},"event_type":{"type":"string","title":"Event Type"},"event_hash":{"type":"string","title":"Event Hash"},"previous_hash":{"type":"string","title":"Previous Hash"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["seq","event_type","event_hash","previous_hash","payload","created_at"],"title":"AuditEventOut"},"AuditEventType":{"type":"string","enum":["agent.registered","agent.card_issued","inference.requested","inference.routed","inference.rejected_cap_violation","inference.rejected_insufficient_funds","ledger.debited","ledger.refunded","ledger.topped_up","provider.responded","provider.errored","receipt.created"],"title":"AuditEventType"},"AuditVerifyResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"event_count":{"type":"integer","title":"Event Count"},"valid":{"type":"boolean","title":"Valid"},"failure_seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failure Seq"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"}},"type":"object","required":["agent_id","event_count","valid"],"title":"AuditVerifyResponse"},"FlatModel":{"properties":{"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"provider":{"type":"string","title":"Provider"},"input_cost_per_million_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Input Cost Per Million Usd"},"output_cost_per_million_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Output Cost Per Million Usd"},"context_window":{"type":"integer","title":"Context Window"},"aa_intelligence_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Aa Intelligence Index"},"aa_index_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aa Index Source"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["slug","display_name","provider","input_cost_per_million_usd","output_cost_per_million_usd","context_window","created_at"],"title":"FlatModel","description":"Public flat projection of a Model across all active Providers.\n\nAI-native callers discovering capabilities programmatically want one\nGET, not one-per-provider. Provider slug is denormalized in so they\ndon't need a second lookup to identify the upstream. T9 adds\naa_intelligence_index + aa_index_source + capabilities so callers can\nfilter without round-tripping through `/v1/models/{slug}`."},"FleetTotals":{"properties":{"total_agents":{"type":"integer","title":"Total Agents"},"total_inferences_today":{"type":"integer","title":"Total Inferences Today"},"total_spend_today_usd":{"type":"string","title":"Total Spend Today Usd"}},"type":"object","required":["total_agents","total_inferences_today","total_spend_today_usd"],"title":"FleetTotals"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeartbeatLatest":{"properties":{"substrate":{"type":"string","title":"Substrate"},"host":{"type":"string","title":"Host"},"agents":{"items":{"type":"string"},"type":"array","title":"Agents"},"agent_states":{"additionalProperties":{"type":"string"},"type":"object","title":"Agent States"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"age_seconds":{"type":"number","title":"Age Seconds"}},"type":"object","required":["substrate","host","agents","agent_states","timestamp","age_seconds"],"title":"HeartbeatLatest"},"HeartbeatRequest":{"properties":{"substrate":{"type":"string","maxLength":64,"minLength":1,"title":"Substrate"},"host":{"type":"string","maxLength":128,"minLength":1,"title":"Host"},"agents":{"items":{"type":"string"},"type":"array","title":"Agents"},"agent_states":{"additionalProperties":{"type":"string"},"type":"object","title":"Agent States"}},"type":"object","required":["substrate","host","agents","agent_states"],"title":"HeartbeatRequest"},"HeartbeatResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["ok","timestamp"],"title":"HeartbeatResponse"},"InferenceRequest":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id","description":"Agent to bill and audit. Optional when the calling API key owns exactly one Agent — the handler derives it from the Tenant. Required when the Tenant has multiple Agents; a missing value returns 400."},"model":{"type":"string","title":"Model","description":"Provider model slug, e.g. claude-opus-4-7. Pass `ainfera-auto` to let Ainfera pick the cheapest model matching the request's capabilities + quality floor (see routing_hint)."},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"max_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"routing_hint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Routing Hint","description":"Optional hints for `model=ainfera-auto`. Recognized keys: `quality_floor` (frontier|production|good · default good), `require_capabilities` (list[str] · unioned with auto-detected)."}},"type":"object","required":["model","messages"],"title":"InferenceRequest"},"InferenceResponse":{"properties":{"inference_id":{"type":"string","format":"uuid","title":"Inference Id"},"receipt_id":{"type":"string","format":"uuid","title":"Receipt Id"},"content":{"type":"string","title":"Content"},"model_used":{"type":"string","title":"Model Used"},"finish_reason":{"type":"string","title":"Finish Reason"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cost_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Cost Usd"}},"type":"object","required":["inference_id","receipt_id","content","model_used","finish_reason","input_tokens","output_tokens","cost_usd"],"title":"InferenceResponse"},"InstalledAgent":{"properties":{"handle":{"type":"string","title":"Handle"},"canonical_uri":{"type":"string","title":"Canonical Uri"},"did_web":{"type":"string","title":"Did Web"},"agent_id":{"type":"string","title":"Agent Id"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"created":{"type":"boolean","title":"Created"}},"type":"object","required":["handle","canonical_uri","did_web","agent_id","api_key","created"],"title":"InstalledAgent"},"LedgerEntry":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"type":{"$ref":"#/components/schemas/LedgerEntryType"},"amount_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Usd"},"inference_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inference Id"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","type","amount_usd","inference_id","memo","created_at"],"title":"LedgerEntry"},"LedgerEntryOut":{"properties":{"type":{"type":"string","title":"Type"},"amount_usd":{"type":"string","title":"Amount Usd"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"inference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inference Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["type","amount_usd","memo","inference_id","created_at"],"title":"LedgerEntryOut"},"LedgerEntryType":{"type":"string","enum":["topup","debit","refund"],"title":"LedgerEntryType"},"LedgerView":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"balance_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance Usd"},"entries":{"items":{"$ref":"#/components/schemas/LedgerEntry"},"type":"array","title":"Entries"}},"type":"object","required":["agent_id","balance_usd","entries"],"title":"LedgerView"},"LocalInstallRequest":{"properties":{"github_handle":{"type":"string","maxLength":39,"minLength":1,"title":"Github Handle"},"github_token_proof":{"type":"string","maxLength":512,"minLength":10,"title":"Github Token Proof"},"manifest_url":{"type":"string","maxLength":512,"minLength":1,"title":"Manifest Url"},"agents":{"items":{"$ref":"#/components/schemas/ManifestAgent"},"type":"array","maxItems":64,"minItems":1,"title":"Agents"}},"type":"object","required":["github_handle","github_token_proof","manifest_url","agents"],"title":"LocalInstallRequest"},"LocalInstallResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"github_handle":{"type":"string","title":"Github Handle"},"agents":{"items":{"$ref":"#/components/schemas/InstalledAgent"},"type":"array","title":"Agents"},"dashboard_url":{"type":"string","title":"Dashboard Url"}},"type":"object","required":["user_id","tenant_id","github_handle","agents","dashboard_url"],"title":"LocalInstallResponse"},"ManifestAgent":{"properties":{"handle":{"type":"string","maxLength":40,"minLength":3,"pattern":"^[a-z0-9][a-z0-9-]*$","title":"Handle"},"framework":{"type":"string","maxLength":128,"minLength":1,"title":"Framework"},"persona":{"anyOf":[{"type":"string","maxLength":8192},{"type":"null"}],"title":"Persona"},"per_call_cap_usd":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.001},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Per Call Cap Usd"},"daily_cap_usd":{"anyOf":[{"type":"number","maximum":10000.0,"minimum":0.01},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Daily Cap Usd"},"wallet_address":{"anyOf":[{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},{"type":"null"}],"title":"Wallet Address"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["handle","framework"],"title":"ManifestAgent"},"MeResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"github_handle":{"type":"string","title":"Github Handle"},"primary_tenant_id":{"type":"string","title":"Primary Tenant Id"}},"type":"object","required":["user_id","github_handle","primary_tenant_id"],"title":"MeResponse"},"Model":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"provider_id":{"type":"string","format":"uuid","title":"Provider Id"},"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"input_cost_per_million_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Input Cost Per Million Usd"},"output_cost_per_million_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Output Cost Per Million Usd"},"context_window":{"type":"integer","title":"Context Window"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","provider_id","slug","display_name","input_cost_per_million_usd","output_cost_per_million_usd","context_window","active","created_at"],"title":"Model"},"Provider":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"base_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Base Url"},"adapter_kind":{"$ref":"#/components/schemas/AdapterKind"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","slug","name","base_url","adapter_kind","active","created_at"],"title":"Provider"},"PublicAuditEvent":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"owner_handle":{"type":"string","title":"Owner Handle"},"agent_name":{"type":"string","title":"Agent Name"},"canonical_uri":{"type":"string","title":"Canonical Uri"},"seq":{"type":"integer","title":"Seq"},"event_type":{"$ref":"#/components/schemas/AuditEventType"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"event_hash":{"type":"string","title":"Event Hash"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["event_id","owner_handle","agent_name","canonical_uri","seq","event_type","event_hash","created_at"],"title":"PublicAuditEvent","description":"Public-safe projection of an AuditEvent — hashes only, no payload bodies."},"PublicAuditFeed":{"properties":{"events":{"items":{"$ref":"#/components/schemas/PublicAuditEvent"},"type":"array","title":"Events"}},"type":"object","required":["events"],"title":"PublicAuditFeed"},"ReceiptRow":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"inference_id":{"type":"string","title":"Inference Id"},"agent_id":{"type":"string","title":"Agent Id"},"agent_handle":{"type":"string","title":"Agent Handle"},"amount_usd":{"type":"string","title":"Amount Usd"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["receipt_id","inference_id","agent_id","agent_handle","amount_usd","created_at"],"title":"ReceiptRow"},"ReceiptsResponse":{"properties":{"handle":{"type":"string","title":"Handle"},"receipts":{"items":{"$ref":"#/components/schemas/ReceiptRow"},"type":"array","title":"Receipts"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["handle","receipts","total_count"],"title":"ReceiptsResponse"},"SpendPolicyResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"agent_handle":{"type":"string","title":"Agent Handle"},"spend_policy":{"additionalProperties":{"type":"string"},"type":"object","title":"Spend Policy"},"drain_proof_status":{"type":"string","title":"Drain Proof Status"}},"type":"object","required":["agent_id","agent_handle","spend_policy","drain_proof_status"],"title":"SpendPolicyResponse"},"SpendPolicyUpdate":{"properties":{"per_call_cap_usd":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.001},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Per Call Cap Usd","description":"Per-Inference cap; omit to keep current, null to clear."},"daily_cap_usd":{"anyOf":[{"type":"number","maximum":10000.0,"minimum":0.01},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Daily Cap Usd"}},"type":"object","title":"SpendPolicyUpdate","description":"Editable spend-policy fields. Omit a key to leave it unchanged;\npass null to clear a cap."},"Tenant":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"contact_email":{"type":"string","format":"email","title":"Contact Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","contact_email","created_at"],"title":"Tenant"},"TenantCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"contact_email":{"type":"string","format":"email","title":"Contact Email"}},"type":"object","required":["name","contact_email"],"title":"TenantCreate"},"TenantRegistered":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"contact_email":{"type":"string","format":"email","title":"Contact Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"api_key":{"type":"string","title":"Api Key","description":"One-time API key — shown once, store it now."}},"type":"object","required":["id","name","contact_email","created_at","api_key"],"title":"TenantRegistered","description":"Returned once from /v1/tenants/register — carries the raw API key."},"TopupRequest":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"amount_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d{0,6}0*$"}],"title":"Amount Usd"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"}},"type":"object","required":["agent_id","amount_usd"],"title":"TopupRequest"},"TopupResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"amount_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount Usd"},"new_balance_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"New Balance Usd"},"ledger_entry_id":{"type":"string","format":"uuid","title":"Ledger Entry Id"},"audit_event_id":{"type":"string","format":"uuid","title":"Audit Event Id"}},"type":"object","required":["agent_id","amount_usd","new_balance_usd","ledger_entry_id","audit_event_id"],"title":"TopupResponse"},"UserDashboardResponse":{"properties":{"user":{"additionalProperties":true,"type":"object","title":"User"},"fleet_totals":{"$ref":"#/components/schemas/FleetTotals"},"agents":{"items":{"$ref":"#/components/schemas/AgentSummary"},"type":"array","title":"Agents"}},"type":"object","required":["user","fleet_totals","agents"],"title":"UserDashboardResponse"},"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"},"WalletBalance":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"balance_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance Usd"}},"type":"object","required":["agent_id","balance_usd"],"title":"WalletBalance"},"WalletRow":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"agent_handle":{"type":"string","title":"Agent Handle"},"framework":{"type":"string","title":"Framework"},"balance_usd":{"type":"string","title":"Balance Usd"},"spend_today_usd":{"type":"string","title":"Spend Today Usd"},"spend_total_usd":{"type":"string","title":"Spend Total Usd"},"per_call_cap_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Per Call Cap Usd"},"daily_cap_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Daily Cap Usd"},"drain_proof_status":{"type":"string","title":"Drain Proof Status"},"cdp_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cdp Address"}},"type":"object","required":["agent_id","agent_handle","framework","balance_usd","spend_today_usd","spend_total_usd","per_call_cap_usd","daily_cap_usd","drain_proof_status","cdp_address"],"title":"WalletRow"},"WalletsResponse":{"properties":{"handle":{"type":"string","title":"Handle"},"total_balance_usd":{"type":"string","title":"Total Balance Usd"},"total_spend_today_usd":{"type":"string","title":"Total Spend Today Usd"},"wallets":{"items":{"$ref":"#/components/schemas/WalletRow"},"type":"array","title":"Wallets"}},"type":"object","required":["handle","total_balance_usd","total_spend_today_usd","wallets"],"title":"WalletsResponse"}}}}