Back to SDKs

Agent Frameworks

Framework Integrations

Drop-in tools for CrewAI, AutoGen, LangChain, and MCP. Your agents discover, pay for, and call APIs without leaving their framework.

Jump to framework

How Framework Integrations Work

1

Discover -- agents search the Obolo marketplace for APIs matching their task.

2

Pay -- the agent sends a stablecoin payment on-chain (USDC, USDT, USD1, or PYUSD on 8 chains).

3

Call -- the agent retries the request with the payment proof and gets the data.

CrewAI

gateflow-crewai

Python 3.9+

Class-based tools that integrate natively with CrewAI agents. GateFlowSearchTool discovers APIs; GateFlowTool calls them with x402 payment. Assign both to any agent's tools list.

Install

pip install git+https://github.com/TheDataCryptoJo/GateFlow.git#subdirectory=packages/crewai

Full Example

python
from crewai import Agent, Task, Crew
from gateflow_crewai import GateFlowTool, GateFlowSearchTool

# 1. Search for APIs in the marketplace
search = GateFlowSearchTool()

# 2. Create a tool for a specific endpoint
weather = GateFlowTool(
    endpoint_slug="weather-forecast",
    wallet_address="0xYOUR_WALLET",
    payment_hash="0xYOUR_TX_HASH",  # from on-chain USDC transfer
    chain="base",
)

# 3. Give tools to your agent
agent = Agent(
    role="Research Analyst",
    goal="Gather real-time data for reports",
    backstory="You use paid APIs to get accurate, up-to-date information.",
    tools=[search, weather],
)

task = Task(
    description="Get the current weather in London and write a short summary.",
    agent=agent,
    expected_output="A weather summary with temperature and conditions.",
)

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

AutoGen

gateflow-autogen

Python 3.9+

Function-based tools following AutoGen's register_function pattern. gateflow_search finds APIs; gateflow_call invokes them. Register both in your agent's function_map.

Install

pip install git+https://github.com/TheDataCryptoJo/GateFlow.git#subdirectory=packages/autogen

Full Example

python
from autogen import AssistantAgent, UserProxyAgent
from gateflow_autogen import gateflow_search, gateflow_call

# 1. Create agents
assistant = AssistantAgent(
    name="analyst",
    system_message=(
        "You research data using paid APIs on Obolo. "
        "Use search_apis to find endpoints, then call_api to invoke them."
    ),
)

user_proxy = UserProxyAgent(
    name="user",
    human_input_mode="NEVER",
    function_map={
        "search_apis": gateflow_search,
        "call_api": gateflow_call,
    },
)

# 2. Start a conversation — the agent discovers and calls APIs
user_proxy.initiate_chat(
    assistant,
    message="Search for sentiment analysis APIs and analyze this text: 'Obolo is amazing'",
)
Custom configuration
python
# Override defaults before registering (optional)
import gateflow_autogen.tool as gf_tool

gf_tool.GATEFLOW_PROXY_URL = "https://gateflow-proxy.7crypto-jo.workers.dev"
gf_tool.GATEFLOW_DEFAULT_CHAIN = "base"
gf_tool.GATEFLOW_DEFAULT_TOKEN = "USDC"

LangChain

@gateflow/langchain

TypeScript

LangChain-compatible tool class that handles the full x402 payment flow. Works with any LangChain agent executor, chains, and routing agents.

Install

npm install github:TheDataCryptoJo/GateFlow#master --workspace=packages/langchain

Full Example

typescript
import { GateFlowTool } from '@gateflow/langchain';
import { ChatOpenAI } from '@langchain/openai';
import { AgentExecutor, createOpenAIToolsAgent } from 'langchain/agents';
import { ChatPromptTemplate } from '@langchain/core/prompts';

// 1. Create an Obolo tool for a specific endpoint
const weatherTool = new GateFlowTool({
  slug: 'weather-forecast',
  proxyUrl: 'https://gateflow-proxy.7crypto-jo.workers.dev',
  walletKey: process.env.WALLET_KEY,
});

// 2. Build a LangChain agent with the tool
const llm = new ChatOpenAI({ model: 'gpt-4o' });
const prompt = ChatPromptTemplate.fromMessages([
  ['system', 'You are a helpful assistant with access to paid APIs.'],
  ['human', '{input}'],
  ['placeholder', '{agent_scratchpad}'],
]);

const agent = await createOpenAIToolsAgent({ llm, tools: [weatherTool], prompt });
const executor = new AgentExecutor({ agent, tools: [weatherTool] });

const result = await executor.invoke({
  input: 'What is the weather in Tokyo?',
});
console.log(result.output);

MCP

@gateflow/mcp-server

TypeScript (MCP)

Model Context Protocol server for Claude Desktop, Cursor, and any MCP-compatible client. Agents can browse the marketplace and call APIs natively through the MCP tool interface.

Install

npm install @gateflow/mcp-server

Full Example

json
// Add to claude_desktop_config.json or .cursor/mcp.json
{
  "mcpServers": {
    "gateflow": {
      "command": "npx",
      "args": ["@gateflow/mcp-server"],
      "env": {
        "GATEFLOW_WALLET_KEY": "your-wallet-private-key"
      }
    }
  }
}
Discovery-only mode (no wallet)
json
// Discovery-only mode (no wallet needed — browse free, pay later)
{
  "mcpServers": {
    "gateflow": {
      "command": "npx",
      "args": ["@gateflow/mcp-server"]
    }
  }
}
Full documentation →

Supported Chains & Tokens

All framework integrations support payments on any of these networks with any supported stablecoin.

Base
Ethereum
Solana
TRON
Arbitrum
Optimism
Polygon
BSC
USDCUSDTUSD1PYUSD

What's Next