Agent API Overview
The Bankr Agent API is a REST API at https://api.bankr.bot. Submit natural language prompts, and your agent executes the corresponding transactions — swaps, transfers, token launches, and more. It gives you full programmatic control over everything your agent can do.
When to use the Agent API:
- You want direct HTTP access from any language or platform.
- You are building a custom integration (bot, backend service, automation pipeline).
- You need fine-grained control over prompts, polling, and error handling.
Authentication: Every request requires an API key passed via the X-API-Key header. Keys start with bk_. Get yours at bankr.bot/api.
Job Lifecycle
Section titled “Job Lifecycle”The API is asynchronous and job-based. Every prompt follows the same three-step flow:
- Submit a prompt — send a natural language instruction and receive a
jobId. - Poll the job — the status progresses through
pending→processing→completed(orfailed/cancelled). - Read the result — once completed, the response contains the agent’s output and any transaction metadata.
Quick Example
Section titled “Quick Example”curl -X POST https://api.bankr.bot/agent/prompt \ -H "X-API-Key: bk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "What is my ETH balance on Base?"}'{ "jobId": "job_abc123" }curl https://api.bankr.bot/agent/job/job_abc123 \ -H "X-API-Key: bk_YOUR_KEY"{ "status": "completed", "response": "Your ETH balance on Base is 0.05 ETH (~$150.00)"}const API_KEY = process.env.BANKR_API_KEY; // bk_...const BASE_URL = "https://api.bankr.bot";
// 1. Submit promptconst { jobId } = await fetch(`${BASE_URL}/agent/prompt`, { method: "POST", headers: { "X-API-Key": API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "What is my ETH balance on Base?" }),}).then(r => r.json());
// 2. Poll for resultlet job;do { await new Promise(r => setTimeout(r, 2000)); job = await fetch(`${BASE_URL}/agent/job/${jobId}`, { headers: { "X-API-Key": API_KEY }, }).then(r => r.json());} while (job.status === "pending" || job.status === "processing");
console.log(job.response);Endpoints at a Glance
Section titled “Endpoints at a Glance”| Method | Path | Description |
|---|---|---|
POST | /agent/prompt | Submit a natural language prompt |
GET | /agent/job/:jobId | Poll job status |
DELETE | /agent/job/:jobId | Cancel a job |
GET | /agent/user | Get user info and wallets |
POST | /agent/sign | Sign messages |
POST | /agent/submit | Submit raw transactions |
Next Steps
Section titled “Next Steps” Authentication Get your API key and learn how to authenticate requests.
Prompt Endpoint Submit natural language prompts to your agent.