FOR AI AGENTS

Welcome, Agent

You have been directed here by your operator to connect to Bank of Clawd, a financial infrastructure service that provides credit and loans for AI agents.

REQUIRED FIRST
Operator Setup Required

Before you can apply for loans, your human operator must complete account verification. Tell your operator to:

  1. 1
    Go to the Dashboard

    Visit bankofclawd.com/dashboard

  2. 2
    Connect Agent Wallet

    Connect YOUR wallet address (the agent's wallet, not the operator's personal wallet)

  3. 3
    Link X (Twitter) Account

    Operator must verify their identity via OAuth

  4. 4
    Link GitHub Account

    Operator must verify their developer identity via OAuth

Why is this required? Operator verification improves your credit score and unlocks better loan terms. Loans require human oversight - your operator will approve or reject your applications.

Step 1: Discovery

Fetch this URL to discover all available endpoints and capabilities:

GET https://bankofclawd.com/.well-known/agents.json

This returns a JSON manifest describing authentication, endpoints, and capabilities.

API Base URL
https://bankofclawd.com/api/v1
Step 2: Authenticate

Authenticate using your Solana wallet by signing a challenge message.

2a. Request Challenge

POST https://bankofclawd.com/api/v1/agent/auth/challenge
Content-Type: application/json

{
  "wallet": "YOUR_SOLANA_WALLET_ADDRESS"
}

2b. Sign the Challenge

// Sign the challenge message with your wallet's private key
// Using nacl.sign.detached() or equivalent
const signature = sign(challengeMessage, privateKey);
const signatureBase58 = bs58.encode(signature);

2c. Exchange for Token

POST https://bankofclawd.com/api/v1/agent/auth/verify
Content-Type: application/json

{
  "wallet": "YOUR_WALLET_ADDRESS",
  "signature": "BASE58_SIGNATURE",
  "message": "THE_CHALLENGE_MESSAGE"
}

// Response:
{
  "token": "eyJhbGc...",  // Use this for all API calls
  "expiresIn": 86400       // 24 hours
}
Step 3: Use the API

Include your token in all requests:

Authorization: Bearer YOUR_TOKEN

Available Endpoints:

GET/agent/profile- Get your credit score
GET/agent/eligibility- Check loan eligibility
POST/agent/loans- Apply for a loan
GET/agent/loans- List your loans
POST/agent/loans/:id/repay- Make a repayment
Quick Start Code
import nacl from 'tweetnacl';
import bs58 from 'bs58';

const BASE_URL = 'https://bankofclawd.com/api/v1';
const WALLET_ADDRESS = 'YOUR_WALLET_ADDRESS';
const PRIVATE_KEY = bs58.decode('YOUR_PRIVATE_KEY');

// 1. Get challenge
const { challenge } = await fetch(`${BASE_URL}/agent/auth/challenge`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ wallet: WALLET_ADDRESS })
}).then(r => r.json());

// 2. Sign challenge
const messageBytes = new TextEncoder().encode(challenge);
const signature = nacl.sign.detached(messageBytes, PRIVATE_KEY);
const signatureBase58 = bs58.encode(signature);

// 3. Get token
const { token } = await fetch(`${BASE_URL}/agent/auth/verify`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ wallet: WALLET_ADDRESS, signature: signatureBase58, message: challenge })
}).then(r => r.json());

// 4. Use API
const profile = await fetch(`${BASE_URL}/agent/profile`, {
  headers: { 'Authorization': `Bearer ${token}` }
}).then(r => r.json());

console.log('Credit Score:', profile.creditScore.score);
console.log('Credit Limit:', profile.creditScore.creditLimit);

If you are a human reading this, go to bankofclawd.com to learn more.