{"openapi":"3.1.0","info":{"title":"a2mcp.cloud Agent Utility API","version":"1.1.0","description":"Deterministic trading, safety, market, and bounded analytics utilities. Never signs or broadcasts orders/transactions."},"servers":[{"url":"https://api.a2mcp.cloud"}],"paths":{"/healthz":{"get":{"summary":"Liveness and payment mode","responses":{"200":{"description":"Healthy"}}}},"/v1/capabilities":{"get":{"summary":"Machine-readable services and prices","responses":{"200":{"description":"Capabilities"}}}},"/openapi.json":{"get":{"summary":"This OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 document"}}}},"/v1/parse-signal":{"post":{"summary":"Crypto Signal Parser","operationId":"parse_signal","x-price-usd":0.08,"x-price-usdt":0.08,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rawSignal"],"additionalProperties":false,"properties":{"rawSignal":{"type":"string","minLength":3,"maxLength":4000},"orderType":{"enum":["market","limit","stop"]}}},"example":{"rawSignal":"BUY BTCUSDT ENTRY 60000-61000 SL 59000 TP 62000"}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseSignalResponse"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseSignalInvalidResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/risk":{"post":{"summary":"Trading Risk Calculator","operationId":"risk","x-price-usd":0.05,"x-price-usdt":0.05,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accountBalance","riskPercent"],"oneOf":[{"required":["rawSignal"],"not":{"required":["signal"]}},{"required":["signal"],"not":{"required":["rawSignal"]}}],"additionalProperties":false,"properties":{"rawSignal":{"type":"string","minLength":3,"maxLength":4000},"signal":{"$ref":"#/components/schemas/SignalV11"},"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"market":{"enum":["spot","perpetual","futures"]},"accountBalance":{"$ref":"#/components/schemas/DecimalString"},"riskPercent":{"$ref":"#/components/schemas/DecimalString"},"valuePerPriceUnit":{"$ref":"#/components/schemas/DecimalString"},"quantityUnit":{"enum":["base","quote","contracts"]},"leverage":{"$ref":"#/components/schemas/DecimalString"}}},"example":{"rawSignal":"BUY BTCUSDT ENTRY 60000 SL 59000 TP 62000","exchange":"okx","market":"perpetual","accountBalance":"10000","riskPercent":"1"}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskResponse"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskInvalidResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/normalize-order":{"post":{"summary":"Trading Intent Normalizer","operationId":"normalize_order","x-price-usd":0.005,"x-price-usdt":0.005,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signal","risk"],"additionalProperties":false,"properties":{"signal":{"$ref":"#/components/schemas/SignalV11"},"risk":{"$ref":"#/components/schemas/RiskReportV11"},"accountBalance":{"$ref":"#/components/schemas/DecimalString"},"riskPercent":{"$ref":"#/components/schemas/DecimalString"},"valuePerPriceUnit":{"$ref":"#/components/schemas/DecimalString"},"quantityUnit":{"enum":["base","quote","contracts"]},"market":{"enum":["spot","perpetual","futures"]},"positionAction":{"enum":["open","close","reduce"]},"orderType":{"enum":["market","limit","stop"]},"leverage":{"$ref":"#/components/schemas/DecimalString"},"marginMode":{"enum":["cash","cross","isolated"]},"timeInForce":{"enum":["gtc","ioc","fok","post_only"]},"clientOrderId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^(?:0x)?[A-Za-z0-9_-]+$"},"sourceType":{"enum":["text_signal","agent","manual"]},"sourceExternalId":{"type":"string","maxLength":128},"positionMode":{"enum":["one_way","hedge"]},"positionSide":{"enum":["long","short"]},"venueContext":{"type":"object","additionalProperties":false,"properties":{"subAccountId":{"type":"string"},"mainAccountId":{"type":"string"},"vaultAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/validate-order":{"post":{"summary":"Trading Order Validator","operationId":"validate_order","x-price-usd":0.01,"x-price-usdt":0.01,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["exchange","intent"],"additionalProperties":false,"properties":{"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"intent":{"$ref":"#/components/schemas/TradingIntentV1"}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/format-exchange-payload":{"post":{"summary":"Unsigned Exchange Payload Formatter","operationId":"format_exchange_payload","x-price-usd":0.01,"x-price-usdt":0.01,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["exchange","intent"],"additionalProperties":false,"properties":{"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"intent":{"$ref":"#/components/schemas/TradingIntentV1"}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/prepare-order":{"post":{"summary":"Trading Order Preparer","operationId":"prepare_order","x-price-usd":0.2,"x-price-usdt":0.2,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["exchange","accountBalance","riskPercent"],"oneOf":[{"required":["rawSignal"],"not":{"required":["signal"]}},{"required":["signal"],"not":{"required":["rawSignal"]}}],"additionalProperties":false,"properties":{"rawSignal":{"type":"string","minLength":3,"maxLength":4000},"signal":{"$ref":"#/components/schemas/SignalV11"},"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"accountBalance":{"$ref":"#/components/schemas/DecimalString"},"riskPercent":{"$ref":"#/components/schemas/DecimalString"},"valuePerPriceUnit":{"$ref":"#/components/schemas/DecimalString"},"market":{"enum":["spot","perpetual","futures"]},"positionAction":{"enum":["open","close","reduce"]},"orderType":{"enum":["market","limit","stop"]},"leverage":{"$ref":"#/components/schemas/DecimalString"},"marginMode":{"enum":["cross","isolated"]},"timeInForce":{"enum":["gtc","ioc","fok","post_only"]},"clientOrderId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^(?:0x)?[A-Za-z0-9_-]+$"},"sourceType":{"enum":["text_signal","agent","manual"]},"sourceExternalId":{"type":"string","maxLength":128},"positionMode":{"enum":["one_way","hedge"]},"positionSide":{"enum":["long","short"]},"venueContext":{"type":"object","additionalProperties":false,"properties":{"subAccountId":{"type":"string"},"mainAccountId":{"type":"string"},"vaultAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}}}},"example":{"rawSignal":"BUY BTCUSDT ENTRY 60000 SL 59000 TP 62000 5X","exchange":"okx","market":"perpetual","accountBalance":"10000","riskPercent":"1","positionMode":"one_way","marginMode":"cross"}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareOrderResponse"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareOrderResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/txguard/preflight":{"post":{"summary":"Transaction Intent Validator","operationId":"txguard_preflight","x-price-usd":0.01,"x-price-usdt":0.01,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["transaction"],"additionalProperties":false,"properties":{"transaction":{"type":"object","required":["chainId","to"],"additionalProperties":false,"properties":{"chainId":{"enum":[1,56,196,42161,8453]},"to":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"data":{"type":"string","pattern":"^0x(?:[a-fA-F0-9]{2})*$","maxLength":131074},"valueWei":{"$ref":"#/components/schemas/DecimalString"}}},"policy":{"$ref":"#/components/schemas/TxPolicyV1"},"policyId":{"type":"string","pattern":"^pol_[A-Za-z0-9_-]+$"}},"description":"Supply exactly one of policy or policyId."}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/secrets/scan":{"post":{"summary":"Secret / Prompt Safety Scanner","operationId":"secrets_scan","x-price-usd":0.01,"x-price-usdt":0.01,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":100000}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/market/normalize":{"post":{"summary":"Market Data Normalizer","operationId":"market_normalize","x-price-usd":0.02,"x-price-usdt":0.02,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["observations"],"additionalProperties":false,"properties":{"observations":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","required":["source","symbol","timestamp","price"],"additionalProperties":false,"properties":{"source":{"type":"string","minLength":1,"maxLength":100},"symbol":{"type":"string","minLength":2,"maxLength":32},"timestamp":{"type":"string","format":"date-time"},"price":{"$ref":"#/components/schemas/DecimalString"},"volume24h":{"$ref":"#/components/schemas/DecimalString"},"fundingRate":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"openInterest":{"$ref":"#/components/schemas/DecimalString"}}}}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/token-safety/scan":{"post":{"summary":"Token Safety Scanner","operationId":"token_safety_scan","x-price-usd":0.05,"x-price-usdt":0.05,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chainId","address","bytecode"],"additionalProperties":false,"properties":{"chainId":{"type":"integer","minimum":1},"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"bytecode":{"type":"string","pattern":"^0x(?:[a-fA-F0-9]{2})*$","maxLength":131074},"owner":{"oneOf":[{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},{"type":"null"}]},"proxyImplementation":{"oneOf":[{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},{"type":"null"}]},"liquidityUsd":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"honeypotEvidence":{"oneOf":[{"type":"object","required":["source","buySucceeded","sellSucceeded"],"additionalProperties":false,"properties":{"source":{"type":"string","minLength":1,"maxLength":100},"buySucceeded":{"type":"boolean"},"sellSucceeded":{"type":"boolean"}}},{"type":"null"}]},"privileges":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":100}}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/swap-route/explain":{"post":{"summary":"Swap Route Explainer","operationId":"swap_route_explain","x-price-usd":0.03,"x-price-usdt":0.03,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hops","quotedAmountOut","minimumAmountOut","approvals"],"additionalProperties":false,"properties":{"hops":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["chainId","venue","tokenIn","tokenOut","amountIn","amountOut"],"additionalProperties":false,"properties":{"chainId":{"type":"integer","minimum":1},"venue":{"type":"string","minLength":1,"maxLength":100},"tokenIn":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"tokenOut":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"amountIn":{"$ref":"#/components/schemas/DecimalString"},"amountOut":{"$ref":"#/components/schemas/DecimalString"},"feeAmount":{"$ref":"#/components/schemas/DecimalString"}}}},"quotedAmountOut":{"$ref":"#/components/schemas/DecimalString"},"minimumAmountOut":{"$ref":"#/components/schemas/DecimalString"},"approvals":{"type":"array","maxItems":20,"items":{"type":"object","required":["token","spender","amount"],"additionalProperties":false,"properties":{"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"spender":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"amount":{"$ref":"#/components/schemas/DecimalString"}}}}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/wallet/exposure":{"post":{"summary":"Wallet Exposure Report","operationId":"wallet_exposure","x-price-usd":0.05,"x-price-usdt":0.05,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","holdings"],"additionalProperties":false,"properties":{"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"holdings":{"type":"array","maxItems":2000,"items":{"type":"object","required":["chainId","token","amount","priceUsd"],"additionalProperties":false,"properties":{"chainId":{"type":"integer","minimum":1},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"amount":{"$ref":"#/components/schemas/DecimalString"},"priceUsd":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"costBasisUsd":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]}}}}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/backtest/quick-check":{"post":{"summary":"Backtest Quick Check","operationId":"backtest_quick_check","x-price-usd":0.25,"x-price-usdt":0.25,"x-settlement-unit":"USDT","x-payment-schemes":["exact","aggr_deferred"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["candles","strategy"],"additionalProperties":false,"properties":{"candles":{"type":"array","minItems":3,"maxItems":2000,"items":{"type":"object","required":["timestamp","open","high","low","close"],"additionalProperties":false,"properties":{"timestamp":{"type":"string","format":"date-time"},"open":{"$ref":"#/components/schemas/DecimalString"},"high":{"$ref":"#/components/schemas/DecimalString"},"low":{"$ref":"#/components/schemas/DecimalString"},"close":{"$ref":"#/components/schemas/DecimalString"}}}},"strategy":{"type":"object","required":["side","entry","exit","feeBps"],"additionalProperties":false,"properties":{"side":{"enum":["long","short"]},"entry":{"type":"object","required":["type","fastPeriod","slowPeriod"],"additionalProperties":false,"properties":{"type":{"const":"sma_cross"},"fastPeriod":{"type":"integer","minimum":2,"maximum":500},"slowPeriod":{"type":"integer","minimum":3,"maximum":2000}}},"exit":{"type":"object","required":["type","takeProfitPercent","stopLossPercent"],"additionalProperties":false,"properties":{"type":{"const":"take_profit_stop_loss"},"takeProfitPercent":{"$ref":"#/components/schemas/DecimalString"},"stopLossPercent":{"$ref":"#/components/schemas/DecimalString"}}},"feeBps":{"$ref":"#/components/schemas/DecimalString"}},"description":"Bounded sma_cross + take_profit_stop_loss DSL; arbitrary code is not accepted."}}}}}},"responses":{"200":{"description":"Successful deterministic result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"402":{"description":"Payment required when PAYMENT_MODE=okx"},"422":{"description":"Deterministic result is invalid or incomplete; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required public metadata/RPC unavailable; not settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/txguard/policies":{"post":{"summary":"Create a saved TxGuard policy","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxPolicyV1"}}}},"responses":{"201":{"description":"Policy and one-time admin token"},"503":{"description":"Bounded saved-policy capacity reached"}}}},"/v1/txguard/policies/{policyId}":{"get":{"summary":"Read a saved policy with admin bearer token","responses":{"200":{"description":"Policy"},"401":{"description":"Unauthorized"}}},"put":{"summary":"Replace a saved policy with admin bearer token","responses":{"200":{"description":"Updated"},"401":{"description":"Unauthorized"}}},"delete":{"summary":"Delete a saved policy with admin bearer token","responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"}}}}},"components":{"schemas":{"DecimalString":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$","examples":["65123.5"]},"TxPolicyV1":{"type":"object","required":["name","allowedChainIds"],"additionalProperties":false,"properties":{"schemaVersion":{"const":"1.0","default":"1.0"},"name":{"type":"string","minLength":1,"maxLength":100},"allowedChainIds":{"type":"array","minItems":1,"maxItems":5,"items":{"enum":[1,56,196,42161,8453]}},"allowedTo":{"type":"array","maxItems":100,"items":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}},"deniedTo":{"type":"array","maxItems":100,"items":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}},"allowedSelectors":{"type":"array","maxItems":100,"items":{"type":"string","pattern":"^0x[a-fA-F0-9]{8}$"}},"maxNativeValueWei":{"$ref":"#/components/schemas/DecimalString"},"requireConfirmForUnlimitedApproval":{"type":"boolean","default":true}}},"SignalWarning":{"type":"object","required":["code","severity","message"],"additionalProperties":false,"properties":{"code":{"type":"string"},"severity":{"enum":["error","confirm","warning"]},"message":{"type":"string"}}},"SignalV11":{"type":"object","required":["schemaVersion","status","symbol","side","entry","stopLoss","takeProfits","leverage","exchange","market","orderType","missingFields","warnings"],"additionalProperties":false,"properties":{"schemaVersion":{"const":"1.1"},"status":{"enum":["ready","partial"]},"symbol":{"type":["string","null"]},"side":{"enum":["buy","sell",null]},"entry":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"stopLoss":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"takeProfits":{"type":"array","items":{"$ref":"#/components/schemas/DecimalString"}},"leverage":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid",null]},"market":{"enum":["spot","perpetual","futures",null]},"orderType":{"enum":["market","limit","stop"]},"missingFields":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/SignalWarning"}}}},"RiskReportV11":{"type":"object","required":["schemaVersion","status","entry","stopLoss","stopDistance","riskAmount","riskPercent","riskReward","quantity","quantityUnit","quantityReason","notional","requiredMargin","estimatedLossAtStop","takeProfits","warnings","assumptions"],"properties":{"schemaVersion":{"const":"1.1"},"status":{"enum":["calculated","partial","invalid"]},"entry":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"stopLoss":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"stopDistance":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"riskAmount":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"riskPercent":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"riskReward":{"type":"array","items":{"type":"object"}},"quantity":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"quantityUnit":{"enum":["base","quote","contracts",null]},"quantityReason":{"type":["string","null"]},"notional":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"requiredMargin":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"estimatedLossAtStop":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"takeProfits":{"type":"array","items":{"type":"object"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/SignalWarning"}},"assumptions":{"type":"array","items":{"type":"string"}}}},"TradingIntentV1":{"type":"object","required":["schemaVersion","market","symbol","side","positionAction","positionMode","positionSide","orderType","entry","stopLoss","takeProfits","account","quantity","quantityUnit","timeInForce","clientOrderId","venueContext","source"],"properties":{"schemaVersion":{"const":"1.1"},"market":{"enum":["spot","perpetual","futures"]},"symbol":{"type":"string"},"side":{"enum":["buy","sell"]},"positionAction":{"enum":["open","close","reduce"]},"positionMode":{"enum":["one_way","hedge"]},"positionSide":{"enum":["long","short",null]},"orderType":{"enum":["market","limit","stop"]},"entry":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"stopLoss":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"takeProfits":{"type":"array","items":{"type":"object"}},"account":{"type":"object"},"quantity":{"oneOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"quantityUnit":{"enum":["base","quote","contracts",null]},"timeInForce":{"enum":["gtc","ioc","fok","post_only"]},"clientOrderId":{"type":["string","null"]},"venueContext":{"type":"object"},"source":{"type":"object"}}},"CallerField":{"type":"object","required":["location","name","required"],"additionalProperties":false,"properties":{"location":{"enum":["header","query","body"]},"name":{"type":"string"},"required":{"type":"boolean"}}},"ExecutionBinding":{"type":"object","required":["fromStep","from","to"],"additionalProperties":false,"properties":{"fromStep":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}}},"ExecutionStep":{"type":"object","required":["id","kind","executeWhen","dependsOn","requestTemplate","signing","bindings"],"additionalProperties":false,"properties":{"id":{"type":"string"},"kind":{"enum":["entry","stop_loss","take_profit"]},"executeWhen":{"enum":["immediate","after_entry_filled"]},"dependsOn":{"type":"array","items":{"type":"string"}},"bindings":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionBinding"}},"requestTemplate":{"type":"object","required":["method","baseUrl","path","headersRequired","query","body"],"additionalProperties":false,"properties":{"method":{"const":"POST"},"baseUrl":{"type":"string","format":"uri"},"path":{"type":"string"},"headersRequired":{"type":"array","items":{"type":"string"}},"query":{"type":"object"},"body":{"oneOf":[{"type":"object"},{"type":"array"}]}}},"signing":{"type":"object","required":["scheme","callerFields"],"additionalProperties":false,"properties":{"scheme":{"type":"string"},"callerFields":{"type":"array","items":{"$ref":"#/components/schemas/CallerField"}}}}}},"ExecutionPlanV11":{"type":"object","required":["exchange","unsigned","preconditions","steps"],"additionalProperties":false,"properties":{"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"unsigned":{"const":true},"preconditions":{"type":"array","items":{"$ref":"#/components/schemas/SignalWarning"}},"steps":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ExecutionStep"}}}},"ParseSignalResponse":{"type":"object","required":["requestId","signal"],"additionalProperties":false,"properties":{"requestId":{"type":"string"},"signal":{"$ref":"#/components/schemas/SignalV11"}}},"ParseSignalInvalidResponse":{"type":"object","required":["requestId","status","signal","error"],"additionalProperties":false,"properties":{"requestId":{"type":"string"},"status":{"const":"invalid"},"signal":{"$ref":"#/components/schemas/SignalV11"},"error":{"type":"object","required":["code","message"],"additionalProperties":false,"properties":{"code":{"const":"SIGNAL_NOT_ACTIONABLE"},"message":{"type":"string"}}}}},"RiskResponse":{"type":"object","required":["requestId","signal","risk","metadata"],"additionalProperties":false,"properties":{"requestId":{"type":"string"},"signal":{"$ref":"#/components/schemas/SignalV11"},"risk":{"$ref":"#/components/schemas/RiskReportV11"},"metadata":{"type":["object","null"]}}},"RiskInvalidResponse":{"type":"object","required":["requestId","status","signal","risk"],"properties":{"requestId":{"type":"string"},"status":{"const":"invalid"},"signal":{"$ref":"#/components/schemas/SignalV11"},"risk":{"oneOf":[{"$ref":"#/components/schemas/RiskReportV11"},{"type":"null"}]},"metadata":{"type":["object","null"]},"error":{"type":"object"}}},"PrepareOrderResponse":{"type":"object","required":["requestId","status","exchange","signal","risk","intent","executionPlan","warnings"],"properties":{"requestId":{"type":"string"},"status":{"enum":["ready","confirm","partial"]},"exchange":{"enum":["okx","coinw","binance","bybit","bitget","kraken","coinbase","grvt","hyperliquid"]},"signal":{"$ref":"#/components/schemas/SignalV11"},"risk":{"oneOf":[{"$ref":"#/components/schemas/RiskReportV11"},{"type":"null"}]},"intent":{"oneOf":[{"$ref":"#/components/schemas/TradingIntentV1"},{"type":"null"}]},"executionPlan":{"oneOf":[{"$ref":"#/components/schemas/ExecutionPlanV11"},{"type":"null"}]},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/SignalWarning"}}}},"ErrorResponse":{"type":"object","required":["error","message","requestId"],"additionalProperties":false,"properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}},"responses":{"ValidationError":{"description":"Request failed strict schema or deterministic validation","content":{"application/json":{"schema":{"type":"object"}}}}}}}