Skip to main content

Prompt Endpoint

Submit natural language commands to the Bankr AI agent for processing.

Endpoint​

POST /agent/prompt

Request​

Headers​

HeaderValueRequired
Content-Typeapplication/jsonYes
X-API-KeyYour API keyYes

Body​

{
"prompt": "swap $10 of ETH to USDC on base"
}
FieldTypeDescriptionRequired
promptstringNatural language command (max 10,000 characters)Yes
threadIdstringContinue an existing conversation threadNo
maxModeobjectUse a premium model for this request (see Max Mode below)No

When threadId is provided, the agent loads prior messages from that thread so it has conversation context. If omitted, a new thread is created automatically.

Response​

Success (202 Accepted)​

{
"success": true,
"jobId": "job_ABC123",
"threadId": "thr_XYZ789",
"status": "pending",
"message": "Prompt submitted successfully. Use the jobId to check status."
}
FieldTypeDescription
successbooleanWhether the request was successful
jobIdstringUnique identifier for tracking this job
threadIdstringConversation thread ID (reuse to continue the conversation)
statusstringCurrent status ("pending")
messagestringHuman-readable message

Error Responses​

StatuserrorWhen
400Invalid requestprompt missing or not a string, threadId not a string, or maxMode.model is a model Max Mode doesn't offer
400Prompt too longprompt is longer than 10,000 characters
401API key required / Invalid API keyNo key sent, or the key is invalid or inactive
403Agent API access not enabledThe key's Agent API flag is off
403IP address not allowedThe request IP isn't in the key's IP allowlist
403subscription_requiredThe wallet has neither Bankr Club nor Max Mode with a positive LLM credit balance; the body carries a remediation list
403Account bannedThe account is banned from the API
404Thread not foundthreadId doesn't exist or belongs to another wallet
429Daily limit exceededThe rolling 24-hour message quota is used up

Each body carries error and a human-readable message; the exact messages are in the OpenAPI spec. The 429 also carries the quota:

{
"error": "Daily limit exceeded",
"message": "You have reached your daily API limit of 100 messages. Upgrade to Bankr Club for 1000 messages/day. Resets at 2025-01-15T12:00:00.000Z",
"resetAt": 1736942400000,
"limit": 100,
"used": 100
}

The daily limit is 1,000 messages with Bankr Club and 100 without (a custom limit Bankr sets on a key overrides both), counted over a rolling 24 hours rather than reset at midnight. See API Keys for rate limits, IP allowlisting, and other key permissions.

Examples​

Simple Prompt​

curl -X POST https://api.bankr.bot/agent/prompt \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"prompt": "swap $50 of ETH to USDC on base"}'

Continue a Conversation​

Use the threadId from a previous response to continue the conversation with context:

curl -X POST https://api.bankr.bot/agent/prompt \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"prompt": "and what about SOL?", "threadId": "thr_XYZ789"}'

Max Mode​

Max Mode lets you choose a premium LLM model for individual requests. Usage is billed against your LLM credit balance.

Usage​

Pass the maxMode object in the request body:

{
"prompt": "analyze my portfolio and suggest optimizations",
"maxMode": {
"enabled": true,
"model": "claude-opus-5"
}
}
FieldTypeDescription
maxMode.enabledbooleanSet to true to activate Max Mode
maxMode.modelstringA model ID that Max Mode offers

Max Mode offers the gateway's frontier, flagship and balanced models — see Max Mode or run bankr llm models for the current list and prices. A light model answers 400, and a model ID the gateway doesn't know is ignored, so the prompt runs on the standard model.

CLI​

Use the --model (or -m) flag with the agent command:

bankr agent "analyze my portfolio" --model claude-opus-5
bankr agent -m claude-sonnet-5.5 "what are my best yield options?"
note

Max Mode requires LLM credits. Without Bankr Club, a Max Mode prompt needs a positive credit balance or it answers 403 subscription_required; if your balance can't cover a request, the agent asks you to top up instead of answering. Top up credits with bankr llm credits add <amount>.

Next Steps​

After submitting a prompt, poll for results using the Job Management endpoints.