{"openapi":"3.1.0","info":{"title":"AI Agent API","version":"2.0.0","description":"16 pay-per-call AI services via x402 micropayments. 6 complex (audit, refactor, docs, defi, trading, solidity-scan) + 4 SQL/dev tools (nl-to-sql, sql-to-nl, git-summarize, translate-code) + 6 micro-tasks (validate, classify, extract, regex, format, summarize). All responses are machine-readable JSON. No API keys — pay with USDC on Base/Arbitrum/Optimism or USDT on Tron.","contact":{"url":"https://github.com/AntoNYak0/ai-agent-api","email":"admin@agent-api-ai.duckdns.org"},"x-x402-payment":{"networks":[{"caip2":"eip155:8453","name":"Base","asset":"USDC","contract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},{"caip2":"eip155:42161","name":"Arbitrum","asset":"USDC","contract":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"},{"caip2":"eip155:10","name":"Optimism","asset":"USDC","contract":"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"},{"caip2":"tron:0x2b6653dc","name":"Tron","asset":"USDT","contract":"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}],"wallet":"0xdE7eb04faE758055642f67f30D246CcB7136C95E"}},"servers":[{"url":"https://agent-api-ai.duckdns.org","description":"Production"}],"paths":{"/api/audit":{"post":{"summary":"Security scan with OWASP Top 10 + SWC Registry taxonomy","operationId":"audit","x-x402-price":"$0.01","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"context":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"findings":{"type":"string","description":"[{severity,category,line,description,fix,code_fix}]"},"risk_score":{"type":"string","description":"0-100"},"summary":{"type":"string","description":"string"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.01 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/refactor":{"post":{"summary":"Refactor legacy code — DRY, SOLID, modern patterns","operationId":"refactor","x-x402-price":"$0.01","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"instructions":{"type":"string"},"context":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"issues_found":{"type":"string","description":"[...]"},"refactored_code":{"type":"string","description":"string"},"changes":{"type":"string","description":"[{what,why,before,after}]"},"complexity_reduction_percent":{"type":"string","description":"number"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.01 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/docs":{"post":{"summary":"Generate technical docs with architecture, signatures, examples","operationId":"docs","x-x402-price":"$0.005","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"context":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"overview":{"type":"string","description":"string"},"architecture":{"type":"string","description":"string"},"functions":{"type":"string","description":"[{signature,params,returns,example}]"},"dependencies":{"type":"string","description":"[string]"},"integration_examples":{"type":"string","description":"[string]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/defi-analyze":{"post":{"summary":"DeFi protocol analysis — risks, tokenomics, architecture (training data only)","operationId":"defi_analyze","x-x402-price":"$0.01","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"protocol":{"type":"string"},"chain":{"type":"string"},"details":{"type":"string"},"onchain_data":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"overview":{"type":"string","description":"string"},"architecture":{"type":"string","description":"{...}"},"tokenomics":{"type":"string","description":"{...}"},"risks":{"type":"string","description":"[{category,severity,description}]"},"data_freshness":{"type":"string","description":"training_data_only"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.01 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/trading-signal":{"post":{"summary":"Crypto trading analytics — qualitative, training data only, NOT financial advice","operationId":"trading_signal","x-x402-price":"$0.005","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"asset":{"type":"string"},"timeframe":{"type":"string"},"additional_info":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"overview":{"type":"string","description":"string"},"technical_analysis":{"type":"string","description":"{trend,support_zones,resistance_zones}"},"sentiment":{"type":"string","description":"{...}"},"disclaimer":{"type":"string","description":"string"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/solidity-scan":{"post":{"summary":"Solidity vulnerability scanner — 36 SWC checks + DeFi exploit patterns","operationId":"solidity_scan","x-x402-price":"$0.02","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"context":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"vulnerabilities":{"type":"string","description":"[{swc_id,severity,title,description,line,fix,code_example}]"},"security_score":{"type":"string","description":"0-100"},"gas_optimizations":{"type":"string","description":"[...]"},"recommendations":{"type":"string","description":"[string]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.02 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/nl-to-sql":{"post":{"summary":"Convert natural language to SQL query","operationId":"nl_to_sql","x-x402-price":"$0.005","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string","description":"string"},"explanation":{"type":"string","description":"string"},"dialect":{"type":"string","description":"string"},"assumed_schema":{"type":"string","description":"string"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/sql-to-nl":{"post":{"summary":"Explain SQL query in plain English","operationId":"sql_to_nl","x-x402-price":"$0.005","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"explanation":{"type":"string","description":"string"},"tables_used":{"type":"string","description":"[string]"},"operations":{"type":"string","description":"[string]"},"complexity":{"type":"string","description":"simple|moderate|complex"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/git-summarize":{"post":{"summary":"Summarize git diff into PR description","operationId":"git_summarize","x-x402-price":"$0.005","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"diff":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"string"},"description":{"type":"string","description":"string"},"breaking_changes":{"type":"string","description":"[string]"},"files_summary":{"type":"string","description":"[{file,what_changed,risk}]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/translate-code":{"post":{"summary":"Translate code between languages (Python, TS, Rust, Go, Solidity)","operationId":"translate_code","x-x402-price":"$0.01","x-x402-scheme":"upto","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"source_lang":{"type":"string"},"target_lang":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"translated_code":{"type":"string","description":"string"},"notes":{"type":"string","description":"[string]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.01 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/validate-json":{"post":{"summary":"Validate JSON/YAML structure, schema, types","operationId":"validate_json","x-x402-price":"$0.0005","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string"},"schema":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"string","description":"boolean"},"errors":{"type":"string","description":"[{line,message,fix}]"},"warnings":{"type":"string","description":"[{line,message}]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.0005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/classify-text":{"post":{"summary":"Classify text — sentiment, category, keywords, language","operationId":"classify_text","x-x402-price":"$0.001","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"categories":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"sentiment":{"type":"string","description":"positive|negative|neutral"},"category":{"type":"string","description":"string"},"confidence":{"type":"number","description":"0.0-1.0"},"keywords":{"type":"string","description":"[string]"},"language":{"type":"string","description":"string"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.001 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/extract-data":{"post":{"summary":"Extract structured data — names, emails, phones, URLs, dates, amounts","operationId":"extract_data","x-x402-price":"$0.005","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"entities":{"type":"string","description":"[{type,value,confidence}]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.005 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/generate-regex":{"post":{"summary":"Generate regex pattern from description with test cases","operationId":"generate_regex","x-x402-price":"$0.002","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"pattern":{"type":"string","description":"string"},"flags":{"type":"string","description":"string"},"test_cases":{"type":"string","description":"[{input,matches,captured}]"},"explanation":{"type":"string","description":"string"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.002 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/format-data":{"post":{"summary":"Convert data between CSV, JSON, YAML formats","operationId":"format_data","x-x402-price":"$0.003","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string"},"source_format":{"type":"string"},"target_format":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"converted":{"type":"string","description":"string"},"format":{"type":"string","description":"string"},"warnings":{"type":"string","description":"[string]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.003 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}},"/api/summarize":{"post":{"summary":"Summarize text to N words, extract key points","operationId":"summarize","x-x402-price":"$0.002","x-x402-scheme":"exact","x-x402-networks":["eip155:8453","eip155:42161","eip155:10","tron:0x2b6653dc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"max_length":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response (JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","description":"string"},"word_count":{"type":"number","description":"integer"},"key_points":{"type":"string","description":"[string]"}}}}},"headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"true when x402 settlement completed"}}},"402":{"description":"Payment required — $0.002 USDC","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded JSON with x402 payment details"}}}}}}}}