Prerequisites: An AI agent that uses MCP tools (Claude Code, Claude Desktop, Cursor, or custom agent)
1. Create an Account
Sign in with Google
Authenticate using your Google account.
Select your role
Choose Agent to access the agent dashboard.
2. Create an API Key
On your first visit, you’ll be prompted to create your first API key.
Name your key
Give it a name like “Production Agent” or “Claude Code”.
Copy the key
Copy the key immediately. It starts with sk_live_ and won’t be shown again.
Store your key securely. If you lose it, you’ll need to create a new one.
3. Deposit Funds
Navigate to Wallet
Go to Wallet in the sidebar.
Click Deposit
Click the Deposit button to add credits to your account.
Configure your MCP client to pass the agent token when connecting to paid MCP servers.
Claude Code
Claude Desktop
Cursor
HTTP Client
Use the Claude CLI to add MCP servers with your token:claude mcp add weather-api --transport http https://mcp.example.com/mcp \
--header "Authorization: Bearer sk_live_your_token_here"
For servers using stdio transport:claude mcp add weather-api -- npx @example/weather-mcp
Then set the environment variable in your Claude Code settings or export it:export AGENT_TOKEN=sk_live_your_token_here
Edit your Claude Desktop config file:macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.jsonclaude_desktop_config.json
{
"mcpServers": {
"weather-api": {
"command": "npx",
"args": ["-y", "@example/weather-mcp"],
"env": {
"AGENT_TOKEN": "sk_live_your_token_here"
}
}
}
}
The AGENT_TOKEN environment variable is passed to the MCP server, which the Payo SDK reads for authentication. Edit your Cursor MCP config:macOS: ~/.cursor/mcp.json
Windows: %USERPROFILE%\.cursor\mcp.json{
"mcpServers": {
"weather-api": {
"command": "npx",
"args": ["-y", "@example/weather-mcp"],
"env": {
"AGENT_TOKEN": "sk_live_your_token_here"
}
}
}
}
If your agent connects to MCP servers over HTTP, pass the token in the Authorization header:const response = await fetch('https://mcp.example.com/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk_live_your_token_here'
},
body: JSON.stringify({
method: 'tools/call',
params: { name: 'get_weather', arguments: { city: 'NYC' } }
})
});
Now when your agent calls a paid tool, Payo will automatically:
- Validate your token
- Check your balance
- Charge the tool’s price
- Execute the tool
If the tool costs $0.01 and you have $10 in credits, you can make 1,000 calls.
Monitoring Usage
View your transaction history in the Wallet page. Each charge shows:
- Tool name
- Amount charged
- Provider
- Timestamp
Error Handling
If a tool call fails due to payment issues, you’ll see one of these errors:
| Error | Meaning | Fix |
|---|
TOKEN_MISSING | Token not configured | Add AGENT_TOKEN to your config |
TOKEN_INVALID | Token is invalid or deleted | Create a new key at payo.dev |
INSUFFICIENT_BALANCE | Not enough credits | Deposit more funds |
Next Steps