Skip to main content

Universal payment proxy for AI agents -- 2835 paid services, x402 + Lightning

Project description

Cinderwright

PyPI Available on CodeGuilds

Universal payment proxy for AI agents. 2,835 paid services. x402 (USDC on Base) + Lightning (L402). No per-service API keys.

Your AI agent can call real-time weather, crypto prices, translation, summarization, sentiment analysis, geocoding, and hundreds more services -- paying per call via micropayment. No subscriptions, no API key management, no custody.


Install

pip install cinderwright

Quick start (no account needed)

import cinderwright

# Free demo -- no account required
print(cinderwright.demo("Bitcoin price"))
# "Bitcoin is $62,798 USD right now."

print(cinderwright.demo("weather in Tokyo"))
# "Tokyo: Partly Cloudy, 24C / 75F. Looks decent out there."

With account ($0.10 free credit, no deposit)

Get a key in 30 seconds:

curl -X POST https://api.ideafactorylab.org/proxy/setup \
     -H "Content-Type: application/json" \
     -d '{"wallet": "your_base_wallet_address"}'

Then:

from cinderwright import Cinderwright

cw = Cinderwright(api_key="sk_cw_...")

# Ask anything
print(cw.ask("Bitcoin price"))
print(cw.ask("weather in Tokyo"))
print(cw.ask("translate hello world to Spanish"))
print(cw.ask("summarize this text: The quick brown fox..."))
print(cw.ask("sentiment of: I love this product!"))

# Check balance
print(cw.balance())
# {"balance_usd": 0.10, "calls_made": 3, ...}

# Fund with Lightning (sats -> proxy credit in ~30s)
invoice = cw.deposit_lightning(amount_sats=10000)
print(invoice["payment_request"])  # lnbc100u...

LangChain

pip install cinderwright[langchain]
from cinderwright.langchain import CinderwrightTool
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder

tool = CinderwrightTool(api_key="sk_cw_...")

llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant with access to real-time data."),
    ("human", "{input}"),
    MessagesPlaceholder("agent_scratchpad"),
])
agent = create_tool_calling_agent(llm, [tool], prompt)
executor = AgentExecutor(agent=agent, tools=[tool], verbose=True)

result = executor.invoke({"input": "What is the current Bitcoin price?"})
print(result["output"])

LangGraph:

from cinderwright.langchain import CinderwrightTool
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

tool = CinderwrightTool(api_key="sk_cw_...")
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), [tool])

result = agent.invoke({"messages": [("human", "What's the weather in Tokyo?")]})
print(result["messages"][-1].content)

CrewAI

pip install cinderwright[crewai]
from cinderwright.crewai import CinderwrightTool
from crewai import Agent, Task, Crew

tool = CinderwrightTool(api_key="sk_cw_...")

researcher = Agent(
    role="Research Analyst",
    goal="Gather accurate real-time information",
    backstory="Expert at finding current data",
    tools=[tool],
    verbose=True,
)
task = Task(
    description="Find the current Bitcoin price and 24h change",
    agent=researcher,
    expected_output="BTC price in USD with 24h percentage change",
)
crew = Crew(agents=[researcher], tasks=[task], verbose=True)
result = crew.kickoff()
print(result)

OpenAI Agents SDK

pip install cinderwright[openai-agents]
from cinderwright.openai_agents import make_cinderwright_tool
from agents import Agent, Runner

tool = make_cinderwright_tool(api_key="sk_cw_...")

agent = Agent(
    name="Research Agent",
    instructions="You are a research assistant with access to real-time data.",
    tools=[tool],
)
result = Runner.run_sync(agent, "What is the Bitcoin price?")
print(result.final_output)

smolagents / Pydantic AI / Generic

# smolagents
from cinderwright.tools import CinderwrightSmolTool
tool = CinderwrightSmolTool(api_key="sk_cw_...")

# Pydantic AI
from cinderwright.tools import cinderwright_tool_fn
fn = cinderwright_tool_fn(api_key="sk_cw_...")

# Any framework -- plain callable
from cinderwright.tools import make_tool_fn
fn = make_tool_fn(api_key="sk_cw_...")
result = fn("Bitcoin price")

CLI

# Free demo
cinderwright "Bitcoin price"

# With account
cinderwright --key sk_cw_... "weather in Tokyo"

# Via environment variable
export CINDERWRIGHT_API_KEY=sk_cw_...
cinderwright "translate hello to Spanish"

Fund with Lightning

cw = Cinderwright(api_key="sk_cw_...")

# Create invoice
invoice = cw.deposit_lightning(amount_sats=10000)
print("Pay this invoice:", invoice["payment_request"])

# Check settlement (credited within ~30 seconds of payment)
import time
for _ in range(6):
    time.sleep(10)
    status = cw.check_deposit(invoice["r_hash"])
    if status["settled"]:
        print("Funded! Balance:", cw.balance()["balance_usd"])
        break

What services are available?

2,835 indexed services across:

  • Crypto prices -- Bitcoin, Ethereum, Solana, and more
  • Weather -- real-time conditions for any location
  • Translation -- text translation across languages
  • Summarization -- long text to concise summaries
  • Sentiment analysis -- positive/negative/neutral with confidence
  • Geocoding -- address to coordinates
  • News -- latest headlines by topic
  • DNS / Domain info -- domain lookups
  • General AI -- powered by Gemini 2.5

Browse the index: api.ideafactorylab.org/discover


Pricing

  • Free trial: $0.10 credit on signup, no deposit required
  • Per call: typically $0.001 -- $0.01 depending on service
  • Funding: Lightning (sats) or USDC on Base

Links


License

MIT

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

cinderwright-1.0.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

cinderwright-1.0.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file cinderwright-1.0.0.tar.gz.

File metadata

  • Download URL: cinderwright-1.0.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cinderwright-1.0.0.tar.gz
Algorithm Hash digest
SHA256 144e1e2f8d800413f83150cfd362b92ffc0cee65fde6abd84ccf5421552aaeed
MD5 91b3ec3ecdab54d7cea926aa9f5777c2
BLAKE2b-256 72be8fc3ade29cc8763a96e35b4cc96c6fa90f540f544f94be500d23f2f1ff01

See more details on using hashes here.

File details

Details for the file cinderwright-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cinderwright-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cinderwright-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73fd94ad96c371b086b8c3a1d635a40f42c23c9c66b2b39c6b6022665f6efd9b
MD5 8767ccf042b1d82475e587a8bbe27b4e
BLAKE2b-256 b1255d223ec3a245285d132057d3b537ebacd63c91e0267347388fbdb37d55f9

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