Agent API Overview
The Agent API allows you to interact with Bankr's AI agent to execute prompts and transactions on behalf of your wallet.
Capabilities
Using the Agent API, you can:
- Retrieve your account info (wallets, socials, Bankr Club status)
- Submit prompts to the Bankr AI agent for your wallet
- Check the status of submitted jobs
- Cancel pending or processing jobs
- Sign messages and transactions using your custodial wallet (
POST /agent/sign) - Submit signed transactions on-chain (
POST /agent/submit)
Getting Started
- Sign up at bankr.bot/api
- Generate an API key and enable Agent API access
- Fund your account with the assets you want to trade
- Start making requests using your API key
Security
Do not share your Bankr API key with anyone or any untrusted app. If you share your API key with agent access enabled, you risk losing all assets in that Bankr account.
If you leak your API key, visit bankr.bot/api and revoke it immediately.
Example Applications
Check out example apps built on the Agent API:
github.com/BankrBot/bankr-api-examples
Base URL
https://api.bankr.bot
Authentication
All endpoints require an API key with Agent API access enabled:
X-API-Key: your_api_key_here
Basic Flow
1. Submit a Prompt
POST /agent/prompt
{
"prompt": "what is the price of ETH?"
}
Response (202 Accepted):
{
"success": true,
"jobId": "abc123",
"threadId": "thr_XYZ789",
"status": "pending",
"message": "Job created successfully"
}
2. Poll for Results
GET /agent/job/{jobId}
Response (200 OK):
{
"success": true,
"jobId": "abc123",
"status": "completed",
"prompt": "what is the price of ETH?",
"response": "ETH is currently trading at $3,245.67",
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T10:30:03Z",
"processingTime": 3000
}
Job Statuses
| Status | Description |
|---|---|
pending | Job is queued for processing |
processing | Job is currently being processed |
completed | Job finished successfully |
failed | Job encountered an error |
cancelled | Job was cancelled by user |
Recommended Usage
When starting out with the Agent API:
- Create a new account — Sign up for a new Bankr account via email
- Generate a fresh API key — Enable agent access on the key
- Start with limited funds — Only deposit what you're willing to test with
- Keep your key secure — Never share it publicly or with untrusted apps
- Explore carefully — Understand the API before increasing assets
Next Steps
- Authentication — API key setup details
- User Info — Retrieve your account profile
- Prompt Endpoint — Natural language commands
- Job Management — Polling, cancellation, status
- Sign Endpoint — Sign messages and transactions
- Submit Endpoint — Submit raw transactions
- Transaction Types — Supported transaction formats
- Bankr CLI — Command-line interface (
@bankr/cli)