{"openapi":"3.1.0","info":{"title":"COLR Guardrail API","description":"Pre-Trade Risk API for Autonomous Trading Agents","version":"1.0.3"},"paths":{"/api/v1/auth/nonce":{"get":{"summary":"Auth Nonce","operationId":"auth_nonce_api_v1_auth_nonce_get","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","title":"Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/wallet":{"post":{"summary":"Auth Wallet","operationId":"auth_wallet_api_v1_auth_wallet_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/revoke":{"post":{"summary":"Revoke Current Token","description":"Immediately invalidates the caller's own current token server-side.\nA missing or already-invalid token isn't an error here — the caller's\nactual goal (this token no longer works) is satisfied either way.","operationId":"revoke_current_token_api_v1_auth_revoke_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/assets":{"get":{"summary":"Get Supported Assets","operationId":"get_supported_assets_api_v1_assets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AssetInfo"},"type":"array","title":"Response Get Supported Assets Api V1 Assets Get"}}}}}}},"/api/v1/analyze/trade":{"post":{"summary":"Analyze Trade","operationId":"analyze_trade_api_v1_analyze_trade_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-preview-tier","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Preview-Tier"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verdict"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyze/free":{"post":{"summary":"Free Analyze Trade","operationId":"free_analyze_trade_api_v1_analyze_free_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verdict"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/config":{"get":{"summary":"Get Config","operationId":"get_config_api_v1_config_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-preview-tier","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Preview-Tier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Update Config","operationId":"update_config_api_v1_config_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-preview-tier","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Preview-Tier"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/simulate-balance":{"post":{"summary":"Simulate Balance","description":"Simulate a wallet's ERC-20 balance after a hypothetical trade using\neth_call state override. No on-chain transaction is sent.","operationId":"simulate_balance_api_v1_simulate_balance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateBalanceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/token-safety":{"post":{"summary":"Token Safety","description":"Check whether a token contract is a honeypot. Public, no auth,\nrate-limited per IP.","operationId":"token_safety_api_v1_token_safety_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenSafetyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/wallet/{wallet}":{"get":{"summary":"Audit Wallet","description":"Fetch audit history for a wallet. Newest first.\nPublic, unauthenticated, but rate-limited per IP.","operationId":"audit_wallet_api_v1_audit_wallet__wallet__get","parameters":[{"name":"wallet","in":"path","required":true,"schema":{"type":"string","title":"Wallet"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditWalletResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/global":{"get":{"summary":"Audit Global","description":"System-wide decision log. Public, rate-limited per IP.","operationId":"audit_global_api_v1_audit_global_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditGlobalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/verify/{wallet}":{"get":{"summary":"Audit Verify","description":"Recompute every stored decision's hash for a wallet AND verify the\nhash-chain links. Rate-limited per IP — full re-hash is CPU-heavy.","operationId":"audit_verify_api_v1_audit_verify__wallet__get","parameters":[{"name":"wallet","in":"path","required":true,"schema":{"type":"string","title":"Wallet"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/verify":{"get":{"summary":"Audit Verify Global","description":"System-wide integrity check across the global decision stream.\nRate-limited per IP — full chain re-hash is CPU-heavy.","operationId":"audit_verify_global_api_v1_audit_verify_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditVerifyGlobalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"tags":["status"],"summary":"Healthz","description":"Liveness only. Fast path. 200 = process up + Redis reachable.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/status.json":{"get":{"tags":["status"],"summary":"Status Json","operationId":"status_json_status_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/status":{"get":{"tags":["status"],"summary":"Status Page","operationId":"status_page_status_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/debug/feeds":{"get":{"summary":"Debug Feeds","operationId":"debug_feeds_debug_feeds_get","parameters":[{"name":"X-Admin-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AssetInfo":{"properties":{"symbol":{"type":"string","title":"Symbol"},"contract_address":{"type":"string","title":"Contract Address"},"is_native":{"type":"boolean","title":"Is Native","default":false}},"type":"object","required":["symbol","contract_address"],"title":"AssetInfo"},"AuditGlobalResponse":{"properties":{"count":{"type":"integer","title":"Count"},"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"}},"type":"object","required":["count","records"],"title":"AuditGlobalResponse"},"AuditVerifyGlobalResponse":{"properties":{"total":{"type":"integer","title":"Total"},"tampered":{"type":"integer","title":"Tampered"},"healthy":{"type":"boolean","title":"Healthy"},"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"}},"type":"object","required":["total","tampered","healthy","records"],"title":"AuditVerifyGlobalResponse"},"AuditVerifyResponse":{"properties":{"wallet":{"type":"string","title":"Wallet"},"total":{"type":"integer","title":"Total"},"tampered":{"type":"integer","title":"Tampered"},"healthy":{"type":"boolean","title":"Healthy"},"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"}},"type":"object","required":["wallet","total","tampered","healthy","records"],"title":"AuditVerifyResponse"},"AuditWalletResponse":{"properties":{"wallet":{"type":"string","title":"Wallet"},"count":{"type":"integer","title":"Count"},"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"}},"type":"object","required":["wallet","count","records"],"title":"AuditWalletResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"NonceResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"NonceResponse"},"PolicyConfig":{"properties":{"wallet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet"},"max_trade_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Trade Usd"},"blocked_assets":{"items":{"type":"string"},"type":"array","title":"Blocked Assets","default":[]},"editable":{"type":"boolean","title":"Editable","default":false}},"type":"object","title":"PolicyConfig"},"RevokeResponse":{"properties":{"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["revoked"],"title":"RevokeResponse"},"SimulateBalanceRequest":{"properties":{"token_address":{"type":"string","maxLength":42,"minLength":42,"title":"Token Address"},"holder":{"type":"string","maxLength":42,"minLength":42,"title":"Holder"},"delta":{"type":"number","title":"Delta","description":"Signed amount (negative = spend)"},"balance_slot":{"anyOf":[{"type":"integer","maximum":64.0,"minimum":0.0},{"type":"null"}],"title":"Balance Slot"},"decimals":{"type":"integer","maximum":36.0,"minimum":0.0,"title":"Decimals","default":18}},"type":"object","required":["token_address","holder","delta"],"title":"SimulateBalanceRequest"},"SimulateBalanceResponse":{"properties":{"token_address":{"type":"string","title":"Token Address"},"holder":{"type":"string","title":"Holder"},"balance_slot":{"type":"integer","title":"Balance Slot"},"current":{"type":"number","title":"Current"},"delta":{"type":"number","title":"Delta"},"post_trade":{"type":"number","title":"Post Trade"}},"type":"object","required":["token_address","holder","balance_slot","current","delta","post_trade"],"title":"SimulateBalanceResponse"},"TokenSafetyRequest":{"properties":{"contract_address":{"type":"string","maxLength":42,"minLength":42,"title":"Contract Address"}},"type":"object","required":["contract_address"],"title":"TokenSafetyRequest"},"TradeRequest":{"properties":{"wallet":{"type":"string","title":"Wallet"},"asset":{"type":"string","maxLength":32,"minLength":1,"title":"Asset"},"contract_address":{"type":"string","maxLength":42,"minLength":42,"title":"Contract Address"},"side":{"type":"string","title":"Side"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"max_slippage_bps":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Max Slippage Bps","default":100},"deadline":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Deadline"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"allow_unregistered":{"type":"boolean","title":"Allow Unregistered","default":false}},"type":"object","required":["wallet","asset","contract_address","side","amount"],"title":"TradeRequest"},"UpdateConfigRequest":{"properties":{"blocked_assets":{"items":{"type":"string"},"type":"array","title":"Blocked Assets"}},"type":"object","required":["blocked_assets"],"title":"UpdateConfigRequest"},"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"},"Verdict":{"properties":{"decision":{"type":"string","title":"Decision"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"tier":{"type":"integer","title":"Tier"},"max_trade_usd":{"type":"number","title":"Max Trade Usd"},"calculated_notional_usd":{"type":"number","title":"Calculated Notional Usd"},"price_usd":{"type":"number","title":"Price Usd","default":0.0},"price_source":{"type":"string","title":"Price Source","default":"unavailable"},"risk_score":{"type":"integer","title":"Risk Score","default":0},"timestamp":{"type":"integer","title":"Timestamp"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"contract_risk":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Contract Risk"},"daily_pnl_usd":{"type":"number","title":"Daily Pnl Usd","default":0.0},"audit_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Hash"},"audit_seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Audit Seq"}},"type":"object","required":["decision","reasons","tier","max_trade_usd","calculated_notional_usd","timestamp"],"title":"Verdict"},"WalletLoginRequest":{"properties":{"address":{"type":"string","title":"Address"},"signature":{"type":"string","title":"Signature"}},"type":"object","required":["address","signature"],"title":"WalletLoginRequest"},"WalletLoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"},"preview_mode":{"type":"boolean","title":"Preview Mode","default":false}},"type":"object","required":["access_token","expires_in_seconds"],"title":"WalletLoginResponse"}}}}