{"openapi":"3.1.0","info":{"title":"FereAI Gateway","description":"Unified API for AI-powered crypto trading and research across multiple blockchains.","version":"1.0.0"},"servers":[{"url":"https://api.fereai.xyz","description":"Production"},{"url":"https://stag-api.fereai.xyz","description":"Staging"},{"url":"http://localhost:8003","description":"Local"}],"paths":{"/capabilities":{"get":{"tags":["discovery"],"summary":"Capabilities","operationId":"capabilities_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesResponse"}}}}}}},"/health":{"get":{"tags":["discovery"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/chains":{"get":{"tags":["chains"],"summary":"Get Supported Chains","description":"Supported blockchains and their chain IDs.\n\nProxies to wallet service GET /chains/supported-chains/.","operationId":"get_supported_chains_v1_chains_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainsResponse"}}}}}}},"/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register","description":"Start agent registration. Returns a challenge to sign.\n\nIf the public key is already registered, returns 409 with\nthe existing agent_id hint.","operationId":"register_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/verify":{"post":{"tags":["auth"],"summary":"Verify","description":"Complete registration. Proves keypair ownership,\nsigns up with Friday, provisions wallets + credits.","operationId":"verify_v1_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/token":{"post":{"tags":["auth"],"summary":"Token","description":"Exchange agent_id + signed timestamp for bearer token.","operationId":"token_v1_auth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/signup":{"post":{"tags":["auth"],"summary":"Signup","description":"Sign up via Clerk JWT. Proxies request body as-is to Friday.\n\nFlow:\n1. require_clerk_auth validates JWT → clerk_user_id\n2. Verify identity ownership via Clerk API\n3. Proxy raw body to Friday POST /signup\n4. Cache clerk_user_id → friday_user_id","operationId":"signup_signup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/chat":{"post":{"tags":["chat"],"summary":"Create Chat Sse","description":"Chat with the AI agent via SSE streaming.\n\nConnects to Friday's WebSocket internally and bridges the response as Server-Sent Events.\n\n**SSE event types:**\n- `meta` — `{chat_id}` — first event, identifies the thread\n- `planning` — `{v4_event, data}` — agent planning steps\n- `tool_call` — `{v4_event, data}` — agent tool invocations\n- `tool_response` — `{type, data}` — tool output data\n- `chunk` — `{text}` — streaming text chunk\n- `answer` — `{text}` — final answer text\n- `done` — `{chat_id, status, credits_used, credits_remaining}` — stream complete\n- `error` — `{message}` — error occurred","operationId":"create_chat_sse_v1_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/threads":{"get":{"tags":["chat"],"summary":"List Threads","description":"List chat threads for the current user.","operationId":"list_threads_v1_chat_threads_get","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"},"title":"Response List Threads V1 Chat Threads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/threads/{thread_id}":{"get":{"tags":["chat"],"summary":"Get Thread","description":"Get all messages in a chat thread.","operationId":"get_thread_v1_chat_threads__thread_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","description":"Chat thread UUID.","title":"Thread Id"},"description":"Chat thread UUID."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadMessage"},"title":"Response Get Thread V1 Chat Threads  Thread Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/swap":{"post":{"tags":["swap"],"summary":"Create Swap","description":"Execute a token swap.\n\nHandles same-chain swaps, cross-chain swaps, and\nEVM↔Solana bridging in one unified call.\n\nUse ?wait=true&timeout=60 to block until the swap\ncompletes instead of receiving a task_id.","operationId":"create_swap_v1_swap_post","parameters":[{"name":"wait","in":"query","required":false,"schema":{"type":"boolean","description":"Block until task completes","default":false,"title":"Wait"},"description":"Block until task completes"},{"name":"timeout","in":"query","required":false,"schema":{"type":"integer","maximum":300,"minimum":5,"description":"Timeout in seconds when wait=true","default":60,"title":"Timeout"},"description":"Timeout in seconds when wait=true"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/limit-orders":{"post":{"tags":["limit_orders"],"summary":"Create Limit Order","description":"Create a limit order.","operationId":"create_limit_order_v1_limit_orders_post","parameters":[{"name":"wait","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Wait"}},{"name":"timeout","in":"query","required":false,"schema":{"type":"integer","maximum":300,"minimum":5,"default":60,"title":"Timeout"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["limit_orders"],"summary":"List Limit Orders","description":"List all limit orders for the current user.","operationId":"list_limit_orders_v1_limit_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LimitOrderStatus"},"title":"Response List Limit Orders V1 Limit Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/limit-orders/{order_id}":{"get":{"tags":["limit_orders"],"summary":"Get Limit Order","description":"Get status of a specific limit order.","operationId":"get_limit_order_v1_limit_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","description":"Limit order ID.","title":"Order Id"},"description":"Limit order ID."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitOrderStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["limit_orders"],"summary":"Cancel Limit Order","description":"Cancel a limit order.","operationId":"cancel_limit_order_v1_limit_orders__order_id__delete","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","description":"Limit order ID to cancel.","title":"Order Id"},"description":"Limit order ID to cancel."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitOrderStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/hooks":{"post":{"tags":["hooks"],"summary":"Set Hooks","description":"Set stop-loss and/or take-profit hooks on a token.","operationId":"set_hooks_v1_hooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HooksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HooksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/wallets":{"get":{"tags":["wallets"],"summary":"Get Wallets","description":"Get wallet addresses (EVM + Solana) for the user.\n\nWallets are auto-provisioned on signup — no creation\nendpoint needed.","operationId":"get_wallets_v1_wallets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletsResponse"}}}}}}},"/v1/holdings":{"get":{"tags":["wallets"],"summary":"Get Holdings","description":"Get token holdings across all chains.","operationId":"get_holdings_v1_holdings_get","parameters":[{"name":"chain_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chain Type"}},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task Status","description":"Poll async task status.\n\nFor environments where SSE isn't practical. Prefer\nGET /v1/notifications/stream for real-time updates\nor POST /v1/swap?wait=true for synchronous mode.","operationId":"get_task_status_v1_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","description":"Celery task ID to check status for.","title":"Task Id"},"description":"Celery task ID to check status for."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits":{"get":{"tags":["credits"],"summary":"Get Credits","description":"Get credit balance for the current user.","operationId":"get_credits_v1_credits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}}}}},"/v1/user":{"get":{"tags":["user"],"summary":"Get User","description":"Get current user info.","operationId":"get_user_v1_user_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}}}},"/schedule_chat":{"post":{"tags":["webapp-schedule-chat"],"summary":"Create Schedule Chat","description":"Create a scheduled chat (#13) — inject user_id into body.","operationId":"create_schedule_chat_schedule_chat_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/get_schedule_chats":{"get":{"tags":["webapp-schedule-chat"],"summary":"Get Schedule Chats","description":"Get scheduled chats (#14) — inject user_id into query.","operationId":"get_schedule_chats_get_schedule_chats_get","parameters":[{"name":"filter_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/update_schedule_chat":{"put":{"tags":["webapp-schedule-chat"],"summary":"Update Schedule Chat","description":"Update a scheduled chat (#15) — inject user_id into body.","operationId":"update_schedule_chat_update_schedule_chat_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/disable_schedule_chats":{"put":{"tags":["webapp-schedule-chat"],"summary":"Disable Schedule Chats","description":"Disable scheduled chats (#16) — inject user_id into path.","operationId":"disable_schedule_chats_disable_schedule_chats_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/schedule-chat/list":{"get":{"tags":["webapp-schedule-chat"],"summary":"List Schedule Chats","description":"List scheduled chats (#17) — inject x-fere-userid header.","operationId":"list_schedule_chats_schedule_chat_list_get","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedule-chat/schedule/{schedule_id}":{"get":{"tags":["webapp-schedule-chat"],"summary":"Get Schedule Chat Detail","description":"Get schedule with executions (#18) — x-fere-userid.","operationId":"get_schedule_chat_detail_schedule_chat_schedule__schedule_id__get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedule-chat/execution/{execution_id}/rate":{"post":{"tags":["webapp-schedule-chat"],"summary":"Rate Schedule Execution","description":"Rate a schedule execution (#19) — inject x-fere-userid header.","operationId":"rate_schedule_execution_schedule_chat_execution__execution_id__rate_post","parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credits/recharge-chains":{"get":{"tags":["webapp-credits-recharge"],"summary":"Get Recharge Chains","description":"Chains allowed for native-token recharge (Friday CHAIN_ID_TO_NAME).","operationId":"get_recharge_chains_credits_recharge_chains_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/credits/packs":{"get":{"tags":["webapp-credits-recharge"],"summary":"Get Credit Packs","description":"Available credit pack tiers from Friday.\n\nReturns fixed pack tiers with USD amounts and credit grants:\n- $5 pack → 300 credits\n- $10 pack → 650 credits\n- $20 pack → 1,400 credits","operationId":"get_credit_packs_credits_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/credits/onchain-recharge":{"post":{"tags":["webapp-credits-recharge"],"summary":"Post Onchain Recharge","description":"Start async recharge via Friday `recharge_tool`.","operationId":"post_onchain_recharge_credits_onchain_recharge_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Onchain Recharge Credits Onchain Recharge Post"}}}}}}},"/polymarket/setup/status":{"get":{"tags":["webapp-polymarket"],"summary":"Get Polymarket Setup Status","description":"Polymarket setup status (#67) — inject agent_id + app_id query.","operationId":"get_polymarket_setup_status_polymarket_setup_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/setup":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Setup","description":"Polymarket setup (#68) — inject agent_id + app_id into body.","operationId":"polymarket_setup_polymarket_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/setup/v2":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Setup V2","description":"Polymarket v2 migration (#setup-v2) — inject agent_id + app_id.","operationId":"polymarket_setup_v2_polymarket_setup_v2_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/order":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Order","description":"Polymarket order (#69) — inject agent_id + app_id into body.","operationId":"polymarket_order_polymarket_order_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/fund-safe":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Fund Safe","description":"Polymarket fund safe — inject agent_id + app_id into body.","operationId":"polymarket_fund_safe_polymarket_fund_safe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/withdraw":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Withdraw","description":"Polymarket withdraw — inject agent_id + app_id into body.","operationId":"polymarket_withdraw_polymarket_withdraw_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/orders/open":{"get":{"tags":["webapp-polymarket"],"summary":"Get Polymarket Open Orders","description":"Polymarket open CLOB orders — proxy to wallet service.","operationId":"get_polymarket_open_orders_polymarket_orders_open_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/activity":{"get":{"tags":["webapp-polymarket"],"summary":"Get Polymarket Activity","description":"Polymarket trade history + PnL — proxy to wallet service.","operationId":"get_polymarket_activity_polymarket_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/polymarket/order/cancel":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Order Cancel","description":"Polymarket cancel order — inject agent_id + app_id into body.","operationId":"polymarket_order_cancel_polymarket_order_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/disclaimer/acknowledge":{"post":{"tags":["webapp-polymarket"],"summary":"Acknowledge Polymarket Disclaimer","description":"Acknowledge the Polymarket trading disclaimer — passthrough to Friday.","operationId":"acknowledge_polymarket_disclaimer_polymarket_disclaimer_acknowledge_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/polymarket/redeem":{"post":{"tags":["webapp-polymarket"],"summary":"Polymarket Redeem","description":"Polymarket redeem — inject agent_id + app_id into body.","operationId":"polymarket_redeem_polymarket_redeem_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/wallet/outstanding-orders":{"get":{"tags":["webapp-wallet"],"summary":"Get Outstanding Orders","description":"Outstanding orders (#52) — inject agent_id into query.","operationId":"get_outstanding_orders_wallet_outstanding_orders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["webapp-wallet"],"summary":"Delete Outstanding Orders","description":"Delete outstanding orders (#53) — inject agent_id.","operationId":"delete_outstanding_orders_wallet_outstanding_orders_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CapabilitiesResponse":{"properties":{"chat":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chat","description":"Chat endpoints and capabilities."},"trading":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trading","description":"Trading endpoints (swap, limit orders, hooks)."},"earn":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Earn","description":"Yield/earn endpoints and supported assets."},"wallets":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Wallets","description":"Wallet and holdings endpoints."},"notifications":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Notifications","description":"Notification endpoints (REST + SSE stream)."},"chains":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chains","description":"Supported blockchain chains."},"auth":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Auth","description":"Authentication flow description."},"protocols":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Protocols","description":"Supported communication protocols."}},"type":"object","title":"CapabilitiesResponse","description":"Capabilities manifest. Sections are gated by\n`release_gates.RELEASED_CAPABILITIES`; unreleased sections are\nomitted entirely so the manifest stays consistent with /openapi.json.","example":{}},"ChainInfo":{"properties":{"chain_id":{"type":"string","title":"Chain Id","description":"Chain ID as string."},"name":{"type":"string","title":"Name","description":"Internal chain name."},"display_name":{"type":"string","title":"Display Name","description":"Human-readable chain name."},"native_token":{"type":"string","title":"Native Token","description":"Native token symbol (e.g., ETH, SOL)."},"is_evm":{"type":"boolean","title":"Is Evm","description":"Whether this is an EVM-compatible chain."},"supported_operations":{"items":{"type":"string"},"type":"array","title":"Supported Operations","description":"List of supported operations: swap, bridge, transfer."}},"additionalProperties":true,"type":"object","required":["chain_id","name","display_name","native_token","is_evm","supported_operations"],"title":"ChainInfo","description":"Information about a supported blockchain.","example":{"chain_id":"8453","display_name":"Base","is_evm":true,"name":"base","native_token":"ETH","supported_operations":["swap","bridge","transfer"]}},"ChainsResponse":{"properties":{"chains":{"items":{"$ref":"#/components/schemas/ChainInfo"},"type":"array","title":"Chains","description":"Supported blockchains and their capabilities."}},"type":"object","required":["chains"],"title":"ChainsResponse","description":"List of supported blockchains.","example":{"chains":[{"chain_id":"8453","display_name":"Base","is_evm":true,"name":"base","native_token":"ETH","supported_operations":["swap","bridge","transfer"]}]}},"ChatRequest":{"properties":{"query":{"type":"string","title":"Query","description":"Message to send to the AI agent.","examples":["What is the price of ETH?"]},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"Thread ID to continue a conversation. Omit to start a new thread.","examples":["550e8400-e29b-41d4-a716-446655440000"]},"stream":{"type":"boolean","title":"Stream","description":"Whether to stream the response via SSE.","default":true},"agent":{"type":"string","title":"Agent","description":"Agent to use: ProAgent, ProDeepResearchAgent, MarketAnalyzerAgent.","default":"ProAgent"}},"type":"object","required":["query"],"title":"ChatRequest","example":{"agent":"ProAgent","query":"What is the price of ETH?","stream":true}},"CheckoutRequest":{"properties":{"price_id":{"type":"string","minLength":1,"title":"Price Id","description":"Stripe Price ID for the target plan."},"client_intent_id":{"type":"string","minLength":1,"title":"Client Intent Id","description":"Webapp-generated UUID4 (sessionStorage) used for Stripe Session reuse window (HLD §5.6)."}},"type":"object","required":["price_id","client_intent_id"],"title":"CheckoutRequest","description":"Body for ``POST /v1/subscriptions/checkout`` — mirrors Friday."},"CreditsResponse":{"properties":{"credits_available":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credits Available","description":"Number of credits available for the user.","examples":[185.0]}},"type":"object","required":["credits_available"],"title":"CreditsResponse","example":{"credits_available":185.0}},"DepositRequest":{"properties":{"amount_usdc":{"type":"number","exclusiveMinimum":0.0,"title":"Amount Usdc","description":"Amount of USDC to deposit.","examples":[100.0]},"position_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position Id","description":"Existing position ID to deposit into. Omit to create a new position."}},"type":"object","required":["amount_usdc"],"title":"DepositRequest","example":{"amount_usdc":100.0}},"EarnHistoryEntry":{"properties":{"id":{"type":"string","title":"Id","description":"History entry ID.","default":""},"position_id":{"type":"string","title":"Position Id","description":"Associated position ID.","default":""},"action_type":{"type":"string","title":"Action Type","description":"Action type: deposit, withdraw.","default":""},"amount_usdc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usdc","description":"Amount in USDC."},"status":{"type":"string","title":"Status","description":"Entry status: pending, completed, failed.","default":""},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 timestamp."}},"additionalProperties":true,"type":"object","title":"EarnHistoryEntry","description":"A single yield action history entry."},"EarnInfoResponse":{"properties":{"product":{"type":"string","title":"Product","description":"Product name.","default":"Fere Earn"},"description":{"type":"string","title":"Description","description":"Product description.","default":"The premier yield service for AI agents. Deposit USDC and earn optimized returns through institutional-grade DeFi vaults."},"current_apy_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Apy Percent","description":"Current gross APY percentage.","examples":[8.5]},"net_apy_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Apy Percent","description":"Net APY after fees.","examples":[7.2]},"vault":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Vault","description":"Vault details: name, chain, asset, total_assets_usd, fees."},"why_fere_earn":{"items":{"type":"string"},"type":"array","title":"Why Fere Earn","description":"Marketing bullet points.","default":["Best-in-class APY on USDC across DeFi","Institutional-grade vaults powered by Morpho","Fully automated — no manual management","Built specifically for AI agents and programmatic access","Cross-chain deposits supported (Base, Arbitrum)"]}},"type":"object","title":"EarnInfoResponse","example":{"current_apy_percent":8.5,"net_apy_percent":7.2,"product":"Fere Earn","vault":{"asset":"USDC","chain":"base","chain_id":8453,"name":"Morpho USDC"}}},"EarnPosition":{"properties":{"id":{"type":"string","title":"Id","description":"Position ID (UUID)."},"agent_id":{"type":"string","title":"Agent Id","description":"Agent that owns the position."},"status":{"type":"string","title":"Status","description":"Position status: active, withdrawn."},"vault_name":{"type":"string","title":"Vault Name","description":"Name of the vault.","default":""},"vault_chain_name":{"type":"string","title":"Vault Chain Name","description":"Chain where the vault is deployed.","default":""},"current_apy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Apy","description":"Current vault APY percentage."},"amount_deposited_usdc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Deposited Usdc","description":"Total USDC deposited."},"current_value_usdc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value Usdc","description":"Current value of the position in USDC."},"unrealized_yield_usdc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unrealized Yield Usdc","description":"Unrealized yield in USDC."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 creation timestamp."}},"additionalProperties":true,"type":"object","required":["id","agent_id","status"],"title":"EarnPosition","description":"Summary of a yield position.","example":{"agent_id":"agent_abc123","amount_deposited_usdc":1000.0,"created_at":"2026-02-15T10:00:00Z","current_apy":8.5,"current_value_usdc":1025.0,"id":"pos-abc123","status":"active","unrealized_yield_usdc":25.0,"vault_chain_name":"base","vault_name":"Morpho USDC"}},"EarnPositionsResponse":{"properties":{"positions":{"items":{"$ref":"#/components/schemas/EarnPosition"},"type":"array","title":"Positions","description":"List of yield positions."},"history":{"items":{"$ref":"#/components/schemas/EarnHistoryEntry"},"type":"array","title":"History","description":"Activity history entries."}},"additionalProperties":true,"type":"object","title":"EarnPositionsResponse","description":"Positions and activity history.","example":{"history":[],"positions":[{"agent_id":"agent_abc123","amount_deposited_usdc":1000.0,"current_apy":8.5,"current_value_usdc":1025.0,"id":"pos-abc123","status":"active","unrealized_yield_usdc":25.0,"vault_chain_name":"base","vault_name":"Morpho USDC"}]}},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Service health status.","examples":["ok"]},"service":{"type":"string","title":"Service","description":"Service name.","examples":["gateway_service"]}},"type":"object","required":["status","service"],"title":"HealthResponse"},"HoldingsResponse":{"properties":{"holdings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Holdings","description":"Token holdings across all chains. Each entry includes token address, symbol, balance, chain, and USD value."}},"type":"object","required":["holdings"],"title":"HoldingsResponse","example":{"holdings":[{"balance":"1000.0","chain":"base","symbol":"USDC","token_address":"0x8335…2913","usd_value":1000.0}]}},"HookConfig":{"properties":{"price_percentage":{"type":"number","title":"Price Percentage","description":"Price percentage trigger (e.g., 0.3 for -30% stop-loss, 1.0 for +100% take-profit).","examples":[0.3]},"sell_percentage":{"type":"number","title":"Sell Percentage","description":"Fraction of holdings to sell when triggered (0.0 to 1.0, where 1.0 = sell all).","examples":[1.0]}},"type":"object","required":["price_percentage","sell_percentage"],"title":"HookConfig"},"HooksRequest":{"properties":{"chain_id":{"type":"integer","title":"Chain Id","description":"Chain ID where the token is held.","examples":[8453]},"token_address":{"type":"string","title":"Token Address","description":"Token address to set hooks on.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"stop_loss":{"anyOf":[{"$ref":"#/components/schemas/HookConfig"},{"type":"null"}],"description":"Stop-loss configuration."},"take_profit":{"anyOf":[{"$ref":"#/components/schemas/HookConfig"},{"type":"null"}],"description":"Take-profit configuration."}},"type":"object","required":["chain_id","token_address"],"title":"HooksRequest","example":{"chain_id":8453,"stop_loss":{"price_percentage":0.3,"sell_percentage":1.0},"take_profit":{"price_percentage":1.0,"sell_percentage":0.5},"token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"HooksResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Task ID for tracking the hook setup."},"agent_id":{"type":"string","title":"Agent Id","description":"Agent that owns the hooks."},"token_address":{"type":"string","title":"Token Address","description":"Token address the hooks are set on."},"hooks_registered":{"type":"integer","title":"Hooks Registered","description":"Number of hooks registered."}},"additionalProperties":true,"type":"object","required":["task_id","agent_id","token_address","hooks_registered"],"title":"HooksResponse","description":"Response from setting stop-loss / take-profit hooks.","example":{"agent_id":"agent_abc123","hooks_registered":2,"task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"LimitOrderRequest":{"properties":{"chain_id_in":{"type":"integer","title":"Chain Id In","description":"Source chain ID.","examples":[8453]},"chain_id_out":{"type":"integer","title":"Chain Id Out","description":"Destination chain ID.","examples":[8453]},"token_in":{"type":"string","title":"Token In","description":"Input token contract address.","examples":["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"]},"token_out":{"type":"string","title":"Token Out","description":"Output token contract address.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"amount":{"type":"string","title":"Amount","description":"Amount in smallest unit (wei/lamports).","examples":["1000000000000000000"]},"price_usd_trigger":{"type":"number","title":"Price Usd Trigger","description":"USD price that triggers the order execution.","examples":[3500.0]},"trigger_token_address":{"type":"string","title":"Trigger Token Address","description":"Token address to monitor for the price trigger.","examples":["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"]},"trigger_token_chain":{"type":"string","title":"Trigger Token Chain","description":"Chain of the trigger token (chain name or ID).","examples":["base"]},"condition":{"type":"string","title":"Condition","description":"Trigger condition: 'gte' (above price) or 'lte' (below price).","examples":["gte"]},"slippage_bps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Slippage Bps","description":"Slippage tolerance in basis points.","default":50,"examples":[50]},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"Original user query for context."}},"type":"object","required":["chain_id_in","chain_id_out","token_in","token_out","amount","price_usd_trigger","trigger_token_address","trigger_token_chain","condition"],"title":"LimitOrderRequest","example":{"amount":"1000000000000000000","chain_id_in":8453,"chain_id_out":8453,"condition":"gte","price_usd_trigger":3500.0,"slippage_bps":50,"token_in":"0xEeee...EEeE","token_out":"0x8335...2913","trigger_token_address":"0xEeee...EEeE","trigger_token_chain":"base"}},"LimitOrderStatus":{"properties":{"limit_order_id":{"type":"string","title":"Limit Order Id","description":"Unique limit order identifier."},"agent_id":{"type":"string","title":"Agent Id","description":"Agent that created the order."},"token_in":{"type":"string","title":"Token In","description":"Input token address."},"token_out":{"type":"string","title":"Token Out","description":"Output token address."},"amount":{"type":"string","title":"Amount","description":"Order amount in smallest unit."},"chain_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chain Id","description":"Source chain ID."},"chain_id_out":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chain Id Out","description":"Destination chain ID."},"price_usd_trigger":{"type":"number","title":"Price Usd Trigger","description":"USD trigger price."},"trigger_token_address":{"type":"string","title":"Trigger Token Address","description":"Token being monitored for price."},"trigger_token_chain":{"type":"string","title":"Trigger Token Chain","description":"Chain of the trigger token."},"condition":{"type":"string","title":"Condition","description":"Trigger condition: gte or lte."},"status":{"type":"string","title":"Status","description":"Order status: pending, executed, cancelled, failed."},"buy_token_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buy Token Name","description":"Name of the output token."},"buy_token_symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buy Token Symbol","description":"Symbol of the output token."},"buy_token_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buy Token Logo Url","description":"Logo URL for the output token."},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"Original user query for context."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 creation timestamp."},"executed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executed At","description":"ISO 8601 execution timestamp."},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"ISO 8601 last-updated timestamp."}},"additionalProperties":true,"type":"object","required":["limit_order_id","agent_id","token_in","token_out","amount","price_usd_trigger","trigger_token_address","trigger_token_chain","condition","status"],"title":"LimitOrderStatus","example":{"agent_id":"agent_abc123","amount":"1000000000000000000","buy_token_name":"USD Coin","buy_token_symbol":"USDC","chain_id":8453,"chain_id_out":8453,"condition":"gte","created_at":"2026-03-01T12:00:00Z","limit_order_id":"lo-abc123","price_usd_trigger":3500.0,"status":"pending","token_in":"0xEeee...EEeE","token_out":"0x8335...2913","trigger_token_address":"0xEeee...EEeE","trigger_token_chain":"base"}},"NotificationItem":{"properties":{"id":{"type":"string","title":"Id","description":"Notification ID.","default":""},"type":{"type":"string","title":"Type","description":"Event type (e.g., swap_success, transfer_success).","default":"notification"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Event payload."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 timestamp."}},"additionalProperties":true,"type":"object","title":"NotificationItem","description":"A single notification event.","example":{"created_at":"2026-03-01T12:00:00Z","data":{"token_in":"ETH","token_out":"USDC","tx_hash":"0xabc123..."},"id":"evt-001","type":"swap_success"}},"NotificationsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/NotificationItem"},"type":"array","title":"Events","description":"List of notification events."},"total_count":{"type":"integer","title":"Total Count","description":"Total number of notifications matching the query.","default":0},"limit":{"type":"integer","title":"Limit","description":"Page size used for this response.","default":10},"offset":{"type":"integer","title":"Offset","description":"Offset used for this response.","default":0}},"additionalProperties":true,"type":"object","title":"NotificationsResponse","description":"Paginated list of notifications.","example":{"events":[{"created_at":"2026-03-01T12:00:00Z","data":{"tx_hash":"0xabc123..."},"id":"evt-001","type":"swap_success"}],"limit":10,"offset":0,"total_count":1}},"PolymarketFarmingConfigBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"farming_config":{"$ref":"#/components/schemas/PolymarketFarmingConfigPayload"}},"type":"object","required":["enabled","farming_config"],"title":"PolymarketFarmingConfigBody","description":"Upsert body accepted from webapp.\n\nExtra keys are ignored so client-provided agent_id/app_id/farming_type never\npass through; gateway injects authoritative values below."},"PolymarketFarmingConfigPayload":{"properties":{"buy_interval_s":{"type":"integer","minimum":1.0,"title":"Buy Interval S","default":900},"sell_interval_s":{"type":"integer","minimum":1.0,"title":"Sell Interval S","default":600},"first_buy_delay_s":{"type":"integer","minimum":0.0,"title":"First Buy Delay S","default":30},"first_sell_delay_s":{"type":"integer","minimum":0.0,"title":"First Sell Delay S","default":0},"buy_notional_usd":{"type":"number","exclusiveMinimum":0.0,"title":"Buy Notional Usd","default":10.0},"min_safe_usd":{"type":"number","exclusiveMinimum":0.0,"title":"Min Safe Usd","default":20.0},"gamma_max_pages":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Gamma Max Pages","default":15},"task_poll_s":{"type":"number","maximum":600.0,"exclusiveMinimum":0.0,"title":"Task Poll S","default":2.0},"task_timeout_s":{"type":"number","maximum":3600.0,"exclusiveMinimum":0.0,"title":"Task Timeout S","default":180.0}},"additionalProperties":false,"type":"object","title":"PolymarketFarmingConfigPayload","description":"Polymarket JSONB payload mirrored from wallet_service schemas."},"PolymarketPricesBody":{"properties":{"token_ids":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Token Ids","description":"CLOB token IDs (max 20)"}},"type":"object","title":"PolymarketPricesBody","description":"Body for ``POST /polymarket/prices`` (passthrough to Friday)."},"RegisterRequest":{"properties":{"agent_name":{"type":"string","title":"Agent Name","description":"Human-readable name for the agent.","examples":["my-trading-bot"]},"public_key":{"type":"string","title":"Public Key","description":"Base64-encoded Ed25519 public key.","examples":["MCowBQYDK2VwAyEA..."]}},"type":"object","required":["agent_name","public_key"],"title":"RegisterRequest","example":{"agent_name":"my-trading-bot","public_key":"MCowBQYDK2VwAyEA..."}},"RegisterResponse":{"properties":{"registration_id":{"type":"string","title":"Registration Id","description":"Unique ID for this registration attempt.","examples":["reg_abc123"]},"challenge":{"type":"string","title":"Challenge","description":"Random challenge string to sign with your private key.","examples":["challenge_xyz789"]}},"type":"object","required":["registration_id","challenge"],"title":"RegisterResponse"},"SwapRequest":{"properties":{"chain_id_in":{"type":"integer","title":"Chain Id In","description":"Source chain ID.","examples":[8453]},"chain_id_out":{"type":"integer","title":"Chain Id Out","description":"Destination chain ID. Same as chain_id_in for same-chain swaps.","examples":[8453]},"token_in":{"type":"string","title":"Token In","description":"Input token contract address.","examples":["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"]},"token_out":{"type":"string","title":"Token Out","description":"Output token contract address.","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"]},"amount":{"type":"string","title":"Amount","description":"Amount in smallest unit (wei for EVM, lamports for Solana).","examples":["1000000000000000000"]},"slippage_bps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Slippage Bps","description":"Slippage tolerance in basis points (50 = 0.5%).","default":50,"examples":[50]},"dryrun":{"type":"boolean","title":"Dryrun","description":"Simulate the swap without executing on-chain.","default":false},"stop_loss":{"anyOf":[{"$ref":"#/components/schemas/HookConfig"},{"type":"null"}],"description":"Stop-loss hook configuration."},"take_profit":{"anyOf":[{"$ref":"#/components/schemas/HookConfig"},{"type":"null"}],"description":"Take-profit hook configuration."},"cancel_conditional_orders":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancel Conditional Orders","description":"Cancel existing stop-loss/take-profit orders for this token pair."}},"type":"object","required":["chain_id_in","chain_id_out","token_in","token_out","amount"],"title":"SwapRequest","example":{"amount":"1000000000000000000","chain_id_in":8453,"chain_id_out":8453,"dryrun":false,"slippage_bps":50,"token_in":"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","token_out":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"SwapResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Celery task ID for the swap operation.","examples":["d290f1ee-6c54-4b01-90e6-d701748f0851"]},"status":{"type":"string","title":"Status","description":"Current task status.","default":"queued"},"message":{"type":"string","title":"Message","description":"Human-readable status message.","default":"Swap task queued successfully"},"poll_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poll Url","description":"Relative URL to poll for task status.","examples":["/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851"]},"notification_stream":{"type":"string","title":"Notification Stream","description":"SSE stream URL for real-time updates.","default":"/v1/notifications/stream"}},"type":"object","required":["task_id"],"title":"SwapResponse","example":{"message":"Swap task queued successfully","notification_stream":"/v1/notifications/stream","poll_url":"/v1/tasks/d290f1ee-...","status":"queued","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"TaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Celery task ID for tracking the async operation.","examples":["d290f1ee-6c54-4b01-90e6-d701748f0851"]},"status":{"type":"string","title":"Status","description":"Current task status: queued, pending, started.","default":"queued"},"poll_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poll Url","description":"Relative URL to poll for task status.","examples":["/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851"]},"notification_stream":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Stream","description":"SSE stream URL for real-time task updates.","default":"/v1/notifications/stream"}},"type":"object","required":["task_id"],"title":"TaskResponse","example":{"notification_stream":"/v1/notifications/stream","poll_url":"/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851","status":"queued","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Celery task ID.","examples":["d290f1ee-6c54-4b01-90e6-d701748f0851"]},"status":{"type":"string","title":"Status","description":"Task status: pending, started, success, failure, revoked."},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result","description":"Task result payload when status is success or failure."}},"type":"object","required":["task_id","status"],"title":"TaskStatusResponse","example":{"result":{"tx_hash":"0xabc123..."},"status":"success","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"ThreadMessage":{"properties":{"id":{"type":"string","title":"Id","description":"Message ID.","default":""},"role":{"type":"string","title":"Role","description":"Message role: user or assistant.","default":""},"content":{"type":"string","title":"Content","description":"Message text content.","default":""},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 timestamp."}},"additionalProperties":true,"type":"object","title":"ThreadMessage","description":"A single message within a chat thread.","example":{"content":"ETH is currently trading at $3,200.","created_at":"2026-03-01T12:00:30Z","id":"msg-001","role":"assistant"}},"ThreadSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Thread ID (UUID)."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Thread title (auto-generated from first message)."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 creation timestamp."},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"ISO 8601 last-updated timestamp."}},"additionalProperties":true,"type":"object","required":["id"],"title":"ThreadSummary","description":"Summary of a chat thread.","example":{"created_at":"2026-03-01T12:00:00Z","id":"550e8400-e29b-41d4-a716-446655440000","title":"ETH price analysis","updated_at":"2026-03-01T12:05:00Z"}},"TokenRequest":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Agent ID from the verify step.","examples":["agent_abc123"]},"timestamp":{"type":"string","title":"Timestamp","description":"Current Unix timestamp as a string.","examples":["1709251200"]},"signature":{"type":"string","title":"Signature","description":"Base64-encoded Ed25519 signature of the timestamp."}},"type":"object","required":["agent_id","timestamp","signature"],"title":"TokenRequest","example":{"agent_id":"agent_abc123","signature":"base64-signature...","timestamp":"1709251200"}},"TokenResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Bearer token for authenticated API requests.","examples":["agt_eyJhbGciOiJFZ..."]},"expires_in":{"type":"integer","title":"Expires In","description":"Token lifetime in seconds.","examples":[3600]}},"type":"object","required":["token","expires_in"],"title":"TokenResponse"},"ToolInvokeRequest":{"properties":{"args":{"additionalProperties":true,"type":"object","title":"Args"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"}},"type":"object","title":"ToolInvokeRequest","description":"Request body for invoking a Fere tool by name."},"UserResponse":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"User display name."},"credits_available":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credits Available","description":"Credit balance available."},"wallets":{"anyOf":[{"items":{"$ref":"#/components/schemas/WalletInfo"},"type":"array"},{"type":"null"}],"title":"Wallets","description":"Wallet addresses (EVM + Solana)."},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Deprecated: always null (removed for privacy)."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Deprecated: always null (removed for privacy)."}},"type":"object","title":"UserResponse","description":"User information returned by the gateway.","example":{"credits_available":185.0,"name":"my-trading-bot","wallets":[{"address":"0x1234...5678","chain_type":"evm"},{"address":"7nYB...3kCi","chain_type":"solana"}]}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyRequest":{"properties":{"registration_id":{"type":"string","title":"Registration Id","description":"Registration ID from the register step."},"challenge":{"type":"string","title":"Challenge","description":"Challenge string from the register step."},"signature":{"type":"string","title":"Signature","description":"Base64-encoded Ed25519 signature of the challenge."}},"type":"object","required":["registration_id","challenge","signature"],"title":"VerifyRequest","example":{"challenge":"challenge_xyz789","registration_id":"reg_abc123","signature":"base64-signature..."}},"VerifyResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Assigned agent ID. Use this for token requests.","examples":["agent_abc123"]}},"type":"object","required":["agent_id"],"title":"VerifyResponse","example":{"agent_id":"agent_abc123"}},"WalletInfo":{"properties":{"address":{"type":"string","title":"Address","description":"Wallet address (hex for EVM, base58 for Solana).","examples":["0x1234567890abcdef1234567890abcdef12345678"]},"chain_type":{"type":"string","title":"Chain Type","description":"Wallet type: 'evm' or 'solana'.","examples":["evm"]}},"type":"object","required":["address","chain_type"],"title":"WalletInfo"},"WalletsResponse":{"properties":{"wallets":{"items":{"$ref":"#/components/schemas/WalletInfo"},"type":"array","title":"Wallets","description":"List of wallet addresses for the user."},"provisioning":{"type":"boolean","title":"Provisioning","description":"True when wallets are still being created. Retry after a few seconds.","default":false}},"type":"object","required":["wallets"],"title":"WalletsResponse","example":{"provisioning":false,"wallets":[{"address":"0x1234...5678","chain_type":"evm"},{"address":"7nYB...3kCi","chain_type":"solana"}]}},"WithdrawRequest":{"properties":{"position_id":{"type":"string","title":"Position Id","description":"Position ID to withdraw from.","examples":["pos-abc123"]},"amount_usdc":{"type":"number","exclusiveMinimum":0.0,"title":"Amount Usdc","description":"Amount of USDC to withdraw.","examples":[50.0]}},"type":"object","required":["position_id","amount_usdc"],"title":"WithdrawRequest","example":{"amount_usdc":50.0,"position_id":"pos-abc123"}}}}}