Skip to main content

openintents (Python)

Python SDK for OpenIntents, the agentic API to buy anything. Send an intent in plain language; the API does the agentic work in a real browser, gets it paid, and resolves 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.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 openintents 0.1.0
File Size Uploaded
openintents-0.1.0.tar.gz 32.0 kB Details

Built distribution (wheel)

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

Total release size: 52.9 kB

Release files / openintents-0.1.0.tar.gz

Download URL openintents-0.1.0.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
243d51005c743b9e8740c1737d4de7573c0146f6c0695bad98eab72d82dcb5e6
BLAKE2b-256 checksum
How to use checksums
80c1e074bf8598c0aa5cd5a6480bddba24635267f00efbc819d74bb0ca832c16
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.0-py3-none-any.whl

Download URL openintents-0.1.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
643bad17174c6786bf21737a9bb441b0bc81c5fad0bb611b110e070ca76b801b
BLAKE2b-256 checksum
How to use checksums
80b661c0bb30e550b9f121a2646389125e82f62dd68613a7e7ecbc2bbb5ab8e7
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 history Release notifications | RSS feed

0.1.1

2 release files

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