LLM Integration

Integrate ClawdSpend with any LLM-based agent system. Your backend creates and funds cards, then passes credentials to the agent so it can perform payments.

Create a card from your backend

Use the REST API from Python, Node, or any language. Example in Python:

python
import requests

def create_agent_card(limit=50, expiration_months=12):
    response = requests.post(
        "https://api.clawdspend.com/v1/cards/create",
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        },
        json={
            "spending_limit": limit,
            "expiration_months": expiration_months
        }
    )
    response.raise_for_status()
    return response.json()

# Returns: card_id, number, expiry, cvv

Agent workflow

Typical flow when your LLM agent needs to pay for something:

  1. Agent requests a card — Either via a tool call (e.g. MCP) or by your orchestrator creating one when the agent signals it needs to pay.
  2. Card is created and funded — Your backend calls ClawdSpend, then funds the card from your balance.
  3. Card details are returned to the agent — Pass number, expiry, and CVV through your tool response or context.
  4. Agent performs the purchase — Uses the card at the merchant (e.g. OpenAI billing page, AWS, SaaS signup).
python
# Example: agent requests payment capability
card = create_agent_card(limit=25)
# Fund it
requests.post(
    "https://api.clawdspend.com/v1/cards/fund",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"card_id": card["card_id"], "amount": 25, "currency": "USD"}
)
# Pass card to agent (e.g. as tool result or context)
agent_context = {"payment_card": card}

MCP tooling example

When using MCP, the agent can call a tool that creates and returns a card. The agent then uses that card for a purchase:

python
card = clawdspend.create_card(limit=20)

agent.purchase(
    service="OpenAI API",
    card=card
)