API Overview
Use the DeFiMara agent API from your own bots and services: base URL, who can access it, and a complete authenticate–send–stream quickstart.
The DeFiMara API gives your own bots and services the same agent Mara uses in the app. Authenticate with a wallet signature, send natural-language instructions and stream the reply — including quotes and transactions for your wallet to sign.
Base URL:
https://api.defimara.com. Requests and acknowledgements are JSON; replies stream as Server-Sent Events.The app has a free plan. Basic is $10 a month. Pro is $50 a month and includes API access. Enterprise is arranged separately. The app shows the price before you pay.
• Who Can Use It
A Pro or Enterprise plan on the wallet you authenticate with
API access switched on in the app: Account → API Access
The IP address of your server added to the IP whitelist in the same panel
• How It Works
1
Authenticate
GET /api/agent/nonce, sign the returned message with your wallet key, then POST /api/agent/auth to get a JWT and session_id.
2
Send a message
POST /message with the JWT. The response only acknowledges that the message was queued.
3
Stream the reply
GET /sessions/{session_id}/stream returns Server-Sent Events until a done event.
4
Sign transactions yourself
Execution tools return transaction data in tool_response events. Your code signs and broadcasts them — DeFiMara never holds your key.
• Quickstart (curl)
curl
# 1–2. Get a JWT and session_id (see Agent Authentication), then:
TOKEN="<access_token>"
SESSION="<session_id>"
# 3. Queue a message
curl -X POST https://api.defimara.com/message \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "what is the ETH price?"}'
# 4. Stream the reply
curl -N https://api.defimara.com/sessions/$SESSION/stream \
-H "Authorization: Bearer $TOKEN"Use a dedicated agent wallet with limited funds, keep its key in a secret manager, and never paste it into chat.
Share this page