Skip to main content

Quickstart

Use this guide to make your first request to the TestMachine Token Custody API and interpret the custody-risk behaviors returned for an ERC-20 token.

What you'll do

  • Authenticate with an API key
  • Request a token custody analysis (pull mode)
  • Read the behaviors array and map it to custody controls

Prerequisites

Make your first request

Set your API key

Store your API key in an environment variable:

export TESTMACHINE_API_KEY="<YOUR_API_KEY>"

Treat API keys like passwords. Don't commit them to source control.

Choose a token

You'll need:

  • NETWORK_ID — EVM chain ID (for example 1 for Ethereum, 8453 for Base)
  • ADDRESS — token contract address (checksummed or lowercase)

Example:

export NETWORK_ID=1
export ADDRESS="0x0000000000000000000000000000000000000000"

Request token analysis (pull mode)

Call your environment's token analysis endpoint using X-API-Key authentication.

Because the exact path can vary by deployment, use this as a template and map it to the endpoint described in Tokens.

curl "https://api.testmachine.ai/<TOKENS_ENDPOINT>?network_id=$NETWORK_ID&address=$ADDRESS" \
-H "X-API-Key: $TESTMACHINE_API_KEY"

Interpret the response

A successful response includes a behaviors array:

  • Use Behaviors to understand each identifier
  • Treat the result as an input into your onboarding and monitoring controls (manual review, policy checks, alerting)

Example:

{
"address": "0x…",
"network_id": 1,
"behaviors": ["pause", "upgrade", "confiscation"]
}

Handle errors

If your request fails:

Next steps

  • Read About TestMachine for architecture and modes of use
  • If you plan to run continuous monitoring (push mode), confirm the integration details for your environment and we'll document the webhook/event format