Metadata-Version: 2.4
Name: satgate
Version: 0.1.0
Summary: Python SDK for SatGate - Stripe for AI Agents. L402 micropayments for APIs.
Home-page: https://github.com/SatGate-io/satgate
Author: SatGate Team
Author-email: contact@satgate.io
Project-URL: Homepage, https://satgate.io
Project-URL: Documentation, https://satgate.io/playground
Project-URL: Repository, https://github.com/SatGate-io/satgate
Keywords: l402 lightning bitcoin micropayments api ai agents langchain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Requires-Dist: pydantic>=2.0.0; extra == "langchain"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: responses; extra == "dev"
Requires-Dist: flask; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# SatGate Python SDK

**Stripe for AI Agents** — L402 micropayments for APIs.

[![PyPI version](https://badge.fury.io/py/satgate.svg)](https://pypi.org/project/satgate/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install satgate
```

For LangChain integration:

```bash
pip install satgate[langchain]
```

## Quick Start

```python
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

```python
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

1. Your code makes a request to a paid API
2. The API returns `402 Payment Required` with a Lightning invoice
3. SatGate automatically pays the invoice via your wallet
4. The request is retried with the L402 token
5. You get your data ✨

## Links

- 🌐 Website: [satgate.io](https://satgate.io)
- 📖 Playground: [satgate.io/playground](https://satgate.io/playground)
- 💻 GitHub: [github.com/SatGate-io/satgate](https://github.com/SatGate-io/satgate)
- 📧 Contact: contact@satgate.io

## License

MIT License - © 2025 SatGate. Patent Pending.

