{"openapi":"3.1.0","info":{"title":"FereAI Gateway","description":"Unified API for on-chain crypto trading 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.","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/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.\n\nPass ``agent_id`` to trade from one of your own strategy wallets\ninstead of the main one. To sell a position, set ``token_out`` to\nthe chain's stablecoin. Selling the whole position (99.9% or more\nof the balance) removes that coin's stop-loss/take-profit orders\nautomatically; a partial sell keeps them on the remaining amount.\n``cancel_conditional_orders`` acts on ``token_out``'s orders, so it\ndoes not clear the sold coin's orders.","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/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/LimitOrderCancelResponse"}}}},"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.\n\nPass ``destination_chain_id`` (+ token) to land it in the agent's own\nwallet, or ``to_address`` to have Hyperliquid pay USDC on Arbitrum\nstraight to an outside address.","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.\n\nFailed tasks always report the generic error\n\"Something went wrong, please try again!\"; the underlying reason is\nlogged server-side by task_id.","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/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"}}}}}}},"/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.\n\nOptional body ``agent_id``: owned strategy sub-agent (same URL as parent).","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"]}]}},"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"},"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"}},"LimitOrderCancelResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Operation status from wallet-service.","examples":["success"]},"message":{"type":"string","title":"Message","description":"Human-readable cancel result.","examples":["Limit order cancelled"]},"limit_order_id":{"type":"string","title":"Limit Order Id","description":"Cancelled limit order identifier."}},"additionalProperties":true,"type":"object","required":["status","message","limit_order_id"],"title":"LimitOrderCancelResponse","description":"Ack from wallet-service DELETE /limit-order/{id}.","example":{"limit_order_id":"lo-abc123","message":"Limit order cancelled","status":"success"}},"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"}},"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","minimum":6.0,"title":"Amount Usd","description":"USD notional of perp collateral (USDC) to withdraw. Hyperliquid deducts a flat $1 fee; minimum $6.","examples":[25.0]},"destination_chain_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Destination Chain Id","description":"Target chain for the withdrawn token, landing in the agent's own wallet. Required unless `to_address` is set; with `to_address` omit it or pass 42161 (Arbitrum).","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. With `to_address` omit it or pass Arbitrum USDC."},"to_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Address","description":"Outside EVM address. Hyperliquid pays USDC on Arbitrum straight there (amount minus the $1 fee); it never passes through the agent's wallet. Must accept USDC on Arbitrum One; the agent's own wallets are refused.","examples":["0x1111111111111111111111111111111111111111"]}},"type":"object","required":["amount_usd"],"title":"PerpWithdrawRequest","description":"Withdraw perp collateral.\n\nTwo ways out: ``destination_chain_id`` (+ token) lands the funds in the\nagent's own wallet on that chain, or ``to_address`` has Hyperliquid pay\nUSDC on Arbitrum straight to an outside address. One of the two is\nrequired.","example":{"amount_usd":25.0,"to_address":"0x1111111111111111111111111111111111111111"}},"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"},"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}},"SwapRequest":{"properties":{"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id","description":"Optional: one of your own agents (e.g. a strategy wallet) to trade from. Defaults to your main agent. An agent you don't own returns 404."},"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"]},"result":{"title":"Result","description":"Settled task result. Only set with ?wait=true."},"notification_stream":{"type":"string","title":"Notification Stream","description":"SSE stream URL for real-time updates.","default":"/v1/notifications/stream"}},"type":"object","required":["task_id"],"title":"SwapResponse","example":{"message":"Swap task queued successfully","notification_stream":"/v1/notifications/stream","poll_url":"/v1/tasks/d290f1ee-...","status":"queued","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"TaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Celery task ID for tracking the async operation.","examples":["d290f1ee-6c54-4b01-90e6-d701748f0851"]},"status":{"type":"string","title":"Status","description":"Current task status: queued, pending, started.","default":"queued"},"poll_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poll Url","description":"Relative URL to poll for task status.","examples":["/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851"]},"notification_stream":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Stream","description":"SSE stream URL for real-time task updates.","default":"/v1/notifications/stream"}},"type":"object","required":["task_id"],"title":"TaskResponse","example":{"notification_stream":"/v1/notifications/stream","poll_url":"/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851","status":"queued","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Celery task ID.","examples":["d290f1ee-6c54-4b01-90e6-d701748f0851"]},"status":{"type":"string","title":"Status","description":"Task status: pending, started, success, failure, revoked."},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result","description":"Task result payload when status is success or failure."}},"type":"object","required":["task_id","status"],"title":"TaskStatusResponse","example":{"result":{"tx_hash":"0xabc123..."},"status":"success","task_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}},"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"},"UserResponse":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"User display name."},"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":{"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"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyRequest":{"properties":{"registration_id":{"type":"string","title":"Registration Id","description":"Registration ID from the register step."},"challenge":{"type":"string","title":"Challenge","description":"Challenge string from the register step."},"signature":{"type":"string","title":"Signature","description":"Base64-encoded Ed25519 signature of the challenge."}},"type":"object","required":["registration_id","challenge","signature"],"title":"VerifyRequest","example":{"challenge":"challenge_xyz789","registration_id":"reg_abc123","signature":"base64-signature..."}},"VerifyResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id","description":"Assigned agent ID. Use this for token requests.","examples":["agent_abc123"]}},"type":"object","required":["agent_id"],"title":"VerifyResponse","example":{"agent_id":"agent_abc123"}},"WalletInfo":{"properties":{"address":{"type":"string","title":"Address","description":"Wallet address (hex for EVM, base58 for Solana).","examples":["0x1234567890abcdef1234567890abcdef12345678"]},"chain_type":{"type":"string","title":"Chain Type","description":"Wallet type: 'evm' or 'solana'.","examples":["evm"]}},"type":"object","required":["address","chain_type"],"title":"WalletInfo"},"WalletsResponse":{"properties":{"wallets":{"items":{"$ref":"#/components/schemas/WalletInfo"},"type":"array","title":"Wallets","description":"List of wallet addresses for the user."},"provisioning":{"type":"boolean","title":"Provisioning","description":"True when wallets are still being created. Retry after a few seconds.","default":false}},"type":"object","required":["wallets"],"title":"WalletsResponse","example":{"provisioning":false,"wallets":[{"address":"0x1234...5678","chain_type":"evm"},{"address":"7nYB...3kCi","chain_type":"solana"}]}},"WithdrawRequest":{"properties":{"position_id":{"type":"string","title":"Position Id","description":"Position ID to withdraw from.","examples":["pos-abc123"]},"amount_usdc":{"type":"number","exclusiveMinimum":0.0,"title":"Amount Usdc","description":"Amount of USDC to withdraw.","examples":[50.0]}},"type":"object","required":["position_id","amount_usdc"],"title":"WithdrawRequest","example":{"amount_usdc":50.0,"position_id":"pos-abc123"}}}}}