{"openapi":"3.1.0","info":{"title":"Thru Explorer Agent API","version":"0.1.0","description":"REST API for AI agents to access blockchain data from the Thru network explorer. Every response includes a natural-language `summary` field for LLM consumption."},"servers":[{"url":"https://scan.thru.org","description":"Production"},{"url":"http://localhost:3010","description":"Local development"}],"x-global-parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."}],"paths":{"/api/block/{slot}":{"get":{"operationId":"getBlock","summary":"Get block by slot number","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"slot","in":"path","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Block data with transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBlock"}}}},"404":{"description":"Block not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/tx/{signature}":{"get":{"operationId":"getTransaction","summary":"Get transaction by signature","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"signature","in":"path","required":true,"schema":{"type":"string"},"description":"Transaction signature in ThruFmt (ts...)"}],"responses":{"200":{"description":"Transaction details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseTransaction"}}}},"404":{"description":"Transaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/address/{address}":{"get":{"operationId":"getAccount","summary":"Get account metadata by address","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"Account address in ThruFmt (ta...)"}],"responses":{"200":{"description":"Account metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseAccount"}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/address/{address}/transactions":{"get":{"operationId":"getAccountTransactions","summary":"List transactions for an account","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"address","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageSize","in":"query","schema":{"type":"integer","default":10,"minimum":1,"maximum":100}},{"name":"pageToken","in":"query","schema":{"type":"string"},"description":"Opaque token from a previous response's pagination.nextPageToken"}],"responses":{"200":{"description":"Paginated transaction list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseAccountTransactions"}}}}}}},"/api/blocks/recent":{"get":{"operationId":"getRecentBlocks","summary":"List recent blocks","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"limit","in":"query","schema":{"type":"integer","default":10,"minimum":1,"maximum":50}}],"responses":{"200":{"description":"Recent blocks list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseRecentBlocks"}}}}}}},"/api/transactions/recent":{"get":{"operationId":"getRecentTransactions","summary":"List recent transactions across blocks","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"limit","in":"query","schema":{"type":"integer","default":10,"minimum":1,"maximum":50}}],"responses":{"200":{"description":"Recent transactions list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseRecentTransactions"}}}}}}},"/api/search":{"get":{"operationId":"search","summary":"Search by block number, transaction signature, or address","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"Block number (numeric), transaction signature (ts...), or address (ta...)"}],"responses":{"200":{"description":"Search results with API links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseSearch"}}}}}}},"/api/abi/{program}":{"get":{"operationId":"getAbi","summary":"Get on-chain ABI for a program","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","toon"],"default":"json"},"description":"Optional response format. Defaults to JSON. Use format=toon for MCP/LLM-oriented text output."},{"name":"network","in":"query","required":false,"schema":{"type":"string","enum":["alphanet","betanet"]},"description":"Select a deployment-configured network. If omitted, uses the first configured network. Also supported on /api/mcp."},{"name":"rpc","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Legacy network selector. Only RPC URLs in the deployment network list are accepted. Prefer network=<slug>. Conflicting selectors, duplicates, and unsupported values return HTTP 400."},{"name":"program","in":"path","required":true,"schema":{"type":"string"},"description":"Program address in ThruFmt (ta...)"}],"responses":{"200":{"description":"ABI YAML and program name","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseAbi"}}}},"404":{"description":"ABI not found for program","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}},"StatusBadge":{"type":"object","required":["label","kind"],"properties":{"label":{"type":"string"},"kind":{"type":"string","enum":["success","pending","failed","default","info","neutral"]}}},"Units":{"type":"object","properties":{"requested":{"type":"string"},"consumed":{"type":"string"}}},"BlockUnits":{"type":"object","properties":{"max":{"type":"string"},"consumed":{"type":"string"}}},"AccountFlags":{"type":"object","properties":{"isProgram":{"type":"boolean"},"isPrivileged":{"type":"boolean"},"isUncompressable":{"type":"boolean"},"isEphemeral":{"type":"boolean"},"isDeleted":{"type":"boolean"},"isNew":{"type":"boolean"},"isCompressed":{"type":"boolean"}}},"TransactionRow":{"type":"object","required":["signature","program","feePayer","status"],"properties":{"signature":{"type":"string"},"truncatedSignature":{"type":"string"},"program":{"type":"string"},"feePayer":{"type":"string"},"fee":{"type":["string","null"]},"status":{"type":"string","enum":["SUCCESS","FAILED","PENDING"]},"slot":{"type":"integer"}}},"ApiResponseBlock":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"slot":{"type":"integer"},"blockHash":{"type":"string"},"producer":{"type":"string"},"blockTimestampNs":{"type":"string"},"consensusStatus":{"$ref":"#/components/schemas/StatusBadge"},"executionStatus":{"$ref":"#/components/schemas/StatusBadge"},"computeUnits":{"$ref":"#/components/schemas/BlockUnits"},"stateUnits":{"$ref":"#/components/schemas/BlockUnits"},"transactionCount":{"type":"integer"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionRow"}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseTransaction":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"slot":{"type":"integer"},"signature":{"type":"string"},"feePayer":{"type":"string"},"program":{"type":"string"},"fee":{"type":"string"},"executionError":{"type":"object","properties":{"vmErrorStatus":{"$ref":"#/components/schemas/StatusBadge"},"vmError":{"type":"integer"},"userErrorCode":{"type":"integer"}}},"consensusStatus":{"$ref":"#/components/schemas/StatusBadge"},"computeUnits":{"$ref":"#/components/schemas/Units"},"stateUnits":{"$ref":"#/components/schemas/Units"},"memoryUnits":{"$ref":"#/components/schemas/Units"},"accounts":{"type":"object","properties":{"readWriteAccounts":{"type":"array","items":{"type":"string"}},"readOnlyAccounts":{"type":"array","items":{"type":"string"}},"feePayer":{"type":"string"},"program":{"type":"string"}}},"instructions":{"type":"object","properties":{"instruction":{"type":"string","description":"Hex-encoded instruction data"},"instructionDataSize":{"type":"integer"},"programAddress":{"type":"string"}}},"events":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"programAddress":{"type":"string"},"payloadHex":{"type":"string"},"eventType":{"type":"integer"}}}},"eventsCount":{"type":"integer"},"eventsSize":{"type":"integer"},"pagesUsed":{"type":"integer"}}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseAccount":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"owner":{"type":"string"},"balance":{"type":"string"},"balanceRaw":{"type":"string"},"flags":{"$ref":"#/components/schemas/AccountFlags"},"dataSize":{"type":"integer"},"seq":{"type":"string"},"nonce":{"type":"string"},"slot":{"type":"string"},"blockTimestampNs":{"type":"string"}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseAccountTransactions":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionRow"}},"pagination":{"type":"object","properties":{"pageSize":{"type":"integer"},"nextPageToken":{"type":"string"},"totalSize":{"type":"string"}}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseRecentBlocks":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"blocks":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"integer"},"blockHash":{"type":"string"},"producer":{"type":"string"},"consensusStatus":{"$ref":"#/components/schemas/StatusBadge"},"transactionCount":{"type":"integer"}}}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseRecentTransactions":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"transactions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionRow"}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseSearch":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["block","transaction","address"]},"label":{"type":"string"},"value":{"type":"string"},"apiHref":{"type":"string"}}}}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}},"ApiResponseAbi":{"type":"object","required":["data","summary","links"],"properties":{"data":{"type":"object","properties":{"programAddress":{"type":"string"},"programName":{"type":["string","null"]},"abi":{"type":"string","description":"ABI in YAML format"}}},"summary":{"type":"string"},"links":{"type":"object","additionalProperties":{"type":"string"}}}}}}}