{ "openapi": "3.1.0", "info": { "title": "AgentPay API", "description": "Payment API for AI agents. Let your bot spend money.", "version": "0.1.0" }, "paths": { "/v1/health": { "get": { "tags": [ "health" ], "summary": "Health", "description": "Check API health status. Returns service name and version.", "operationId": "health_v1_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } } } } }, "/": { "get": { "tags": [ "health" ], "summary": "Root", "description": "Serve landing page.", "operationId": "root__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/v1/balance": { "get": { "tags": [ "agents" ], "summary": "Get Balance", "operationId": "get_balance_v1_balance_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BalanceResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/transactions": { "get": { "tags": [ "agents" ], "summary": "List Transactions", "operationId": "list_transactions_v1_transactions_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 20, "title": "Limit" } }, { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TransactionOut" }, "title": "Response List Transactions V1 Transactions Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/agent/rotate-key": { "post": { "tags": [ "agents" ], "summary": "Api Rotate Key", "description": "Rotate the API key for this agent. Returns the new key ONCE. Old key stops working immediately.", "operationId": "api_rotate_key_v1_agent_rotate_key_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RotateKeyResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/export": { "get": { "tags": [ "agents" ], "summary": "Export Csv", "operationId": "export_csv_v1_export_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/spend": { "post": { "tags": [ "wallets" ], "summary": "Do Spend", "description": "Spend funds from the agent's balance. Supports idempotency keys and approval workflows.", "operationId": "do_spend_v1_spend_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/refund": { "post": { "tags": [ "wallets" ], "summary": "Do Refund", "description": "Refund a completed spend transaction. Credits amount + fee back to agent.", "operationId": "do_refund_v1_refund_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefundRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefundResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/transfer": { "post": { "tags": [ "wallets" ], "summary": "Do Transfer", "description": "Transfer funds from this agent to another agent (same owner only). No fees.", "operationId": "do_transfer_v1_transfer_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/chains": { "get": { "tags": [ "wallets" ], "summary": "List Chains", "description": "List all supported blockchain networks.", "operationId": "list_chains_v1_chains_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/v1/wallet": { "get": { "tags": [ "wallets" ], "summary": "Wallet Info", "description": "Get wallet info for a specific chain.", "operationId": "wallet_info_v1_wallet_get", "parameters": [ { "name": "chain", "in": "query", "required": false, "schema": { "type": "string", "default": "base", "title": "Chain" } }, { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/wallet/all": { "get": { "tags": [ "wallets" ], "summary": "Wallet All Chains", "description": "Get wallet info across all supported chains.", "operationId": "wallet_all_chains_v1_wallet_all_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/wallet/send-usdc": { "post": { "tags": [ "wallets" ], "summary": "Api Send Usdc", "description": "Send USDC on the specified chain.", "operationId": "api_send_usdc_v1_wallet_send_usdc_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendUsdcRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendUsdcResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/wallet/send-native": { "post": { "tags": [ "wallets" ], "summary": "Api Send Native", "description": "Send native token (ETH/POL/BNB/SOL) on the specified chain.", "operationId": "api_send_native_v1_wallet_send_native_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendNativeRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendNativeResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/card": { "get": { "tags": [ "wallets" ], "summary": "Card Info", "description": "Get virtual card details (last4, expiry, state, spend limit).", "operationId": "card_info_v1_card_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CardResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/card/transactions": { "get": { "tags": [ "wallets" ], "summary": "Card Transactions", "operationId": "card_transactions_v1_card_transactions_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 10, "title": "Limit" } }, { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CardTransactionOut" }, "title": "Response Card Transactions V1 Card Transactions Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/webhook": { "post": { "tags": [ "wallets" ], "summary": "Set Webhook", "operationId": "set_webhook_v1_webhook_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookSetRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "wallets" ], "summary": "Get Webhook", "operationId": "get_webhook_v1_webhook_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "wallets" ], "summary": "Delete Webhook", "operationId": "delete_webhook_v1_webhook_delete", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/approvals/{approval_id}": { "get": { "tags": [ "wallets" ], "summary": "Check Approval", "operationId": "check_approval_v1_approvals__approval_id__get", "parameters": [ { "name": "approval_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Approval Id" } }, { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApprovalStatusResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/x402/pay": { "post": { "tags": [ "wallets" ], "summary": "X402 Pay", "description": "Agent pays for an x402-gated resource using their on-chain wallet.", "operationId": "x402_pay_v1_x402_pay_post", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PayRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PayResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/x402/probe": { "get": { "tags": [ "wallets" ], "summary": "X402 Probe", "description": "Probe a URL to check if it's x402-gated and see pricing. No auth needed.", "operationId": "x402_probe_v1_x402_probe_get", "parameters": [ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "title": "Url" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/agent/identity": { "get": { "tags": [ "identity" ], "summary": "Get Own Identity", "description": "Get the authenticated agent's identity profile.", "operationId": "get_own_identity_v1_agent_identity_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "tags": [ "identity" ], "summary": "Upsert Identity", "description": "Create or update the authenticated agent's identity profile.", "operationId": "upsert_identity_v1_agent_identity_put", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentIdentityUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/agent/identity/score": { "get": { "tags": [ "identity" ], "summary": "Get Trust Score", "description": "Get detailed trust score breakdown for the authenticated agent.", "operationId": "get_trust_score_v1_agent_identity_score_get", "parameters": [ { "name": "X-API-Key", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/directory": { "get": { "tags": [ "identity" ], "summary": "Agent Directory", "description": "Public agent directory \u2014 browse registered agents with optional category filter.", "operationId": "agent_directory_v1_directory_get", "parameters": [ { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/directory/{agent_id}": { "get": { "tags": [ "identity" ], "summary": "Agent Public Profile", "description": "Get a public agent profile by agent ID.", "operationId": "agent_public_profile_v1_directory__agent_id__get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/admin/revenue": { "get": { "tags": [ "admin" ], "summary": "Get Revenue", "description": "Platform revenue summary. Admin only.", "operationId": "get_revenue_v1_admin_revenue_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/v1/admin/withdraw": { "post": { "tags": [ "admin" ], "summary": "Withdraw Revenue", "description": "Withdraw accumulated platform fees as USDC to owner wallet. Admin only.", "operationId": "withdraw_revenue_v1_admin_withdraw_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/v1/auth/telegram": { "post": { "tags": [ "miniapp" ], "summary": "Auth Telegram", "description": "Validate Telegram Mini App initData and return a JWT token.\nIn dev mode (no BOT_TOKEN), accepts any initData for testing.", "operationId": "auth_telegram_v1_auth_telegram_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TelegramAuthRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TelegramAuthResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp List Agents", "description": "List all agents belonging to the authenticated Telegram user.", "operationId": "miniapp_list_agents_v1_miniapp_agents_get", "parameters": [ { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/transactions": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Transactions", "description": "Get transactions for a specific agent (must belong to the user).", "operationId": "miniapp_agent_transactions_v1_miniapp_agents__agent_id__transactions_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Type" } }, { "name": "date", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Date" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/settings": { "patch": { "tags": [ "miniapp" ], "summary": "Miniapp Update Agent Settings", "description": "Update agent settings (limits, active status).", "operationId": "miniapp_update_agent_settings_v1_miniapp_agents__agent_id__settings_patch", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentSettingsUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/card": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Card", "description": "Get virtual card details for an agent.", "operationId": "miniapp_agent_card_v1_miniapp_agents__agent_id__card_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/card/{action}": { "post": { "tags": [ "miniapp" ], "summary": "Miniapp Toggle Card", "description": "Pause or resume a virtual card.", "operationId": "miniapp_toggle_card_v1_miniapp_agents__agent_id__card__action__post", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "action", "in": "path", "required": true, "schema": { "type": "string", "title": "Action" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/wallet": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Wallet", "description": "Get on-chain wallet info for an agent on a specific chain.", "operationId": "miniapp_agent_wallet_v1_miniapp_agents__agent_id__wallet_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "chain", "in": "query", "required": false, "schema": { "type": "string", "default": "base", "title": "Chain" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/wallet/all": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Wallet All", "description": "Get wallet balances across all chains for an agent.", "operationId": "miniapp_agent_wallet_all_v1_miniapp_agents__agent_id__wallet_all_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/dashboard": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Dashboard", "description": "Main dashboard data \u2014 overview of all agents, balances, and activity.", "operationId": "miniapp_dashboard_v1_miniapp_dashboard_get", "parameters": [ { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/analytics": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Analytics", "description": "Agent analytics \u2014 daily volume, spending breakdown, hourly heatmap, balance history.", "operationId": "miniapp_agent_analytics_v1_miniapp_agents__agent_id__analytics_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/miniapp/agents/{agent_id}/identity": { "get": { "tags": [ "miniapp" ], "summary": "Miniapp Agent Identity", "description": "Get an agent's identity card (for dashboard display).", "operationId": "miniapp_agent_identity_v1_miniapp_agents__agent_id__identity_get", "parameters": [ { "name": "agent_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Agent Id" } }, { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string", "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/agent/payee-rules": { "get": { "tags": [ "payee-rules" ], "summary": "List payee rules", "description": "List all payee allow/deny rules for the authenticated agent.", "operationId": "listPayeeRules", "security": [ { "ApiKeyAuth": [] } ], "responses": { "200": { "description": "List of payee rules", "content": { "application/json": { "schema": { "type": "object", "properties": { "rules": { "type": "array", "items": { "$ref": "#/components/schemas/PayeeRule" } } } } } } } } }, "post": { "tags": [ "payee-rules" ], "summary": "Create payee rule", "description": "Create an allow or deny rule for a specific payee (agent_id, domain, category, or address).", "operationId": "createPayeeRule", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayeeRuleCreate" } } } }, "responses": { "201": { "description": "Rule created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayeeRule" } } } } } } }, "/v1/agent/payee-rules/{rule_id}": { "delete": { "tags": [ "payee-rules" ], "summary": "Delete payee rule", "description": "Delete a payee rule by ID.", "operationId": "deletePayeeRule", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "name": "rule_id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Rule deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" } } } } } } } } } }, "components": { "schemas": { "AgentIdentityUpdate": { "properties": { "display_name": { "type": "string", "maxLength": 255, "title": "Display Name" }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ], "title": "Description" }, "homepage_url": { "anyOf": [ { "type": "string", "maxLength": 512 }, { "type": "null" } ], "title": "Homepage Url" }, "logo_url": { "anyOf": [ { "type": "string", "maxLength": 512 }, { "type": "null" } ], "title": "Logo Url" }, "category": { "anyOf": [ { "type": "string", "maxLength": 50 }, { "type": "null" } ], "title": "Category" }, "metadata_json": { "anyOf": [ { "type": "string", "maxLength": 10000 }, { "type": "null" } ], "title": "Metadata Json" } }, "type": "object", "required": [ "display_name" ], "title": "AgentIdentityUpdate" }, "AgentSettingsUpdate": { "properties": { "daily_limit_usd": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Daily Limit Usd" }, "tx_limit_usd": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Tx Limit Usd" }, "auto_approve_usd": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Auto Approve Usd" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "type": "object", "title": "AgentSettingsUpdate" }, "ApprovalStatusResponse": { "properties": { "approval_id": { "type": "string", "title": "Approval Id" }, "agent_id": { "type": "string", "title": "Agent Id" }, "amount_usd": { "type": "number", "title": "Amount Usd" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "resolved": { "type": "boolean", "title": "Resolved" }, "result": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Result" } }, "type": "object", "required": [ "approval_id", "agent_id", "amount_usd", "description", "resolved" ], "title": "ApprovalStatusResponse" }, "BalanceResponse": { "properties": { "agent_id": { "type": "string", "title": "Agent Id" }, "agent_name": { "type": "string", "title": "Agent Name" }, "balance_usd": { "type": "number", "title": "Balance Usd" }, "daily_limit_usd": { "type": "number", "title": "Daily Limit Usd" }, "daily_spent_usd": { "type": "number", "title": "Daily Spent Usd" }, "daily_remaining_usd": { "type": "number", "title": "Daily Remaining Usd" }, "tx_limit_usd": { "type": "number", "title": "Tx Limit Usd" }, "is_active": { "type": "boolean", "title": "Is Active" } }, "type": "object", "required": [ "agent_id", "agent_name", "balance_usd", "daily_limit_usd", "daily_spent_usd", "daily_remaining_usd", "tx_limit_usd", "is_active" ], "title": "BalanceResponse" }, "CardResponse": { "properties": { "last4": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Last4" }, "exp_month": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Exp Month" }, "exp_year": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Exp Year" }, "state": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "State" }, "spend_limit_cents": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Spend Limit Cents" } }, "type": "object", "required": [ "last4", "exp_month", "exp_year", "state", "spend_limit_cents" ], "title": "CardResponse" }, "CardTransactionOut": { "properties": { "amount_cents": { "type": "integer", "title": "Amount Cents" }, "merchant": { "type": "string", "title": "Merchant" }, "status": { "type": "string", "title": "Status" }, "created": { "type": "string", "title": "Created" } }, "type": "object", "required": [ "amount_cents", "merchant", "status", "created" ], "title": "CardTransactionOut" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "HealthResponse": { "properties": { "status": { "type": "string", "title": "Status" }, "service": { "type": "string", "title": "Service" }, "version": { "type": "string", "title": "Version" } }, "type": "object", "required": [ "status", "service", "version" ], "title": "HealthResponse" }, "RefundRequest": { "properties": { "transaction_id": { "type": "string", "title": "Transaction Id", "description": "ID of the spend transaction to refund" } }, "type": "object", "required": [ "transaction_id" ], "title": "RefundRequest" }, "RefundResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "refund_transaction_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Refund Transaction Id" }, "amount_refunded": { "type": "number", "title": "Amount Refunded", "default": 0 }, "new_balance": { "type": "number", "title": "New Balance", "default": 0 }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "RefundResponse" }, "RotateKeyResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "new_api_key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "New Api Key" }, "key_prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Key Prefix" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "RotateKeyResponse" }, "SendNativeRequest": { "properties": { "to_address": { "type": "string", "title": "To Address" }, "amount": { "type": "number", "maximum": 100.0, "exclusiveMinimum": 0.0, "title": "Amount" }, "chain": { "type": "string", "title": "Chain", "description": "Chain to send on: base, polygon, bnb, solana", "default": "base" } }, "type": "object", "required": [ "to_address", "amount" ], "title": "SendNativeRequest" }, "SendNativeResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "tx_hash": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tx Hash" }, "amount": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Amount" }, "to": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "To" }, "chain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Chain" }, "native_token": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Native Token" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "SendNativeResponse" }, "SendUsdcRequest": { "properties": { "to_address": { "type": "string", "title": "To Address" }, "amount": { "type": "number", "maximum": 10000.0, "exclusiveMinimum": 0.0, "title": "Amount" }, "chain": { "type": "string", "title": "Chain", "description": "Chain to send on: base, polygon, bnb, solana", "default": "base" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "to_address", "amount" ], "title": "SendUsdcRequest" }, "SendUsdcResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "tx_hash": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tx Hash" }, "amount": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Amount" }, "to": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "To" }, "chain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Chain" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "SendUsdcResponse" }, "SpendRequest": { "properties": { "amount": { "type": "number", "maximum": 10000.0, "exclusiveMinimum": 0.0, "title": "Amount", "description": "Amount in USD" }, "description": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ], "title": "Description" }, "idempotency_key": { "anyOf": [ { "type": "string", "maxLength": 64 }, { "type": "null" } ], "title": "Idempotency Key", "description": "Prevent duplicate charges" }, "skip_approval": { "type": "boolean", "title": "Skip Approval", "description": "Skip approval workflow (only works within auto-approve limit)", "default": false } }, "type": "object", "required": [ "amount" ], "title": "SpendRequest" }, "SpendResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "transaction_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Transaction Id" }, "amount": { "type": "number", "title": "Amount" }, "fee": { "type": "number", "title": "Fee" }, "remaining_balance": { "type": "number", "title": "Remaining Balance" }, "approval_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Approval Id" }, "status": { "type": "string", "title": "Status", "default": "completed" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success", "amount", "fee", "remaining_balance" ], "title": "SpendResponse" }, "TelegramAuthRequest": { "properties": { "init_data": { "type": "string", "title": "Init Data", "description": "Telegram Web App initData string" } }, "type": "object", "required": [ "init_data" ], "title": "TelegramAuthRequest" }, "TelegramAuthResponse": { "properties": { "token": { "type": "string", "title": "Token" }, "user_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "User Name" }, "telegram_id": { "type": "integer", "title": "Telegram Id" } }, "type": "object", "required": [ "token", "telegram_id" ], "title": "TelegramAuthResponse" }, "TransactionOut": { "properties": { "id": { "type": "string", "title": "Id" }, "type": { "type": "string", "title": "Type" }, "amount": { "type": "number", "title": "Amount" }, "fee": { "type": "number", "title": "Fee" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "status": { "type": "string", "title": "Status" }, "created_at": { "type": "string", "title": "Created At" } }, "type": "object", "required": [ "id", "type", "amount", "fee", "description", "status", "created_at" ], "title": "TransactionOut" }, "TransferRequest": { "properties": { "to_agent_id": { "type": "string", "title": "To Agent Id", "description": "Target agent ID to transfer to" }, "amount": { "type": "number", "maximum": 10000.0, "exclusiveMinimum": 0.0, "title": "Amount", "description": "Amount to transfer" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "to_agent_id", "amount" ], "title": "TransferRequest" }, "TransferResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "transaction_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Transaction Id" }, "amount": { "type": "number", "title": "Amount", "default": 0 }, "from_balance": { "type": "number", "title": "From Balance", "default": 0 }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "TransferResponse" }, "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" }, "WebhookResponse": { "properties": { "url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Url" }, "secret": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Secret" }, "events": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Events" } }, "type": "object", "required": [ "url", "secret", "events" ], "title": "WebhookResponse" }, "WebhookSetRequest": { "properties": { "url": { "type": "string", "maxLength": 512, "title": "Url", "description": "HTTPS URL for webhook delivery" }, "events": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Events", "description": "Event types to subscribe to (default: all)" } }, "type": "object", "required": [ "url" ], "title": "WebhookSetRequest" }, "X402PayRequest": { "properties": { "url": { "type": "string", "title": "Url", "description": "x402-gated resource URL" }, "method": { "type": "string", "title": "Method", "description": "HTTP method", "default": "GET" }, "body": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Body", "description": "Request body for POST" }, "max_price_usd": { "type": "number", "maximum": 100.0, "exclusiveMinimum": 0.0, "title": "Max Price Usd", "description": "Max price willing to pay", "default": 1.0 } }, "type": "object", "required": [ "url" ], "title": "X402PayRequest" }, "X402PayResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "status": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Status" }, "data": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Data" }, "paid_usd": { "type": "number", "title": "Paid Usd", "default": 0 }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } }, "type": "object", "required": [ "success" ], "title": "X402PayResponse" }, "PayeeRuleCreate": { "type": "object", "required": [ "payee_type", "payee_value" ], "properties": { "rule_type": { "type": "string", "enum": [ "allow", "deny" ], "default": "allow" }, "payee_type": { "type": "string", "enum": [ "agent_id", "domain", "category", "address" ] }, "payee_value": { "type": "string", "minLength": 1, "maxLength": 512 }, "max_amount_usd": { "type": "number", "nullable": true, "minimum": 0 }, "note": { "type": "string", "nullable": true, "maxLength": 255 } } }, "PayeeRule": { "type": "object", "properties": { "id": { "type": "string" }, "rule_type": { "type": "string" }, "payee_type": { "type": "string" }, "payee_value": { "type": "string" }, "max_amount_usd": { "type": "number", "nullable": true }, "note": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" } } } } } }