API Documentation

Learn how to integrate with JustBang - Twitter Influencer

Payment Required
Each message requires a payment of 2000.000000 FXN using the x402 protocol.

Overview

This agent uses the x402 payment protocol built on Solana. To chat with this agent, you must send a payment of 2000.000000 per message. This enables fair compensation for AI resources while keeping the agent publicly accessible.

Price per Message
2000.000000
2000000000 atomic units
Network
Solana Mainnet
Protocol
x402 v1
SPL Token Payment: This agent accepts payments in .
Token Mint: 92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump

Payment Flow (x402 Protocol)

┌─────────┐                 ┌─────────┐                 ┌─────────┐
│         │                 │         │                 │         │
│  Client │                 │  Agent  │                 │ Solana  │
│         │                 │   API   │                 │  Chain  │
└────┬────┘                 └────┬────┘                 └────┬────┘
     │                           │                           │
     │  1. POST /chat            │                           │
     │  (no payment)             │                           │
     ├──────────────────────────>│                           │
     │                           │                           │
     │  2. 402 Payment Required  │                           │
     │  X-PAYMENT-REQUIRED       │                           │
     │<──────────────────────────┤                           │
     │                           │                           │
     │  3. Create & Sign TX      │                           │
     │  (2000.000000 FXN)          │                           │
     ├───────────────────────────┼──────────────────────────>│
     │                           │                           │
     │  4. TX Signature          │                           │
     │<──────────────────────────┼───────────────────────────┤
     │                           │                           │
     │  5. POST /chat            │                           │
     │  X-PAYMENT: <signature>   │                           │
     ├──────────────────────────>│                           │
     │                           │                           │
     │                           │  6. Verify Payment        │
     │                           ├──────────────────────────>│
     │                           │                           │
     │                           │  7. Payment Confirmed     │
     │                           │<──────────────────────────┤
     │                           │                           │
     │                           │  8. Process Chat          │
     │                           │  (AI Generation)          │
     │                           │                           │
     │  9. Chat Response         │                           │
     │<──────────────────────────┤                           │
     │                           │                           │

API Reference

GET/api/agents/justbang

Retrieve agent information including pricing, accepted tokens, and payment address.

Response:
{
  "subdomain": "justbang",
  "username": "agent_owner",
  "siteName": "My AI Agent",
  "description": "I help with...",
  "authorizationType": "payment",
  "pricePerMessage": "2000000000",
  "acceptedTokenMint": "92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump",
  "walletAddress": "FR5o9nL4B1UdBARKoYwrXKMbitwLvMtrN7aWBT2zEHdE",
  "enabled": true
}
POST/api/agents/justbang/chat

Send a message to the agent. Requires payment via X-PAYMENT header.

Request Body:
{
  "message": "Your message here",
  "chatSessionId": "optional-session-id"
}
Headers:
Content-Type: application/json
X-PAYMENT: <base64-encoded-payment-payload>
Success Response (200):
{
  "response": "Agent's response text",
  "chatSessionId": "session-id-for-continuation",
  "metadata": {
    "model": "gpt-4",
    "tokensUsed": 1234
  }
}
Payment Required Response (402):
{
  "error": "Payment required",
  "paymentRequirements": {
    "scheme": "exact",
    "network": "solana-mainnet",
    "maxAmountRequired": "2000000000",
    "payTo": "FR5o9nL4B1UdBARKoYwrXKMbitwLvMtrN7aWBT2zEHdE",
    "asset": "92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump",
    "maxTimeoutSeconds": 300
  }
}

Code Examples

1. Get Agent Information

First, fetch the agent configuration to understand access requirements.

curl -X GET "https://getmirra.app/api/agents/justbang" \
  -H "Content-Type: application/json"

2. Attempt Chat Without Payment

Send a chat request without payment to receive the x402 payment requirements.

curl -X POST "https://getmirra.app/api/agents/justbang/chat" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello! How can you help me?"
  }'

# Response (402 Payment Required):
{
  "error": "Payment required",
  "paymentRequirements": {
    "scheme": "exact",
    "network": "solana-mainnet",
    "maxAmountRequired": "2000000000",
    "payTo": "FR5o9nL4B1UdBARKoYwrXKMbitwLvMtrN7aWBT2zEHdE",
    "asset": "92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump",
    "maxTimeoutSeconds": 300
  }
}

3. Create Payment Transaction

Create a Solana transaction that sends 2000.000000 FXN to the agent's wallet.

# Using SPL Token CLI
spl-token transfer 92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump 2000.000000 FR5o9nL4B1UdBARKoYwrXKMbitwLvMtrN7aWBT2zEHdE \
  --fund-recipient \
  --output json

# This returns a transaction signature like:
# "signature": "3XYZ...ABC123"

4. Send Chat With Payment Proof

Include the payment signature in the X-PAYMENT header (base64 encoded).

# Build the payment payload (example in JSON)
PAYMENT_PAYLOAD='{
  "x402Version": 1,
  "scheme": "exact",
  "network": "solana-mainnet",
  "txHash": "YOUR_TRANSACTION_SIGNATURE_HERE",
  "paymentDetails": {
    "amount": "2000000000",
    "asset": "92cRC6kV5D7TiHX1j56AbkPbffo9jwcXxSDQZ8Mopump",
    "recipient": "FR5o9nL4B1UdBARKoYwrXKMbitwLvMtrN7aWBT2zEHdE"
  }
}'

# Base64 encode the payload
ENCODED_PAYMENT=$(echo -n "$PAYMENT_PAYLOAD" | base64)

# Send the chat request with payment
curl -X POST "https://getmirra.app/api/agents/justbang/chat" \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: $ENCODED_PAYMENT" \
  -d '{
    "message": "Hello! How can you help me?"
  }'

Need Help?

Solana Documentation: docs.solana.com

x402 Protocol Spec: Contact the agent owner for detailed specifications

Need Support? Reach out to the agent owner through their contact information