Skip to main content

CrewAI tools for BoltzPay — pay for API data with AI agents

Project description

PyPI Python 3.10+ License: MIT

boltzpay-crewai

CrewAI tools for BoltzPay — two integration paths for paid API access with AI agents.

Recommended: MCP Integration

CrewAI natively supports MCP. Our MCP server works out of the box — no Python package needed.

See the complete guide: MCP Integration Guide

from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters

server_params = StdioServerParameters(
    command="npx",
    args=["-y", "@boltzpay/mcp"],
    env={"BOLTZPAY_DAILY_BUDGET": "5.00"},
)

with MCPServerAdapter(server_params) as tools:
    agent = Agent(role="Researcher", goal="Access paid APIs", tools=tools)
    task = Task(description="Discover paid APIs", expected_output="API list", agent=agent)
    Crew(agents=[agent], tasks=[task]).kickoff()

Alternative: CLI Bridge Tools

For users who prefer native Python tools, this package provides 7 BaseTool subclasses that call @boltzpay/cli via subprocess.

Install

pip install boltzpay-crewai

Prerequisites

  • Python 3.10+
  • Node.js 20+ — required for the CLI bridge (nodejs.org)
  • Coinbase CDP keys (optional) — only needed for fetch

Usage

from crewai import Agent, Task, Crew
from boltzpay_crewai import (
    BoltzPayFetchTool,
    BoltzPayDiagnoseTool,
    BoltzPayDiscoverTool,
)

agent = Agent(
    role="Data Researcher",
    goal="Find and access paid APIs using BoltzPay",
    tools=[BoltzPayFetchTool(), BoltzPayDiagnoseTool(), BoltzPayDiscoverTool()],
)

task = Task(
    description="Discover paid APIs and diagnose endpoint for invy.bot",
    expected_output="API diagnostic report",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()

Tool Reference

Tool Name Description Credentials
BoltzPayFetchTool boltzpay_fetch Fetch data from a paid API. Detects x402/L402, pays with USDC or Lightning. Required
BoltzPayQuoteTool boltzpay_quote Get detailed price quote with chain options. Not needed
BoltzPayDiscoverTool boltzpay_discover Browse directory of compatible paid APIs. Not needed
BoltzPayDiagnoseTool boltzpay_diagnose Full endpoint diagnostic: protocol, pricing, health, latency. Not needed
BoltzPayBudgetTool boltzpay_budget Check daily spending budget and remaining balance. Not needed
BoltzPayHistoryTool boltzpay_history View recent payment transactions. Not needed
BoltzPayWalletTool boltzpay_wallet Check wallet address and USDC balance. Not needed

No Credentials Needed

Six tools work without any Coinbase credentials:

from boltzpay_crewai import BoltzPayDiagnoseTool, BoltzPayDiscoverTool

# Discover APIs and diagnose endpoints — no keys required
agent = Agent(
    role="API Scout",
    goal="Evaluate paid APIs without purchasing",
    tools=[BoltzPayDiagnoseTool(), BoltzPayDiscoverTool()],
)

Error Handling

CLI bridge tools return error strings instead of raising exceptions (CrewAI pattern), so your agent can recover gracefully:

Error (NODE_NOT_FOUND): Node.js/npx not found. Install Node.js 20+ from https://nodejs.org
Error (TIMEOUT): CLI command timed out after 30s
Error (CLI_ERROR): Payment failed: budget exceeded

For programmatic error handling, import the error classes:

from boltzpay_crewai import BoltzPayBridgeError, BoltzPayNodeNotFoundError, BoltzPayTimeoutError

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boltzpay_crewai-0.3.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boltzpay_crewai-0.3.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file boltzpay_crewai-0.3.0.tar.gz.

File metadata

  • Download URL: boltzpay_crewai-0.3.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for boltzpay_crewai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8ba74ea9f8d36b5c5cc9b3c9e31205622fb7c2f50f4efd1ef0d33c88381a59bf
MD5 a8211a0a8c3448ad2e3140768c1367b1
BLAKE2b-256 ec579166773dd104670a0a342ee1ed63f152bfefd132211f1defca776de7bbda

See more details on using hashes here.

File details

Details for the file boltzpay_crewai-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for boltzpay_crewai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f5aa14b42156c5cb264f9a741e6221fa210d198a1771f0ba0fcad85210c1b8d
MD5 df80650e63a3a4a2a8ea22437a0b72e6
BLAKE2b-256 6931435f48390a3dee09947d3151ba719f5fb432381407bf72e62fd4d0cc1b40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page