Documentation

Coral API reference

Create agent wallets, resolve handles, send test USDT on Ethereum Sepolia, Base Sepolia, or Solana devnet, and inspect transaction state through server-side API keys.

Mock mode is the default. Set `MOCK_PAYMENTS=false` and configure test token env vars to broadcast live testnet transfers.
shell
curl -s https://coral.buildinpublic.fun/api/v1/agents \
  -H 'Authorization: Bearer coral_sk_test_...'

Quickstart

1

Create an API key

Use the Developer Portal. The raw key is shown once.

2

Create an agent

Assign a handle, wallet, and daily/per-transaction limits.

3

Send by handle

Existing handles receive a transaction; missing handles produce a claim link.

Authentication

API v1 endpoints use a server-side bearer token. Create keys from `/developer`, store the raw key in your server environment, and send it on every request.

Authorization: Bearer coral_sk_test_...

Live Testnet Setup

Coral defaults to mock ledger mode. To broadcast testnet transfers, set `MOCK_PAYMENTS=false`, create or configure test USDT contracts/mints, and fund EVM sender wallets with gas. On Solana devnet, an optional gas bank can pay network fees and recipient token-account rent.

MOCK_PAYMENTS=false
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
BASE_SEPOLIA_USDT_ADDRESS=0x_your_base_sepolia_erc20
BASE_SEPOLIA_USDT_DECIMALS=6
ETHEREUM_SEPOLIA_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
ETHEREUM_SEPOLIA_USDT_ADDRESS=0x_your_ethereum_sepolia_erc20
ETHEREUM_SEPOLIA_USDT_DECIMALS=6
ETHEREUM_SEPOLIA_GAS_BANK_PRIVATE_KEY_PATH=/secure/path/ethereum-sepolia-gas-bank.json
ETHEREUM_SEPOLIA_GAS_BANK_MIN_ETH=0.001
ETHEREUM_SEPOLIA_GAS_BANK_TOP_UP_ETH=0.005
SOLANA_DEVNET_RPC_URL=https://api.devnet.solana.com
SOLANA_DEVNET_USDT_MINT=your_devnet_spl_mint
SOLANA_DEVNET_USDT_DECIMALS=6
SOLANA_DEVNET_GAS_BANK_SECRET_KEY_PATH=/secure/path/solana-gas-bank.json
Fund EVM sender wallets with the matching Sepolia gas token and test USDT.
Configure the Ethereum Sepolia gas bank to top up low-gas sender wallets before USDT transfers.
Fund Solana sender wallets with SPL test USDT; the gas bank can cover devnet SOL fees.
Use `chain: "ethereum-sepolia"` or `chain: "base-sepolia"` for EVM ERC-20 sends.
Use `chain: "solana-devnet"` for SPL token sends.

Runnable Examples

shell
curl -s https://coral.buildinpublic.fun/api/v1/agents \
  -H 'Authorization: Bearer coral_sk_test_...' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Research Agent",
    "handle": "research_agent",
    "dailySpendLimit": "100",
    "perTransactionLimit": "25"
  }'
shell
curl -s https://coral.buildinpublic.fun/api/v1/agents/agent_123/send \
  -H 'Authorization: Bearer coral_sk_test_...' \
  -H 'Content-Type: application/json' \
  -d '{
    "to": "alex",
    "amount": "5.00",
    "token": "USDT",
    "chain": "ethereum-sepolia"
  }'
shell
curl -s https://coral.buildinpublic.fun/api/v1/handles/alex \
  -H 'Authorization: Bearer coral_sk_test_...'
shell
curl -s https://coral.buildinpublic.fun/api/v1/transactions \
  -H 'Authorization: Bearer coral_sk_test_...'

Endpoints

GET/api/v1/agents

List agents

Returns the agent wallets owned by the API key account.

Response
{
  "agents": [
    {
      "id": "agent_123",
      "name": "Research Agent",
      "handle": "@research_agent",
      "walletAddress": "0x...",
      "solanaAddress": "7Y...",
      "dailySpendLimit": "100",
      "perTransactionLimit": "25",
      "status": "ACTIVE"
    }
  ]
}
POST/api/v1/agents

Create agent

Creates an encrypted wallet, handle reservation, and spend policy for an agent.

{
  "name": "Research Agent",
  "handle": "research_agent",
  "dailySpendLimit": "100",
  "perTransactionLimit": "25"
}
Response
{
  "agent": {
    "id": "agent_123",
    "handle": "@research_agent",
    "walletAddress": "0x...",
    "solanaAddress": "7Y...",
    "status": "ACTIVE"
  }
}
POST/api/v1/agents/:agentId/send

Send from agent

Sends USDT from an agent wallet to a Coral handle after checking spend limits. Uses mock ledger mode by default, or broadcasts on Ethereum Sepolia, Base Sepolia, or Solana devnet when live testnet mode is enabled.

{
  "to": "alex",
  "amount": "5.00",
  "token": "USDT",
  "chain": "ethereum-sepolia"
}
Response
{
  "status": "success",
  "txHash": "0x...",
  "toHandle": "@alex",
  "toWallet": "0x...",
  "chain": "ethereum-sepolia",
  "explorerUrl": "https://sepolia.etherscan.io/tx/0x..."
}
GET/api/v1/handles/:handle

Resolve handle

Resolves a user or agent handle to Base and Solana receive addresses.

Response
{
  "handle": "@alex",
  "walletAddress": "0x...",
  "solanaAddress": "7Y...",
  "ownerType": "USER"
}
GET/api/v1/transactions

List transactions

Returns the latest user and agent-originated payment records for the API key owner.

Response
{
  "transactions": [
    {
      "id": "txn_123",
      "type": "AGENT_SEND",
      "status": "CLAIM_CREATED",
      "claimId": "claim_123"
    }
  ]
}

Errors

401Invalid or missing API key
403Agent inactive, spend limit exceeded, or onboarding required
404Agent, handle, or claim was not found
409Duplicate handle or already redeemed claim
422Request body failed validation
501Required live testnet transfer configuration is missing or the testnet transfer failed