openintents (Python)
Python SDK for OpenIntents: let your agents buy anything. Send an intent in plain language and it gets bought end to end in a real browser, paid, and resolved to a receipt. Inference, browser, compute and bandwidth are free.
Preview: the API is still being built, so it may change before launch.
pip install openintents
Usage
from openintents import OpenIntents
oi = OpenIntents() # reads OPENINTENTS_API_KEY
intent = oi.intents.create(
"flat white, oat milk, pickup 8:45 at the Blue Bottle on 5th",
max_amount=1000, # cents: never spend more than $10.00
)
intent = oi.intents.wait(intent["id"]) # returns when final, or when it needs payment
if intent["status"] == "requires_payment":
print("Pay here:", intent["payment"]["payment_url"])
elif intent["status"] == "completed":
receipt = intent["result"]
print(receipt["merchant"], receipt["total"], receipt["confirmation"])
Async:
from openintents import AsyncOpenIntents
async with AsyncOpenIntents() as oi:
intent = await oi.intents.create("book an Uber to SFO at 7am", max_amount=6000)
intent = await oi.intents.wait(intent["id"])
Also: oi.intents.get(id), oi.intents.list(status=..., limit=...),
oi.intents.list_all(), oi.intents.cancel(id) and oi.balance.get().
Errors raise OpenIntentsError (status, type, code, param); 429s,
5xx and network errors are retried with backoff.
Webhooks
from openintents import verify_webhook, WebhookVerificationError
event = verify_webhook(request_body_bytes, request.headers.get("OpenIntents-Signature"), "whsec_...")
Development
uv run --extra dev pytest
uv run --extra dev ruff check src tests
Docs: https://openintents.io/docs. License: GPL-3.0-or-later.
Metadata
Release files for openintents 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openintents-0.1.1.tar.gz | 32.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openintents-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.9 kB
Release files / openintents-0.1.1.tar.gz
| Download URL | openintents-0.1.1.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4afc2afb3eefcdfb1bac746554aac82a8a424c125b317faca6ac2a699766be30
|
|
BLAKE2b-256 checksum How to use checksums |
923dd862cd4e19afb5f67a56ee24aca1952bbfff1a3a6a1cd15dcbc24792d891
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / openintents-0.1.1-py3-none-any.whl
| Download URL | openintents-0.1.1-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22c16457e37e6b007bfce9f1fd3be8d06c10ca2c1135eca89200f4a0238a0561
|
|
BLAKE2b-256 checksum How to use checksums |
50885f399dd3e0d0706d096d2ac98cb3cf3a3e27b6a501e5c8422ad742ea5d34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|