{"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/{chat_id}/recommendations/{recommendation_id}":{"patch":{"tags":["chat"],"summary":"Patch Chat Recommendation","description":"Accept or decline a per-message chat recommendation.","operationId":"patch_chat_recommendation_v1_chat__chat_id__recommendations__recommendation_id__patch","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","description":"Chat message UUID.","title":"Chat Id"},"description":"Chat message UUID."},{"name":"recommendation_id","in":"path","required":true,"schema":{"type":"string","description":"Recommendation id.","title":"Recommendation Id"},"description":"Recommendation id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRecommendationStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{chat_id}/files":{"get":{"tags":["chat"],"summary":"Get Chat Files","description":"Return signed URLs for files generated during a chat.","operationId":"get_chat_files_v1_chat__chat_id__files_get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","description":"Chat message UUID whose workspace files to list.","title":"Chat Id"},"description":"Chat message UUID whose workspace files to list."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"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\nFully gasless — the user never needs the source chain's native\ngas token. One unified call handles same-chain swaps, cross-chain\nswaps, and EVM↔Solana bridges, with bridging built in.\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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"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/security/check":{"post":{"tags":["security"],"summary":"Check Token Security","description":"Check whether tokens have been flagged as honeypots, scams, or rug-pulls.\n\nUses Honeypot.is for EVM tokens and RugCheck.xyz for Solana.\n\nUseful before submitting a swap when you want to surface a security\nverdict to your end user.","operationId":"check_token_security_v1_security_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityCheckResponse"}}}},"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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"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/earn/vault":{"get":{"tags":["earn"],"summary":"Get Vault Raw","description":"Raw vault data from wallet service.","operationId":"get_vault_raw_v1_earn_vault_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/earn/enable":{"post":{"tags":["earn"],"summary":"Enable Yield","description":"Enable yield (first deposit).","operationId":"enable_yield_v1_earn_enable_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositRequest"}}}},"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"}}}}}}},"/v1/earn":{"get":{"tags":["earn"],"summary":"Get Earn Info","description":"Current APY and vault info for Fere Earn.\n\nNo authentication required — this is public info.","operationId":"get_earn_info_v1_earn_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarnInfoResponse"}}}}}}},"/v1/earn/deposit":{"post":{"tags":["earn"],"summary":"Deposit","description":"Deposit USDC to earn yield.","operationId":"deposit_v1_earn_deposit_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositRequest"}}}},"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"}}}}}}},"/v1/earn/withdraw":{"post":{"tags":["earn"],"summary":"Withdraw","description":"Withdraw from yield position.","operationId":"withdraw_v1_earn_withdraw_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawRequest"}}}},"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"}}}}}}},"/v1/earn/positions":{"get":{"tags":["earn"],"summary":"Get Positions","description":"Get yield positions and history.","operationId":"get_positions_v1_earn_positions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarnPositionsResponse"}}}}}}},"/v1/perp/markets":{"get":{"tags":["perp"],"summary":"Get Perp Markets","description":"List the tradable perp market universe.","operationId":"get_perp_markets_v1_perp_markets_get","parameters":[{"name":"search_text","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional filter on the perp asset universe.","title":"Search Text"},"description":"Optional filter on the perp asset universe."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpMarketsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/perp/setup":{"get":{"tags":["perp"],"summary":"Get Perp Setup Status","description":"Whether perp trading is provisioned for the account.","operationId":"get_perp_setup_status_v1_perp_setup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpSetupStatusResponse"}}}}}},"post":{"tags":["perp"],"summary":"Perp Setup","description":"Provision perp trading (signing wallet) for the account.","operationId":"perp_setup_v1_perp_setup_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":60,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpSetupRequest"}}}},"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"}}}}}}},"/v1/perp/orders":{"get":{"tags":["perp"],"summary":"Get Perp Orders","description":"Open perp orders (including TP/SL triggers) and mark prices.","operationId":"get_perp_orders_v1_perp_orders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpOrdersResponse"}}}}}}},"/v1/perp/open":{"post":{"tags":["perp"],"summary":"Perp Open","description":"Open a perpetual position (optionally with a TP/SL bracket).","operationId":"perp_open_v1_perp_open_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpOpenRequest"}}}},"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"}}}}}}},"/v1/perp/close":{"post":{"tags":["perp"],"summary":"Perp Close","description":"Close (fully or partially) an open perpetual position.","operationId":"perp_close_v1_perp_close_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpCloseRequest"}}}},"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"}}}}}}},"/v1/perp/orders/cancel":{"post":{"tags":["perp"],"summary":"Perp Cancel Order","description":"Cancel an open perp order by its venue order id (oid).","operationId":"perp_cancel_order_v1_perp_orders_cancel_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpCancelRequest"}}}},"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"}}}}}}},"/v1/perp/fund":{"post":{"tags":["perp"],"summary":"Perp Fund","description":"Fund the perp account from a connected wallet.","operationId":"perp_fund_v1_perp_fund_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpFundRequest"}}}},"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"}}}}}}},"/v1/perp/withdraw":{"post":{"tags":["perp"],"summary":"Perp Withdraw","description":"Withdraw perp collateral to a destination chain/token.","operationId":"perp_withdraw_v1_perp_withdraw_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpWithdrawRequest"}}}},"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"}}}}}}},"/v1/spot_hl/markets":{"get":{"tags":["spot_hl"],"summary":"Get Spot Markets","description":"List the tradable spot market universe (USDC-quoted, symbol only).","operationId":"get_spot_markets_v1_spot_hl_markets_get","parameters":[{"name":"search_text","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional filter on the spot asset universe.","title":"Search Text"},"description":"Optional filter on the spot asset universe."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotMarketsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spot_hl/orders":{"get":{"tags":["spot_hl"],"summary":"Get Spot Orders","description":"Open spot orders (including TP/SL triggers).","operationId":"get_spot_orders_v1_spot_hl_orders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotOrdersResponse"}}}}}}},"/v1/spot_hl/buy":{"post":{"tags":["spot_hl"],"summary":"Spot Buy","description":"Buy a spot asset with USDC (optionally attach a TP/SL bracket).","operationId":"spot_buy_v1_spot_hl_buy_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotBuyRequest"}}}},"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"}}}}}}},"/v1/spot_hl/sell":{"post":{"tags":["spot_hl"],"summary":"Spot Sell","description":"Sell a held spot asset back to USDC.\n\nOmit size to sell the full balance.","operationId":"spot_sell_v1_spot_hl_sell_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotSellRequest"}}}},"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"}}}}}}},"/v1/spot_hl/tp-sl":{"post":{"tags":["spot_hl"],"summary":"Spot Set Tp Sl","description":"Attach reduce-side TP/SL sell triggers to an existing spot holding.","operationId":"spot_set_tp_sl_v1_spot_hl_tp_sl_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotTpSlRequest"}}}},"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"}}}}}}},"/v1/spot_hl/orders/cancel":{"post":{"tags":["spot_hl"],"summary":"Spot Cancel Order","description":"Cancel an open spot order by its venue order id (oid).","operationId":"spot_cancel_order_v1_spot_hl_orders_cancel_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":90,"minimum":5,"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).","default":90,"title":"Timeout"},"description":"Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotCancelRequest"}}}},"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"}}}}}}},"/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 metadata; optional executions (#18).","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":50,"title":"Limit"}},{"name":"include_executions","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Executions"}}],"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}/executions":{"get":{"tags":["webapp-schedule-chat"],"summary":"List Schedule Executions","description":"Paginated schedule executions.","operationId":"list_schedule_executions_schedule_chat_schedule__schedule_id__executions_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":20,"title":"Limit"}},{"name":"execution_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Type"}},{"name":"fields","in":"query","required":false,"schema":{"type":"string","default":"summary","title":"Fields"}}],"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}":{"get":{"tags":["webapp-schedule-chat"],"summary":"Get Schedule Execution","description":"Full execution detail.","operationId":"get_schedule_execution_schedule_chat_execution__execution_id__get","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"}}}}}}},"/schedule-chat/execution/{execution_id}/events":{"get":{"tags":["webapp-schedule-chat"],"summary":"List Execution Events","description":"Paginated events for an execution.","operationId":"list_execution_events_schedule_chat_execution__execution_id__events_get","parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution 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/schedule/{schedule_id}/transactions":{"get":{"tags":["webapp-schedule-chat"],"summary":"List Schedule Transactions","description":"Strategy-scoped transaction events.","operationId":"list_schedule_transactions_schedule_chat_schedule__schedule_id__transactions_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":15,"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/schedule/{schedule_id}/recommendations":{"get":{"tags":["webapp-schedule-chat"],"summary":"Get Schedule Recommendations","description":"Strategy recommendations for a schedule.","operationId":"get_schedule_recommendations_schedule_chat_schedule__schedule_id__recommendations_get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}}],"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}/recommendations/refresh":{"post":{"tags":["webapp-schedule-chat"],"summary":"Refresh Schedule Recommendations","description":"Enqueue strategy recommendations refresh.","operationId":"refresh_schedule_recommendations_schedule_chat_schedule__schedule_id__recommendations_refresh_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"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}/recommendations/{recommendation_id}":{"delete":{"tags":["webapp-schedule-chat"],"summary":"Dismiss Schedule Recommendation","description":"Remove one strategy recommendation from the schedule.","operationId":"dismiss_schedule_recommendation_schedule_chat_schedule__schedule_id__recommendations__recommendation_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"recommendation_id","in":"path","required":true,"schema":{"type":"string","title":"Recommendation Id"}}],"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}/artifacts":{"get":{"tags":["webapp-schedule-chat"],"summary":"List Schedule Artifacts","description":"Strategy workspace files.","operationId":"list_schedule_artifacts_schedule_chat_schedule__schedule_id__artifacts_get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"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/meta":{"get":{"tags":["webapp-polymarket"],"summary":"Get Polymarket Meta","description":"Tab badge counts from precompute cache — passthrough to Friday.","operationId":"get_polymarket_meta_polymarket_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/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."},"perp":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Perp","description":"Venue-neutral perpetual-futures trading endpoints."},"spot_hl":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Spot Hl","description":"Venue-neutral HyperCore spot trading endpoints."},"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"]}]}},"ChatRecommendationStatusUpdate":{"properties":{"status":{"type":"string","pattern":"^(accepted|declined)$","title":"Status","description":"New recommendation status: accepted or declined.","examples":["accepted"]}},"type":"object","required":["status"],"title":"ChatRecommendationStatusUpdate","description":"Request body for accepting or declining a chat recommendation.","example":{"status":"accepted"}},"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}},"DayTradeFarmingConfigBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"farming_config":{"$ref":"#/components/schemas/DayTradeFarmingConfigPayload"}},"type":"object","required":["enabled","farming_config"],"title":"DayTradeFarmingConfigBody","description":"Upsert body for day trading farming."},"DayTradeFarmingConfigPayload":{"properties":{"chain_id":{"type":"string","minLength":1,"title":"Chain Id","default":"hyperliquid"},"asset":{"type":"string","minLength":1,"title":"Asset","default":"hl:perp:BTC"},"order_notional_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Order Notional Usd"},"order_size":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Order Size"},"leverage":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Leverage","default":1},"is_cross":{"type":"boolean","title":"Is Cross","default":true},"slippage_pct":{"type":"number","maximum":10.0,"exclusiveMinimum":0.0,"title":"Slippage Pct","default":0.5},"tp_is_market":{"type":"boolean","title":"Tp Is Market","default":true},"sl_is_market":{"type":"boolean","title":"Sl Is Market","default":true}},"type":"object","title":"DayTradeFarmingConfigPayload","description":"Day trade JSONB payload mirrored from wallet_service schemas.\n\nSupported perps are **BTC**, **ETH**, and **SOL** only."},"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 the best available yield across the supported chains (Base and Arbitrum)."},"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":"Earn details: 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","Automatically routed to the best available yield","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}}},"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_chain_name":{"type":"string","title":"Vault Chain Name","description":"Chain for this position (Base or Arbitrum).","default":""},"current_apy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Apy","description":"Current 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"}},"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"}]}},"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"},"HistoryResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/HistoryRow"},"type":"array","title":"Rows","description":"Order rows, newest first."},"limit":{"type":"integer","title":"Limit"},"count":{"type":"integer","title":"Count","description":"Rows in this page."},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Opaque time cursor for the next (older) page. Pass it back as `cursor`. None when there are no more rows."}},"type":"object","required":["rows","limit","count"],"title":"HistoryResponse","example":{"count":1,"limit":50,"next_cursor":"eyJ0cyI6MTcwMDAwMDAwMC4wLCJpZCI6IjhmMGMifQ==","rows":[{"amount":1000.0,"asset_key":"8453:0xabc…","attributed":true,"created_at":"2026-05-22T10:00:00+00:00","exec_price_usd":0.5,"external_ref":{},"id":"8f0c…","sce_id":"1b2c…","side":"buy","source":"strategy","strategy_group":"1b2c…","tx_hash":"0xdeadbeef…","usd_value":500.0,"venue":"swap_v4"}]}},"HistoryRow":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"venue":{"type":"string","title":"Venue"},"side":{"type":"string","title":"Side"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"source_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Detail","description":"Mechanism that fired the order — 'take_profit', 'stop_loss', 'limit_order', 'liquidation'; None = direct sell."},"asset_key":{"type":"string","title":"Asset Key"},"amount":{"type":"number","title":"Amount"},"exec_price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exec Price Usd"},"usd_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Usd Value"},"attributed":{"type":"boolean","title":"Attributed","description":"True when the event matched our ledger (on-platform). False = off-platform (liquidation, external trade)."},"kind":{"type":"string","enum":["off_platform","strategy","chat","manual","ai"],"title":"Kind","description":"Canonical origin of the row (server-computed; clients render directly without re-deriving): 'off_platform' | 'strategy' | 'chat' | 'manual' | 'ai'. 'ai' = a platform action taken by an automated system on the user's behalf (e.g. a yield rebalance).","default":"off_platform"},"strategy_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Group","description":"Strategy display key; None when off-platform."},"sce_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sce Id"},"farming_config_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Farming Config Id"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"},"strategy_href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Href","description":"Deep-link for continuous-farming rows (farming_config_id-based), resolved server-side from farming_type (e.g. '/strategies/farming/day'). None for chat/manual/off-platform rows — the client resolves those via chat_id. When present, the client links the Activity chip directly to this href."},"strategy_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Label","description":"Human chip label paired with strategy_href (e.g. 'Day-Trade Farming'). None when strategy_href is None."},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tx Hash"},"external_ref":{"additionalProperties":true,"type":"object","title":"External Ref"}},"type":"object","required":["id","created_at","venue","side","asset_key","amount","attributed"],"title":"HistoryRow"},"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}},"PerpCancelRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Perp asset symbol of the order to cancel.","examples":["BTC"]},"order_id":{"type":"integer","title":"Order Id","description":"Venue order id (oid) from GET /v1/perp/orders.","examples":[123456789]}},"type":"object","required":["asset","order_id"],"title":"PerpCancelRequest","example":{"asset":"BTC","order_id":123456789}},"PerpCloseRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Perp asset symbol to close, e.g. 'BTC'.","examples":["BTC"]},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Size","description":"Contracts to close. Omit or null to close the full position.","examples":[0.001]},"slippage_pct":{"type":"number","title":"Slippage Pct","description":"Allowed slippage in percent points (0.5 = 0.5%).","default":0.5}},"type":"object","required":["asset"],"title":"PerpCloseRequest","example":{"asset":"BTC"}},"PerpFundRequest":{"properties":{"amount":{"type":"string","title":"Amount","description":"Amount of the source token in smallest units.","examples":["50000000"]},"source_chain_id":{"type":"integer","title":"Source Chain Id","description":"Chain holding the source token (e.g. 8453, 42161).","examples":[8453]},"source_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Token","description":"ERC-20 address on the source chain, or null for the native gas token."},"display_amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Display Amount Usd","description":"USD amount the user entered (relaxes the post-bridge minimum for typical fee variance).","examples":[50.0]}},"type":"object","required":["amount","source_chain_id"],"title":"PerpFundRequest","example":{"amount":"50000000","display_amount_usd":50.0,"source_chain_id":8453}},"PerpMarketsResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"PerpMarketsResponse","description":"Tradable perp market universe."},"PerpOpenRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Perp asset symbol, e.g. 'BTC' or 'ETH'.","examples":["BTC"]},"is_buy":{"type":"boolean","title":"Is Buy","description":"True to open a long, False to open a short.","examples":[true]},"size":{"type":"number","exclusiveMinimum":0.0,"title":"Size","description":"Position size in contracts (not smallest units).","examples":[0.001]},"leverage":{"type":"integer","minimum":1.0,"title":"Leverage","description":"Leverage multiplier.","default":1,"examples":[2]},"is_cross":{"type":"boolean","title":"Is Cross","description":"True for cross margin, False for isolated.","default":true},"order_type":{"type":"string","title":"Order Type","description":"Order type: 'market' or 'limit'.","default":"market","examples":["market"]},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price","description":"Limit price (required when order_type='limit')."},"slippage_pct":{"type":"number","title":"Slippage Pct","description":"Allowed slippage in percent points (0.5 = 0.5%).","default":0.5},"reduce_only":{"type":"boolean","title":"Reduce Only","description":"True to only reduce an existing position.","default":false},"tp_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tp Price","description":"Optional take-profit trigger price (reduce-only bracket attached after open)."},"sl_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl Price","description":"Optional stop-loss trigger price (reduce-only bracket attached after open)."},"tp_is_market":{"type":"boolean","title":"Tp Is Market","description":"True = market-on-trigger for the take-profit leg.","default":true},"sl_is_market":{"type":"boolean","title":"Sl Is Market","description":"True = market-on-trigger for the stop-loss leg.","default":true}},"type":"object","required":["asset","is_buy","size"],"title":"PerpOpenRequest","example":{"asset":"BTC","is_buy":true,"leverage":2,"size":0.001}},"PerpOrdersResponse":{"properties":{"orders":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Orders","description":"Open orders, each with asset, oid, side, size, price."},"mark_prices":{"additionalProperties":true,"type":"object","title":"Mark Prices","description":"Map of asset symbol → current mark price (string)."}},"additionalProperties":true,"type":"object","title":"PerpOrdersResponse","description":"Open perp orders (including TP/SL triggers) and mark prices."},"PerpSetupRequest":{"properties":{"force_rerun":{"type":"boolean","title":"Force Rerun","description":"Re-run signing-wallet setup even if already complete.","default":false}},"type":"object","title":"PerpSetupRequest","example":{"force_rerun":false}},"PerpSetupStatusResponse":{"properties":{"setup_complete":{"type":"boolean","title":"Setup Complete","description":"True when the account is ready to trade perps."},"account_activated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Account Activated","description":"True when the venue account is activated."},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error","description":"Last setup error, if any."}},"additionalProperties":true,"type":"object","required":["setup_complete"],"title":"PerpSetupStatusResponse","description":"Whether perp trading is provisioned for the account."},"PerpWithdrawRequest":{"properties":{"amount_usd":{"type":"number","exclusiveMinimum":0.0,"title":"Amount Usd","description":"USD notional of perp collateral (USDC) to withdraw.","examples":[25.0]},"destination_chain_id":{"type":"integer","title":"Destination Chain Id","description":"Target chain for the withdrawn token.","examples":[8453]},"destination_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination Token","description":"ERC-20 on destination chain, Solana mint, or null for the native token."}},"type":"object","required":["amount_usd","destination_chain_id"],"title":"PerpWithdrawRequest","example":{"amount_usd":25.0,"destination_chain_id":8453}},"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)."},"RealizedResponse":{"properties":{"total_realized_pnl_usd":{"type":"number","title":"Total Realized Pnl Usd","description":"Sum of realized PnL across all strategies."},"by_strategy":{"items":{"$ref":"#/components/schemas/RealizedStrategyRow"},"type":"array","title":"By Strategy","description":"Realized PnL grouped by strategy."}},"type":"object","required":["total_realized_pnl_usd","by_strategy"],"title":"RealizedResponse"},"RealizedStrategyRow":{"properties":{"sce_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sce Id","description":"Strategy execution id; null for manual trades."},"farming_config_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Farming Config Id","description":"Continuous-farming strategy id; null otherwise."},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id","description":"Parent scheduled-chat id when source='strategy'; null for direct/manual trades."},"group":{"type":"string","title":"Group","description":"Display key: str(farming_config_id or chat_id or sce_id) or 'manual'."},"realized_pnl_usd":{"type":"number","title":"Realized Pnl Usd","description":"Realized PnL in USD."},"trade_count":{"type":"integer","title":"Trade Count","description":"Closing trades in this group."},"volume_usd":{"type":"number","title":"Volume Usd","description":"Closing volume in USD."}},"type":"object","required":["group","realized_pnl_usd","trade_count","volume_usd"],"title":"RealizedStrategyRow"},"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"},"SecurityCheckRequest":{"properties":{"tokens":{"items":{"$ref":"#/components/schemas/TokenToCheck"},"type":"array","maxItems":50,"title":"Tokens","description":"Tokens to check. Up to 50 per request."}},"type":"object","required":["tokens"],"title":"SecurityCheckRequest","example":{"tokens":[{"chain_id":8453,"token_address":"0x16332535e2c27da578bc2e82beb09ce9d3c8eb07"}]}},"SecurityCheckResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/TokenSecurityResult"},"type":"array","title":"Results","description":"Per-token security results."},"summary":{"$ref":"#/components/schemas/SecurityCheckSummary","description":"Counts grouped by status."}},"type":"object","required":["results","summary"],"title":"SecurityCheckResponse"},"SecurityCheckSummary":{"properties":{"total":{"type":"integer","title":"Total"},"passed":{"type":"integer","title":"Passed"},"failed":{"type":"integer","title":"Failed"},"warning":{"type":"integer","title":"Warning"},"api_unavailable":{"type":"integer","title":"Api Unavailable"},"unsupported_chain":{"type":"integer","title":"Unsupported Chain","default":0},"skipped":{"type":"integer","title":"Skipped","default":0}},"type":"object","required":["total","passed","failed","warning","api_unavailable"],"title":"SecurityCheckSummary"},"SpotBuyRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Spot base asset symbol (USDC-quoted), e.g. 'HYPE'.","examples":["HYPE"]},"size":{"type":"number","exclusiveMinimum":0.0,"title":"Size","description":"Base-token amount to buy.","examples":[1.5]},"order_type":{"type":"string","title":"Order Type","description":"Order type: 'market' or 'limit'.","default":"market","examples":["market"]},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price","description":"Limit price (required when order_type='limit')."},"slippage_pct":{"type":"number","title":"Slippage Pct","description":"Allowed slippage in percent points (0.5 = 0.5%).","default":0.5},"tp_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tp Price","description":"Optional take-profit trigger price (sell trigger attached after the buy fills)."},"sl_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl Price","description":"Optional stop-loss trigger price (sell trigger attached after the buy fills)."},"tp_is_market":{"type":"boolean","title":"Tp Is Market","default":true},"sl_is_market":{"type":"boolean","title":"Sl Is Market","default":true}},"type":"object","required":["asset","size"],"title":"SpotBuyRequest","example":{"asset":"HYPE","size":1.5}},"SpotCancelRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Spot base asset symbol of the order to cancel.","examples":["HYPE"]},"order_id":{"type":"integer","title":"Order Id","description":"Venue order id (oid) from GET /v1/spot/orders.","examples":[123456789]}},"type":"object","required":["asset","order_id"],"title":"SpotCancelRequest","example":{"asset":"HYPE","order_id":123456789}},"SpotMarketsResponse":{"properties":{"markets":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Markets"}},"additionalProperties":true,"type":"object","title":"SpotMarketsResponse","description":"Tradable spot market universe (USDC-quoted, symbol only)."},"SpotOrdersResponse":{"properties":{"orders":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Orders"}},"additionalProperties":true,"type":"object","title":"SpotOrdersResponse","description":"Open spot orders (including TP/SL triggers)."},"SpotSellRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Spot base asset symbol to sell, e.g. 'HYPE'.","examples":["HYPE"]},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Size","description":"Base-token amount to sell. Omit/null to sell the full held balance.","examples":[1.5]},"order_type":{"type":"string","title":"Order Type","default":"market","examples":["market"]},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price"},"slippage_pct":{"type":"number","title":"Slippage Pct","default":0.5}},"type":"object","required":["asset"],"title":"SpotSellRequest","example":{"asset":"HYPE"}},"SpotTpSlRequest":{"properties":{"asset":{"type":"string","title":"Asset","description":"Held spot asset symbol to protect, e.g. 'HYPE'.","examples":["HYPE"]},"tp_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tp Price","description":"Take-profit trigger price."},"sl_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl Price","description":"Stop-loss trigger price."},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Size","description":"Base amount to protect. Omit to use the full held balance."},"tp_is_market":{"type":"boolean","title":"Tp Is Market","default":true},"sl_is_market":{"type":"boolean","title":"Sl Is Market","default":true}},"type":"object","required":["asset"],"title":"SpotTpSlRequest","example":{"asset":"HYPE","sl_price":30.0,"tp_price":60.0}},"StrategyPreviewOut":{"properties":{"asset":{"type":"string","title":"Asset"},"found":{"type":"boolean","title":"Found"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"lookback_days":{"type":"integer","title":"Lookback Days","default":21},"bar_minutes":{"type":"integer","title":"Bar Minutes","default":15},"current_signal":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Current Signal"},"trades":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trades"},"wins":{"type":"integer","title":"Wins","default":0},"losses":{"type":"integer","title":"Losses","default":0},"resolved":{"type":"integer","title":"Resolved","default":0},"win_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate Pct"}},"type":"object","required":["asset","found"],"title":"StrategyPreviewOut","description":"Per-asset day-trade preview proxied from wallet_service."},"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"}},"SwingTradeFarmingConfigBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"farming_config":{"$ref":"#/components/schemas/SwingTradeFarmingConfigPayload"}},"type":"object","required":["enabled","farming_config"],"title":"SwingTradeFarmingConfigBody","description":"Upsert body for swing trading farming."},"SwingTradeFarmingConfigPayload":{"properties":{"chain_id":{"type":"string","minLength":1,"title":"Chain Id","default":"hyperliquid"},"asset":{"type":"string","minLength":1,"title":"Asset","default":"hl:perp:BTC"}},"type":"object","title":"SwingTradeFarmingConfigPayload","description":"Swing trade JSONB payload mirrored from wallet_service schemas.\n\nOnly **chain** and **perp** are configurable; supported perps are\n**BTC**, **ETH**, and **SOL** only."},"SwitchPlanRequest":{"properties":{"price_id":{"type":"string","minLength":1,"title":"Price Id","description":"Target Stripe Price ID for plan switch."}},"type":"object","required":["price_id"],"title":"SwitchPlanRequest","description":"Body for ``PUT /v1/subscriptions/switch-plan`` — mirrors Friday."},"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"},"TokenSecurityResult":{"properties":{"token_address":{"type":"string","title":"Token Address","description":"Token contract address."},"chain_id":{"type":"integer","title":"Chain Id","description":"Chain ID (normalized to int)."},"allowed":{"type":"boolean","title":"Allowed","description":"True if the token passed all checks. Use as a quick boolean gate."},"status":{"type":"string","title":"Status","description":"One of: passed, failed, warning, api_unavailable, unsupported_chain, skipped."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Human-readable explanation when status is not passed."},"provider":{"type":"string","title":"Provider","description":"Security provider used: 'rugcheck' or 'honeypot_is'."},"risk_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Risk Details","description":"Full provider response (scores, taxes, flags, etc.)."}},"type":"object","required":["token_address","chain_id","allowed","status","provider"],"title":"TokenSecurityResult"},"TokenToCheck":{"properties":{"token_address":{"type":"string","title":"Token Address","description":"Token contract address to check.","examples":["0x16332535e2c27da578bc2e82beb09ce9d3c8eb07"]},"chain_id":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Chain Id","description":"Chain ID (1=Ethereum, 8453=Base, 7565164=Solana, etc.) or chain name.","examples":[8453]}},"type":"object","required":["token_address","chain_id"],"title":"TokenToCheck"},"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."},"UnrealizedResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/UnrealizedRow"},"type":"array","title":"Rows","description":"Per-strategy open-lot cost basis."}},"type":"object","required":["rows"],"title":"UnrealizedResponse"},"UnrealizedRow":{"properties":{"group":{"type":"string","title":"Group","description":"Display key: str(farming_config_id or chat_id or sce_id) or 'manual'."},"sce_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sce Id"},"farming_config_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Farming Config Id"},"chat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Id"},"venue":{"type":"string","title":"Venue","description":"swap_v4 | polymarket | hyperliquid."},"asset_key":{"type":"string","title":"Asset Key","description":"Canonical FIFO-bucket asset id."},"open_size":{"type":"number","title":"Open Size","description":"Remaining open size."},"weighted_avg_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weighted Avg Cost Usd"},"cost_basis_usd":{"type":"number","title":"Cost Basis Usd","description":"Open cost basis in USD."},"current_price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Price Usd"},"unrealized_pnl_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unrealized Pnl Usd"},"price_unavailable":{"type":"boolean","title":"Price Unavailable","default":true}},"type":"object","required":["group","venue","asset_key","open_size","cost_basis_usd"],"title":"UnrealizedRow"},"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"},"VenueSummaryResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/VenueSummaryRow"},"type":"array","title":"Rows","description":"Overall PnL per venue."},"total_pnl_usd":{"type":"number","title":"Total Pnl Usd","description":"Sum of non-null venue PnL (yield excluded)."},"total_volume_usd":{"type":"number","title":"Total Volume Usd","description":"Sum of non-null venue traded volume.","default":0.0}},"type":"object","required":["rows","total_pnl_usd"],"title":"VenueSummaryResponse"},"VenueSummaryRow":{"properties":{"venue":{"type":"string","title":"Venue","description":"swap_v4 | polymarket | hyperliquid | yield."},"pnl_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pnl Usd","description":"Overall PnL for the venue. None when degraded or N/A (yield)."},"volume_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Usd","description":"Traded volume in USD. PM/HL = lifetime venue-reported (all-sides); swap_v4 = our ledger gross (both sides); yield = deposit/withdraw principal flow. None when unavailable."},"source":{"type":"string","title":"Source","description":"ledger_realized | pm_lifetime | hl_portfolio | hl_fills_fallback | holdings."},"degraded":{"type":"boolean","title":"Degraded","description":"True when the upstream PnL source failed.","default":false}},"type":"object","required":["venue","source"],"title":"VenueSummaryRow"},"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"}}}}}