Skip to main content

oya-browser

Real browsers for AI agents, from Python. Start a browser on Oya Cloud, your own infrastructure or any provider your key routes to; drive it; have an agent do a task once; save it as a playbook; replay it with no model. The Python twin of @oya-ai/browser.

pip install oya-browser
export OYA_API_KEY=oya_...    # from https://oyabrowser.com, or run `oya login` once

Quickstart

from oya_browser import Oya

with Oya() as oya, oya.browser.start() as browser:      # stopped when the block exits
    browser.goto("https://httpbin.org/forms/post")
    browser.ask("Order a large pizza for {{name}}, then submit the order", data={"name": "Ada"})
    browser.to_playbook("pizza")                         # the run, saved as Playwright code
    browser.play("pizza", {"name": "Alan"})              # replayed with no model

Async, for agent frameworks:

from oya_browser import AsyncOya

async with AsyncOya() as oya:
    async with await oya.browser.start() as browser:
        print(await browser.ask("What is the title of https://example.com?"))

browser-use on Oya

pip install "oya-browser[browser-use]"   # Python 3.11+
from browser_use import Agent, ChatAnthropic
from oya_browser import AsyncOya

async with AsyncOya() as oya:
    async with await oya.browser.start() as browser:
        agent = Agent("Find the cheapest flight to Lisbon", llm=ChatAnthropic(model="claude-sonnet-5"),
                      browser=await browser.for_browser_use())
        print((await agent.run()).final_result())

browser-use drives the Oya browser over CDP, unchanged. Each Oya CDP URL carries a single-use ticket, so for_browser_use() asks for a fresh one every time; use fresh_cdp_url() the same way for any other CDP tool.

Playwright, Puppeteer and Stagehand

browser.cdp_url (or browser.fresh_cdp_url()) is a CDP endpoint for Playwright's connect_over_cdp, and for Stagehand v3's cdpUrl. Stagehand v4 runs inside its own browser extension, which Oya browsers do not load yet.

What a browser can do

goto(url), analyze(format=None), elements() Open a page; read it as TOON, markdown or JSONL with numbered elements
click(id), type(id, text), press_key(key), wait_for(selector) Act on elements by their number from analyze()
scroll(direction, amount=None, at=None) Scroll the page, or aim at an inner scroller with at=(x, y)
url(), tabs(), open_tab(url=None), switch_tab(id), close_tab(id) Tabs
handle_dialog(accept, prompt_text=None) Answer a confirm() or prompt() holding the page
ask(prompt, data=, secrets=), extract(prompt, schema) A task in plain language; secrets are typed but never shown to the model
to_playbook(name), play(name, data, auto_heal=True) Save the last task; replay it with no model, repairing a step a page changed
submit(prompt) or submit(playbook=...) A background run with on_success, on_failure, on_human_attention, on_healed callbacks
live_view_url(), live_stream_url(), share_url(control=False), revoke_share(id) Watch it, embed its frames, or hand a person a scoped, expiring link
solve_captcha(), complete_mfa(), screenshot(), status(), stop()

oya.browser.start(captcha="auto") makes every goto() clear a CAPTCHA, raising OyaError (409) when one needs a person.

submit() on AsyncOya polls in the background as soon as it returns; await run.done for the result. The sync client has no background to poll in without a thread, so run.wait() polls, fires the same callbacks in the same order, and returns the result or raises. Answer an attention request with request["respond"]().

run = browser.submit(playbook="prior-auth", data={"member": "M1"},
                     on_human_attention=lambda req: print("Needs you:", req["liveViewUrl"]))
result = run.wait()

Files ride in data: browser.ask("Attach my resume", data={"resume": file("cv.pdf")}), up to MAX_FILE_BYTES (10MB).

The client

oya.browser start(persona=, provider=, name=, captcha=), get(id), list(), stop(ids), stop_all()
oya.desktop connect(persona=None): the person's own desktop browser with their logins, paired if needed
Oya.signup(email) An agent's own key, saved to ~/.oya/config.json
oya.playbooks list(), get(name), promote(name), export(name), import_(doc, name=, overwrite=), remove(name)
oya.llm answer(question, values): the text for a free-text field in an exported playbook
oya.personas (oya.profiles) list, get, create, update, clone, preview, options, pin_proxy, remove, set_mfa, clear_mfa, set_credentials, credentials, clear_credentials, cookies, import_cookies, copy_cookies, clear_cookies
oya.persona_groups (oya.profile_groups) list, create, update, remove
oya.proxies list, create, remove, check
oya.control Sessions, takeover, recovery, events, service credentials, members, webhooks
oya.config get(), set(values): this key's model, provider and solver settings
oya.usage() Usage on this key

Results are the server's JSON as plain dicts. On AsyncOya the same calls are awaited.

Every failure raises OyaError with the server's message, status and body.

Configuration

The key and address come from the arguments (Oya(api_key=..., base_url=...)), then OYA_API_KEY and OYA_BASE_URL, then the key oya login saved in ~/.oya/config.json, the same order as the TypeScript SDK.

HIPAA

HIPAA mode runs on Oya Cloud (BAA on request) or self-hosted in your own cloud. See oyabrowser.com/baa.

License

MIT

Metadata

Release files for oya-browser 0.2.1

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

Source distribution (sdist)

Source distribution for oya-browser 0.2.1
File Size Uploaded Provenance Actions
oya_browser-0.2.1.tar.gz 187.9 kB With provenance Details for oya_browser-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oya-browser 0.2.1
File Interpreter ABI Platform Actions
oya_browser-0.2.1-py3-none-any.whl Python 3 none any Details for oya_browser-0.2.1-py3-none-any.whl

Total release size: 228.0 kB

Release files / oya_browser-0.2.1.tar.gz

Download URL oya_browser-0.2.1.tar.gz
Size 187.9 kB
Tags Source
SHA-256 checksum
How to use checksums
104cc49a2d1142adc0a37c24d3bd843e15e8a46989492913e0cfbb0d150b45d9
BLAKE2b-256 checksum
How to use checksums
4a072cee3bb1f23efb73708c1b152bda8b90f4de06d8bd914677fe74fbf8cd1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Release files / oya_browser-0.2.1-py3-none-any.whl

Download URL oya_browser-0.2.1-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
375771cf0bb835da5ddcc4e3dfd9e908178893db07acad365ee48ad9a7a890ea
BLAKE2b-256 checksum
How to use checksums
e4d57da8f48a1ecfe33bc2ea2db617c176a9b32ba70270bd5b10b4b9006da64a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Security for oya-browser 0.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for oya_browser-0.2.1.tar.gz

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 Nov 18, 2026.

Transparency log

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.

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