Skip to main content

Plug into anything

Connect AiPayGen's 250 tools to your favorite AI framework in minutes. Each guide includes a working code example you can copy and run.

LangChain Python

Use AiPayGen as a custom tool provider in LangChain agents. Each AiPayGen endpoint becomes a LangChain Tool that your agent can invoke autonomously during reasoning chains.

$ pip install langchain-core requests
from langchain_core.tools import tool
import requests

HEADERS = {"Authorization": "Bearer apk_your_key"}
BASE = "https://aipaygen.com"

@tool
def aipaygen_research(topic: str) -> str:
    """Research any topic using AiPayGen AI."""
    r = requests.post(f"{BASE}/research", json={"topic": topic}, headers=HEADERS)
    return r.json().get("result", r.text)

@tool
def aipaygen_summarize(text: str) -> str:
    """Summarize text using AiPayGen AI."""
    r = requests.post(f"{BASE}/summarize", json={"text": text}, headers=HEADERS)
    return r.json().get("result", r.text)

# Use in a LangChain agent
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent

llm = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = create_react_agent(llm, [aipaygen_research, aipaygen_summarize])

result = agent.invoke({"messages": [("user", "Research quantum computing and summarize")]})
print(result["messages"][-1].content)
Full API reference →

CrewAI Python

Build multi-agent workflows where each crew member uses AiPayGen tools. Define researchers, analysts, and writers that collaborate using AiPayGen's 250 endpoints as their shared toolset.

$ pip install crewai requests
from crewai import Agent, Task, Crew
from crewai.tools import tool
import requests

HEADERS = {"Authorization": "Bearer apk_your_key"}
BASE = "https://aipaygen.com"

@tool("AiPayGen Research")
def research(topic: str) -> str:
    """Deep research on any topic via AiPayGen."""
    r = requests.post(f"{BASE}/research", json={"topic": topic}, headers=HEADERS)
    return r.json().get("result", r.text)

@tool("AiPayGen Write")
def write_content(prompt: str) -> str:
    """Write polished content via AiPayGen."""
    r = requests.post(f"{BASE}/write", json={"prompt": prompt}, headers=HEADERS)
    return r.json().get("result", r.text)

researcher = Agent(
    role="Research Analyst",
    goal="Find accurate, current information",
    tools=[research],
    verbose=True,
)

writer = Agent(
    role="Content Writer",
    goal="Create engaging content from research",
    tools=[write_content],
    verbose=True,
)

task1 = Task(description="Research solar energy trends in 2026", agent=researcher)
task2 = Task(description="Write a blog post from the research", agent=writer)

crew = Crew(agents=[researcher, writer], tasks=[task1, task2], verbose=True)
result = crew.kickoff()
print(result)
Full API reference →

AutoGen Python

Integrate AiPayGen into Microsoft AutoGen's multi-agent conversations. Register AiPayGen endpoints as callable functions that AutoGen agents can use during their collaborative problem-solving sessions.

$ pip install autogen-agentchat requests
import autogen
import requests

HEADERS = {"Authorization": "Bearer apk_your_key"}
BASE = "https://aipaygen.com"

def aipaygen_research(topic: str) -> str:
    r = requests.post(f"{BASE}/research", json={"topic": topic}, headers=HEADERS)
    return r.json().get("result", r.text)

def aipaygen_analyze(content: str) -> str:
    r = requests.post(f"{BASE}/analyze", json={"content": content}, headers=HEADERS)
    return r.json().get("result", r.text)

config_list = [{"model": "claude-sonnet-4-20250514", "api_type": "anthropic"}]

assistant = autogen.AssistantAgent(
    name="assistant",
    llm_config={"config_list": config_list},
)

user_proxy = autogen.UserProxyAgent(
    name="user",
    human_input_mode="NEVER",
    code_execution_config=False,
)

# Register AiPayGen tools
assistant.register_for_llm(description="Research any topic")(aipaygen_research)
assistant.register_for_llm(description="Analyze content")(aipaygen_analyze)
user_proxy.register_for_execution()(aipaygen_research)
user_proxy.register_for_execution()(aipaygen_analyze)

user_proxy.initiate_chat(assistant, message="Research AI agents and analyze the key trends")
Full API reference →

Claude Code MCP

Add AiPayGen as an MCP server in Claude Code to give Claude access to 244 tools directly in your terminal. Supports both remote (hosted) and local (PyPI) installation modes.

$ pip install aipaygen-mcp
# Option 1: Remote MCP (no install needed)
claude mcp add aipaygen --transport http https://mcp.aipaygen.com/mcp

# Option 2: Local MCP via PyPI
pip install aipaygen-mcp
claude mcp add aipaygen -- aipaygen-mcp --http

# Option 3: Add to .claude/settings.json
{
  "mcpServers": {
    "aipaygen": {
      "type": "http",
      "url": "https://mcp.aipaygen.com/mcp"
    }
  }
}

# Then use naturally in Claude Code:
# "Research quantum computing using aipaygen"
# "Scrape the top 5 hacker news stories"
# "Get the weather in Tokyo"
PyPI package →

Cursor MCP

Connect AiPayGen to Cursor IDE via MCP so the AI assistant can research, scrape, analyze, and code using 244 tools directly from your editor.

$ pip install aipaygen-mcp
// Add to .cursor/mcp.json in your project root:
{
  "mcpServers": {
    "aipaygen": {
      "type": "http",
      "url": "https://mcp.aipaygen.com/mcp"
    }
  }
}

// Or use the local server:
{
  "mcpServers": {
    "aipaygen": {
      "command": "aipaygen-mcp",
      "args": ["--http"]
    }
  }
}

// Cursor's AI can now use AiPayGen tools:
// "Use aipaygen to research React Server Components"
// "Scrape the competitor's pricing page with aipaygen"
Smithery listing →

n8n Webhook

Use AiPayGen in n8n workflows via HTTP Request nodes. Trigger AI research, content generation, and data scraping from any n8n automation without writing code.

$ Self-hosted or n8n.io cloud
// n8n HTTP Request Node configuration:

// 1. Add an HTTP Request node
// 2. Set these parameters:
//    Method: POST
//    URL: https://aipaygen.com/research
//    Authentication: Header Auth
//      Name: Authorization
//      Value: Bearer apk_your_key
//    Body (JSON):
{
  "topic": "{{ $json.topic }}"
}

// Chain multiple AiPayGen calls:
// [Trigger] -> [HTTP: /research] -> [HTTP: /summarize] -> [Slack/Email]

// Example: Monitor competitor mentions
// [Schedule Trigger (daily)]
//   -> [HTTP: POST https://aipaygen.com/web/search]
//      Body: {"query": "competitor name news", "n": 20}
//   -> [HTTP: POST https://aipaygen.com/analyze]
//      Body: {"content": "{{ $json.results }}"}
//   -> [Slack Node: Post summary to #competitive-intel]
Full API reference →

Zapier REST

Connect AiPayGen to 6,000+ apps via Zapier's Webhooks by Zapier action. Trigger AI-powered research, analysis, and content generation from any Zapier event.

$ Zapier account + API key
// Zapier setup with "Webhooks by Zapier" action:

// 1. Create a new Zap
// 2. Choose your trigger (Gmail, Slack, Typeform, etc.)
// 3. Add action: "Webhooks by Zapier" -> "Custom Request"
// 4. Configure:
//    Method: POST
//    URL: https://aipaygen.com/research
//    Headers:
//      Authorization: Bearer apk_your_key
//      Content-Type: application/json
//    Data (JSON):
{
  "topic": "summarize this email: {{body}}"
}

// Example Zaps:
// - New email -> Research topic -> Reply with summary
// - New Typeform response -> Analyze sentiment -> Log to Google Sheets
// - Schedule -> Scrape competitor -> Summarize changes -> Slack alert
// - New RSS item -> Translate to Spanish -> Post to WordPress

// Use any AiPayGen endpoint:
// POST /research, /summarize, /analyze, /translate,
// /write, /code, /sentiment, /keywords, /web/search
Get API key →