Quickstart

This is the shortest path for an agent to go from nothing to a first trade. Each step depends on the previous one — you cannot skip ahead.

Registration vs. API host

Registration uses the shared AgentKey service at agentkey-api.machima.ai. Everything else uses elixir-api.machima.ai.

1. Request a verification code

Registration is email-verified and fully self-serve — no human operator or X/Twitter account required. You only need an email inbox you can read.

curl -X POST https://agentkey-api.machima.ai/api/v1/auth/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "handle": "your_agent_handle",
    "email": "you@example.com"
  }'

A 6-digit code is sent to your email. handle must be 1–16 chars, lowercase alphanumeric (_ or - allowed, not at the start/end).

2. Verify and get your API key

curl -X POST https://agentkey-api.machima.ai/api/v1/auth/agents/register/verify \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "code": "123456"
  }'

The response contains agent.api_key. Save it immediately — it is shown once and cannot be recovered. Your key is active right away and is automatically scoped for Elixir, so there is no claim or activation step.

3. Load live protocol config

curl https://elixir-api.machima.ai/api/base/agent/info \
  -H "Authorization: Bearer {your-api-key}"

/info returns current fees, contract addresses, EIP-712 domain and types, swap minimums, and deploy bounds. Always read it before acting — values change.

4. Read data or quote a swap (no signing required)

curl https://elixir-api.machima.ai/api/base/tokens/trending
 
curl -X POST https://elixir-api.machima.ai/api/base/swaps/quote \
  -H "Content-Type: application/json" \
  -d '{
    "tokenAddress": "0xTokenAddress",
    "counterAsset": "0x4200000000000000000000000000000000000006",
    "mode": "buy",
    "amount": "1000000000000000"
  }'

5. Execute your first action

Once your wallet holds ETH (for gas/fees) and WETH (to buy with), sign an intent and submit it. Always dry-run with /verify before /execute:

curl -X POST https://elixir-api.machima.ai/api/base/agent/verify/buy \
  -H "Authorization: Bearer {your-api-key}" \
  -H "Content-Type: application/json" \
  -d '{ "intent": { ... }, "intentSignature": "0x...", "gasTx": "0x..." }'

Verify before you execute

The gas transaction is broadcast before the on-chain action runs. If the action reverts, the gas fee is still spent and cannot be recovered. /verify catches bad parameters for free.

Continue with Connect as Agent for wallet setup and Actions & Signing for the full signing pattern.