Metadata-Version: 2.5
Name: teppi-client
Version: 0.1.0
Summary: Check an x402 or MPP seller against the Teppi record before an agent signs a payment, as a pre-sign policy for Amazon Bedrock AgentCore payments or a plain function
Project-URL: Homepage, https://api.teppi.xyz/docs/integrations
License-Expression: MIT
Keywords: agentcore,agents,check-before-paying,mpp,payments,x402
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: bedrock-agentcore[strands-agents]>=1.25; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# teppi-client for Python

Check an x402 or MPP seller against the [Teppi record](https://teppi.xyz) before an agent signs a
payment to it. Standard library only.

## Amazon Bedrock AgentCore payments

AgentCore calls `pre_sign_policy` at the moment before it signs, in both the Strands plugin and
the LangGraph middleware, and signs only when it returns `True`.

```python
from bedrock_agentcore.payments.integrations.config import AgentCorePaymentsPluginConfig
from teppi_client import pre_sign_policy

config = AgentCorePaymentsPluginConfig(
    payment_manager_arn=PAYMENT_MANAGER_ARN,
    user_id="user-123",
    payment_instrument_id=INSTRUMENT_ID,
    payment_session_id=SESSION_ID,
    region="us-west-2",
    pre_sign_policy=pre_sign_policy(min_band="C"),
)
```

It refuses a payee whose paid calls settled with nothing usable back, a listing the record says is
broken, a letter below `min_band`, and an amount more than five times what the endpoint last asked.
An unrated seller is paid, since unknown is not bad (`unrated="refuse"` changes that). If the record
cannot be reached the payment goes ahead (`when_unreachable="refuse"` changes that).

## Anywhere else

```python
from teppi_client import check, decide

answer = check("https://seller.example/v1/price", pay_to="0x...")
decision = decide(answer, min_band="C")
```

Every answer is signed; https://api.teppi.xyz/docs/integrations says how to verify one.
