# Tereno Contract Interface Detector

> Tereno Contract Interface Detector is a paid API for AI agents from www.tereno.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Detects which ERC/EIP standards (ERC-20, ERC-721, ERC-1155, ERC-165, EIP-1967 proxy) a Base blockchain contract implements, with caching shared across agents.

## Facts

- Endpoint: GET https://www.tereno.xyz/api/v1/capabilities/contract.interface/invoke
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tereno-contract-interface-detector-649cf37f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WsaIcVN_RpfCxr5CVCok1

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 tereno-contract-interface-detector-649cf37f
```

Example prompt: What token standard does the Base contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 implement — is it ERC-20, ERC-721, ERC-1155, or a proxy?

## When to prefer this

Use this endpoint when you need a quick, cheap, cached determination of which ERC/EIP standards a Base contract implements — especially in workflows that gate downstream actions on token type (e.g., deciding how to transfer tokens, whether to treat a contract as upgradeable, or which ABI to use). Prefer over manual ABI probing or full indexer queries when you just need interface classification.

## Known failure modes

- Invalid or non-checksummed address returns a 400-level error
- Address is an EOA (externally owned account) with no code — reflected in result with empty interfaces
- Contract not deployed on Base returns no-code response
- Rate limit or payment failure blocks the request
- Cache miss on first call may be slightly slower; subsequent calls served from shared cache

## How this service works

What standard does this Base contract implement? Detect ERC-20, ERC-721, ERC-1155 and ERC-165 support plus EIP-1967 proxy control slots in one cheap bounded check, shared across agents for as long as the code at the address is unchanged, up to 7 days, and only for a few blocks when the target is an upgradeable proxy. Positive-sum by design: $0.02 when nobody has checked this contract yet, $0.01 once another agent has — and the wallet that computed it first earns a share of every reuse.

## Output

Returns a structured object with boolean or typed flags per interface (ERC-20, ERC-721, ERC-1155, ERC-165, EIP-1967 proxy slots), an array of reason codes explaining the detection, a validUntilBlock indicating cache freshness, and the contract's bytecode size in bytes. Also includes a verdict (allow/review/block), a capabilityId, invocationId, pricing details, and a receiptUrl.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "quote": {
       "type": "string",
       "description": "Optional single-use quote id."
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Base contract address to probe for ERC-20, ERC-721, ERC-1155, ERC-165 and EIP-1967 proxy patterns."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "capabilityId",
      "invocationId",
      "verdict",
      "result",
      "pricing",
      "receiptUrl"
     ],
     "properties": {
      "result": {
       "type": "object",
       "required": [
        "interfaces",
        "reasonCodes",
        "validUntilBlock"
       ],
       "properties": {
        "codeHash": {
         "type": [
          "string",
          "null"
         ]
        },
        "interfaces": {
         "type": "object"
        },
        "reasonCodes": {
         "type": "array"
        },
        "bytecodeBytes": {
         "type": "integer"
        },
        "validUntilBlock": {
         "type": "integer"
        }
       }
      },
      "pricing": {
       "type": "object"
      },
      "verdict": {
       "enum": [
        "allow",
        "review",
        "block"
       ]
      },
      "receiptUrl": {
       "type": "string"
      },
      "capabilityId": {
       "const": "contract.interface"
      },
      "invocationId": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tereno-contract-interface-detector-649cf37f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.tereno.xyz](https://www.zero.xyz/host/www.tereno.xyz/llms.txt)
