hapti
An agent that does tasks on any website by sight, in a real browser. You pay only when it succeeds.
Documentation: hapti.dev/docs · API reference: hapti.dev/docs/api-tasks · For AI agents: hapti.dev/llms.txt
pip install hapti
from hapti import Hapti
hapti = Hapti() # reads HAPTI_API_KEY
task = hapti.tasks.run({
"url": "https://www.example.com",
"goal": "Read the main title of the page",
"output": {"type": "object", "required": ["title"], "properties": {"title": {"type": "string"}}},
})
print(task["result"]["data"]["title"])
When the site asks for something the task does not have, on_waiting gets it and what it returns is sent back:
hapti.tasks.run(
{"url": "https://portal.example.com", "goal": "Declare the claim", "data": {"contract": "AX-1"}, "user": "customer-42"},
on_waiting=lambda pending, task: ask_my_user(pending["text"]),
)
pending["action_url"] is also a ready page you may send to your user yourself: they answer or approve on it, once, without any key.
Every user keeps their session, device and mailbox; every success becomes a recipe replayed next time; output gives result["data"] checked against your schema, and a task that cannot fit it is not billed.
batch = hapti.batches.create({"template": {"url": url, "goal": goal}, "items": [{"user": c.id, "data": {"contract": c.contract}} for c in customers]})
for t in hapti.batches.tasks(batch["id"]):
print(t["id"], t["status"])
hapti.schedules.create({"cron": "0 9 * * 1-5", "timezone": "Europe/Paris", "task": {"url": url, "goal": goal}})
hapti.tasks.estimate({"url": url, "goal": goal})
from hapti import verify_webhook
verify_webhook(raw_body, headers["Hapti-Signature"], secret)
Test keys (hp_test_...) are free and never send the data to the sites. Live keys (hp_live_...) are billed only when a task succeeds.
link = hapti.users.connect_link("customer-42", accounts=[{"account": "bank", "origin": "https://www.my-bank.com", "label": "My bank"}], brand={"name": "Acme"})
hapti.users.set_limits("customer-42", tasks_per_day=20, cents_per_month=500)
hapti.users.usage("customer-42")["billed_cents"]
link["url"] is a page you send to your user yourself: they put their credentials in the vault and give their consent; you never see their secrets.
Metadata
Release files for hapti 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hapti-0.2.0.tar.gz | 8.9 kB | Without provenance | Details for hapti-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hapti-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for hapti-0.2.0-py3-none-any.whl |
Total release size: 15.7 kB
Release files / hapti-0.2.0.tar.gz
| Download URL | hapti-0.2.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
974b454cf076a1bede6a83d04d220f33a66483c986bf4adfd9ad1d42854e967d
|
|
BLAKE2b-256 checksum How to use checksums |
330cb59786644aab863c6bd264aa9b2f78be9e4f551665cccd357e141b0f3304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / hapti-0.2.0-py3-none-any.whl
| Download URL | hapti-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d555a9bdbb51175565e91aa2ae78654fef6e061e6617ea19b7e2d1f0390b18ed
|
|
BLAKE2b-256 checksum How to use checksums |
14a2da2afcdfd0c1d4e583baeec2157f56fba0696ad5d49450a103cfb0009e7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Security for hapti 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.