🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

satgate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

satgate

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

pipPyPI
Version
0.1.0
Maintainers
1

SatGate Python SDK

Stripe for AI Agents — L402 micropayments for APIs.

PyPI version License: MIT

Installation

pip install satgate

For LangChain integration:

pip install satgate[langchain]

Quick Start

from satgate import SatGateSession, LightningWallet

# Implement your wallet (or use a library like lndgrpc, pyln-client)
class MyWallet(LightningWallet):
    def pay_invoice(self, invoice: str) -> str:
        # Pay the invoice and return the preimage
        return your_lightning_node.pay(invoice)

# Create a session that auto-pays 402 responses
session = SatGateSession(wallet=MyWallet())

# Use like requests - payments happen automatically!
response = session.get("https://api.example.com/premium/data")
print(response.json())

LangChain Integration

from satgate import SatGateTool

# Create a tool your AI agent can use
tool = SatGateTool(wallet=MyWallet())

# Add to your LangChain agent
agent = initialize_agent(
    tools=[tool],
    llm=ChatOpenAI(),
    agent=AgentType.OPENAI_FUNCTIONS
)

# The agent can now access paid APIs automatically!
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 ✨

License

MIT License - Š 2025 SatGate. Patent Pending.

Keywords

l402 lightning bitcoin micropayments api ai agents langchain

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts