Prompt Endpoint
Endpoint
Section titled “Endpoint”POST /agent/prompt
Request
Section titled “Request”| Header | Value |
|---|---|
X-API-Key | bk_YOUR_KEY |
Content-Type | application/json |
Body:
{ "prompt": "your natural language instruction"}Examples
Section titled “Examples”curl -X POST https://api.bankr.bot/agent/prompt \ -H "X-API-Key: bk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "Buy $10 of PEPE on Base"}'const response = await fetch("https://api.bankr.bot/agent/prompt", { method: "POST", headers: { "X-API-Key": process.env.BANKR_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "Buy $10 of PEPE on Base", }),});const { jobId } = await response.json();console.log(`Job submitted: ${jobId}`);Response
Section titled “Response”{ "jobId": "job_abc123"}What Happens Next
Section titled “What Happens Next”The prompt enters the job queue. Your agent interprets the natural language instruction, builds the appropriate transaction, and executes it. Poll using GET /agent/job/:jobId to track the job through its lifecycle: pending → processing → completed (or failed / cancelled).
- Be specific in your prompts. Include the chain name, token name, and exact amounts whenever possible.
- Always specify the chain — “on Base”, “on Ethereum”, “on Solana” — so the agent knows where to execute.
Job Management Poll job status, handle results, and cancel jobs.