SatGate Python SDK
Stripe for AI Agents — L402 micropayments for APIs.

Installation
pip install satgate
For LangChain integration:
pip install satgate[langchain]
Quick Start
from satgate import SatGateSession, LightningWallet
class MyWallet(LightningWallet):
def pay_invoice(self, invoice: str) -> str:
return your_lightning_node.pay(invoice)
session = SatGateSession(wallet=MyWallet())
response = session.get("https://api.example.com/premium/data")
print(response.json())
LangChain Integration
from satgate import SatGateTool
tool = SatGateTool(wallet=MyWallet())
agent = initialize_agent(
tools=[tool],
llm=ChatOpenAI(),
agent=AgentType.OPENAI_FUNCTIONS
)
agent.run("Fetch premium market data from https://api.example.com/insights")
How It Works
- Your code makes a request to a paid API
- The API returns
402 Payment Required with a Lightning invoice
- SatGate automatically pays the invoice via your wallet
- The request is retried with the L402 token
- You get your data ✨
Links
License
MIT License - © 2025 SatGate. Patent Pending.