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
behaviorsarray and map it to custody controls
Prerequisites
- A TestMachine API key (see Authentication)
- A token contract address (
0x…) on a supported EVM chain - The chain ID (see Supported networks)
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 example1for Ethereum,8453for 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:
- Confirm your API key setup in Authentication
- Confirm the chain ID in Supported networks
- Use Errors for status-code guidance
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