Authentication
AgentTech uses API keys and Bearer tokens to secure requests.
Getting Your API Key
To obtain your API key and secret key, follow these steps:
- Visit the Dashboard: Go to https://agent.tech/dashboard
- Sign In: Log in with your email address
- Create an Agent: Click on "Create Agent" below the login area
- Generate API Key: After creating an agent, you can generate your API key and secret key
Important Notes:
- Each account can create up to 10 agents maximum
- Each agent will have its own unique API key and secret key
- Keep your secret key secure and never expose it in client-side code
Authentication Modes
Authenticated Mode (v2 API)
Requires Bearer token authentication. Enables Agent-led execution where the backend signs transactions automatically.
Use Case: Server-side operations, automated payouts, backend services.
Go SDK
client, err := pay.NewClient(baseURL,
pay.WithBearerAuth(apiKey, secretKey),
)
JavaScript/TypeScript SDK
const client = new PayClient({
baseUrl: 'https://api-pay.agent.tech',
auth: { apiKey: 'your-api-key', secretKey: 'your-secret-key' },
});
Bearer Token Format: Base64-encode your apiKey:secretKey string.
Public Mode (api API)
No authentication required. Safe for frontend use.
Use Case: Client-side intent creation, user-initiated payments.
Go SDK
client, err := pay.NewClient(baseURL)
// No auth required - automatically uses /api endpoints
JavaScript/TypeScript SDK
const client = new PublicPayClient({
baseUrl: 'https://api-pay.agent.tech',
});
Endpoint Routing
The SDK automatically selects the API prefix based on authentication:
- With auth (
WithBearerAuth) →/v2prefix — create intent → execute (backend signs) - Without auth →
/apiprefix — create intent → payer signs → submit settle_proof
Verifying Credentials (GET /v2/me)
Once you have an API key, call GET /v2/me (auth required) to confirm it works and to discover the agent's funded wallet addresses without hitting the dashboard:
const me = await client.getMe(); // JS/TS SDK
// me.agentId, me.agentNumber, me.name, me.status,
// me.walletAddress (EVM), me.solanaWalletAddress
me, err := client.GetMe(ctx) // Go SDK
// me.AgentID, me.AgentNumber, me.Name, me.Status,
// me.WalletAddress (EVM), me.SolanaWalletAddress
The handler reads from middleware context (no DB hit), so it is cheap to call as a startup health-check. Treat any 401 as a hard configuration error — never retry.
Checking Wallet Balances (GET /v2/agents/balances)
GET /v2/agents/balances (auth required — same API-key Bearer header as the other /v2 endpoints) returns the stablecoin and native-coin balances of the wallets tied to the agent's owner account. Use it to pre-flight funds before creating or executing intents.
GET /v2/agents/balances
Authorization: Bearer <base64(apiKey:secretKey)>
Response:
{
"wallets": [
{
"address": "0xYourEVMWallet",
"chain_type": "ethereum",
"balances": [
{
"chain": "base",
"asset": "usdc",
"raw_value": "25000000",
"raw_value_decimals": 6,
"display_values": { "usdc": "25.00" },
"symbol": "USDC",
"logo_uri": "https://...",
"price_usd": "1.00000000",
"value_usd": "25.00000000"
}
]
},
{
"address": "TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC",
"chain_type": "tron",
"balances": [
{
"chain": "tron",
"asset": "usdt",
"raw_value": "10000000",
"raw_value_decimals": 6,
"display_values": { "usdt": "10.00" }
}
]
}
]
}
wallets[]— one entry per wallet on the owner account, across EVM, Solana, and TRON.chain_typeis the wallet's family;balances[]lists per-(chain, asset) rows for that wallet.raw_value/raw_value_decimals— the balance in smallest units plus its decimals.display_valuesmaps the asset key to a human-readable amount.symbol,logo_uri,price_usd,value_usd— enrichment fields; they may be omitted, so treat them as optional.- Baseline stablecoin rows (USDC / USDT / USDT0 where wired) are always present with a zero
raw_valuewhen the wallet holds none, so you can render stable slots. Native-coin rows (e.g.trxon TRON) appear alongside token rows.
Errors: 401 unauthorized (bad credentials), 403 agent owner not set (the agent record has no owner account), 502 failed to retrieve wallet balances (upstream balance-provider failure — retry later).
Security Best Practices
danger "Never expose your API key or secret key"
Store credentials in environment variables, not in source code or config files.
export AGENTTECH_API_KEY="your-api-key"
export AGENTTECH_SECRET_KEY="your-secret-key"
apiKey := os.Getenv("AGENTTECH_API_KEY")
secretKey := os.Getenv("AGENTTECH_SECRET_KEY")
Do not paste your API key or secret key into any AI assistant, chat, or support channel. If your key is compromised, an attacker can initiate payments from your agent wallet, resulting in permanent fund loss.
- Never expose secrets in frontend code — use
PublicPayClientfor browser environments - Store API keys in environment variables — never hardcode credentials in source code or commit them to version control
- Rotate keys regularly — update credentials periodically for better security
- Use HTTPS only — ensure all API calls are made over encrypted connections