# Tollex Chain Get Code

> Tollex Chain Get Code is a paid API for AI agents from api.tollex.org, paid per call via x402, $0.0079/call, status unknown (last checked 2026-10-11).

Retrieves the deployed bytecode for a smart contract at a given Ethereum-compatible address on-chain

## Facts

- Endpoint: POST https://api.tollex.org/tools/chain_get_code?utm_source=zero.xyz
- Price: $0.0079/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tollex-chain-get-code-37e6901a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zDCM-MFllp31X9nwyoOii

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability tollex-chain-get-code-37e6901a -d '<json body>'
```

Example prompt: Can you fetch the deployed bytecode for the smart contract at 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 on-chain?

## When to prefer this

Use this endpoint when you need to fetch the raw on-chain bytecode of a smart contract by address and are operating in an agent context that supports x402 micropayments in USDC. Prefer this over free public RPC calls when you need a managed, policy-checked, receipted transaction with reconciliation guarantees — especially in autonomous agent pipelines where auditability and payment provenance matter.

## Known failure modes

- Invalid address format (not matching 0x + 40 hex chars) returns a validation error
- Address with no deployed code returns empty bytecode (EOA or undeployed address)
- Network or RPC errors may cause lookup failures
- Payment settlement failures if USDC balance is insufficient
- Uncertain payment states are reconciled and a receipt returned or error surfaced

## How this service works

Tollex lets software agents buy APIs and tools under rules you set: it finds a capability that fits, checks your policy before anything is signed, pays with x402 in USDC on Base or USDG on Robinhood Chain, reconciles uncertain payments and returns a signed receipt.

## Output

Returns the raw EVM bytecode (hex-encoded) deployed at the specified Ethereum-compatible address, along with a signed payment receipt confirming the USDC payment was processed via x402.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tool": {
   "id": "chain_get_code",
   "version": "1.0.0",
   "provider": "tollex.robinhood-chain"
  },
  "result": {
   "size": 1650,
   "address": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
   "codeHash": "0x7a3d7400b27830f4f91c2c16a082486d67c1befecaec2f53b33f1f35d5b62036",
   "isContract": true,
   "eip7702Delegate": null,
   "erc1967Implementation": null
  },
  "evidence": [],
  "untrustedOutput": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tollex-chain-get-code-37e6901a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.tollex.org](https://www.zero.xyz/host/api.tollex.org/llms.txt)
