Skip to main content

langchain-pink

Pink Agentic AI Payments lets AI agents pay within spending rules a company sets in advance: per-agent budgets, payee allow-lists, and human-approval thresholds. This package wraps the official pink-agentic-payments Python client as LangChain tools, so a langgraph (or any LangChain-compatible) agent can request a payment, check its remaining budget, and poll a payment's status as part of its normal tool loop.

Sandbox preview. Every tool here talks to the public Pink sandbox (https://agentic-sandbox.pinkwallet.com). It uses test money only — no real funds ever move. Workspaces and keys created in the sandbox can appear or disappear without notice; use it for development and demos, not production. See the docs hub for production status.

Install

pip install langchain-pink

Or install both packages straight from GitHub:

pip install "pink-agentic-payments @ git+https://github.com/Pink-Agentic-Payments/pink-agentic-payments-python" \
            "langchain-pink @ git+https://github.com/Pink-Agentic-Payments/langchain-pink"

Quickstart

from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
from pink_agentic_payments import create_sandbox_workspace
from langchain_pink import PinkToolkit

# 1. Spin up a free sandbox workspace (no signup, test money only)
workspace = create_sandbox_workspace(company="My Test Co", template="startup")
agent_key = workspace["agents"][0]["key"]

# 2. Build the toolkit and hand it to an agent
toolkit = PinkToolkit(agent_key=agent_key)
agent = create_react_agent(ChatOpenAI(model="gpt-4o-mini"), toolkit.get_tools())

result = agent.invoke(
    {"messages": [("user", "Pay Figma $50 for our design tool renewal, check the budget first.")]}
)
print(result["messages"][-1].content)

agent_key can also be supplied via the PINK_AGENT_API_KEY environment variable instead of the constructor argument.

Tools

Tool Wraps Decision
pink_request_payment PinkClient.request_payment allowed, pending_human, or blocked, with the reason
pink_check_policy PinkClient.check_policy dry-run: would_allow, would_ask, or would_block — no spend
pink_get_budget PinkClient.get_budget this agent's monthly budget, spend, and single-payment cap
pink_check_payment_status PinkClient.get_payment poll a payment, e.g. a pending_human hold, by id

Every tool maps 1:1 to a method already in the official pink-agentic-payments client — this package adds no new API surface, only LangChain BaseTool wrappers with Pydantic argument schemas for the LLM to read.

Development

pip install -e ".[test]"
pytest tests/unit_tests          # no network
pytest tests/integration_tests   # hits the live sandbox, creates a workspace

License

MIT, see LICENSE.

Metadata

Release files for langchain-pink 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-pink 0.1.0
File Size Uploaded
langchain_pink-0.1.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-pink 0.1.0
File Interpreter ABI Platform
langchain_pink-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / langchain_pink-0.1.0.tar.gz

Download URL langchain_pink-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
76ffacf5661adbf1d3d150eca0f8c523e0aaf52dc28343d00bf5db2a7555cd8c
BLAKE2b-256 checksum
How to use checksums
77d3d415f02ac2f8eade4ab415fbd07c351781b8d6f7d4cfb6ec19a3496a36a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / langchain_pink-0.1.0-py3-none-any.whl

Download URL langchain_pink-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04a6cf3e891d5781c8c9e754570b7c2e275631c4e56ac5cfd2e759e731922bc9
BLAKE2b-256 checksum
How to use checksums
ad2d5edf333fa68f4b77f5f8146c256f2d27308a1e156f2789385b8c8fac0af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page