# Set up an Agents API browser task with OpenAI computer use
> A documentation-based guide to creating an OpenAI Agents API browser session, handling website-origin requests, checking the result and deleting the session.
By BIG CHANGE Editorial
Published: 2026-09-30T01:36:49.389Z
Updated: 2026-09-30T01:36:49.389Z
Canonical: https://bigchange.ai/blog/openai-agents-api-computer-use-browser-guide

AI-generated by OpenAI; BIG CHANGE conceptual editorial illustration.
OpenAI's September 29 [DevDay recap](https://openai.com/index/devday-2026-recap/) announced computer use in the Agents API. Our [DevDay launch guide](https://bigchange.ai/blog/openai-devday-2026-launches-availability-guide) covers the wider release. For a developer, the immediate task is smaller than a general browser agent: open a public page, collect a specific answer, and account for what the browser accessed. OpenAI's [computer-use guide](https://developers.openai.com/api/docs/guides/agents-api/tools/computer-use), checked September 30, documents that path through a hosted browser session. BIG CHANGE has reviewed the documentation, not run the API.
The application creates the session, sends input, follows events, presents website-origin requests to the user, checks the answer and cleans up. The agent can operate the browser inside the hosted environment. A completed turn does not establish that the requested information is correct.
## The big change
OpenAI's new Agents API computer-use path gives developers a hosted browser session with an event stream, user decisions on website origins, browser activity records and cleanup through the API. For a bounded public-page task, the practical integration is to handle those stages explicitly and verify the returned title and URL. Access to an origin, completion of a turn and correctness of the answer are three different observations.
## Start with an API key and a browser session
OpenAI's [Agents API quickstart](https://developers.openai.com/api/docs/guides/agents-api/quickstart#prerequisites) calls for an application API key in an OpenAI Platform project. It specifies `api.agents.read` and `api.agents.write` for session operations and `api.responses.write` for model inference. Export the key as `OPENAI_API_KEY` in the application environment and keep it outside the agent's sandbox. Use a current OpenAI SDK with the beta Agents API; the computer-use guide's JavaScript walkthrough uses `openai` and `prompt-sync`. Its cURL alternative requires Bash and `jq` and the explicit `OpenAI-Beta: agents=v1` header.
The documented session configuration places `{ "type": "computer_use" }` in `agent.tools`, sets `environment.type` to `openai_hosted`, and enables `environment.desktop.enabled`. Its public-page example also enables network access and sets `include_screenshots: true` on the tool. Session creation returns an ID for subsequent event and item requests; it does not start the browser task. Save that ID before proceeding. The guide's example asks the agent to find the Agents API quickstart and return its page title and URL, without signing in or changing website data.
## Follow the task and decide which sites it may reach
Open the session event stream before sending the task input, so the application can receive early events. The documented input is an `agent.session.input.message`. When the stream reports `agent.session.requires_action`, retrieve the session's current `required_actions` and identify pending `computer_use_approval_request` records. For a `browser_origin_access` request, show the user the requested origin and any stated reason. Send their `approve`, `deny` or `cancel` decision as an `agent.session.input.computer_use_approval_request_result` with the matching `request_id`.
That decision is about access to a website origin, including a public one. Setting `network.access` to `enabled` does not supply the approval. Nor does origin approval confirm each later browser action. OpenAI says applications that need guaranteed confirmation before purchases or destructive changes should limit the hosted browser to resources that cannot perform those actions, or use a browser runtime they control. Website text is untrusted input and cannot authorize access or override the user's instructions.
The public-page walkthrough cancels a separate `browser_authentication` request. A task that needs an account has its own [sign-in flow](https://developers.openai.com/api/docs/guides/agents-api/tools/computer-use#handle-sign-in); this read-only setup does not cover it. OpenAI also notes that cancelling an approval request does not cancel the task. An accepted approval response means the decision was received, not that navigation has finished.
## Check the result, review activity, then delete the session
The event stream can provide answer text in `agent.session.turn.output_text.done`. Wait for `agent.session.turn.completed` for the main turn, while handling failure and cancellation events separately. For the documented task, inspect whether the answer actually contains the quickstart title and URL. A closed stream alone does not establish that the turn ended; OpenAI directs developers to recover the same session after a connection failure or uncertain outcome.
Session items provide a second view of the browser work. `computer_use_call` items include an activity title, turn ID and status. With screenshots enabled, an item may include a `computer_screenshot` image URL; some operations still return no image. Those items show browser operations, not a final verdict on the task. Review the saved items and any result or screenshot your application needs before deleting the session to request environment cleanup. Screenshots may contain sensitive page or account information, so the documentation advises keeping them with authorized viewers and out of application logs.
## Access and cost are separate decisions
OpenAI says in its [DevDay recap](https://openai.com/index/devday-2026-recap/) that computer use is available through the API and in Codex and ChatGPT Work on Pro 500 and Enterprise. This guide covers the API path, which requires Platform credentials and permissions. The product-plan statement does not grant API access or include API usage charges.
The [Agents API overview](https://developers.openai.com/api/docs/guides/agents-api/overview) says model usage is billed at the selected model's [API rates](https://developers.openai.com/api/docs/pricing), while OpenAI-hosted sandboxes use standard [container rates](https://developers.openai.com/api/docs/pricing#built-in-tools). The pages reviewed state no separate computer-use tool fee; that does not make a hosted browser session free. Check current model and container prices before budgeting a run. The examples use beta API methods and may change. No API session, browser task or SDK execution was performed for this article.
## Sources & further reading
- [OpenAI, “Computer use”](https://developers.openai.com/api/docs/guides/agents-api/tools/computer-use), accessed September 30, 2026. The primary reference for browser configuration, event names, origin and authentication requests, result checks, activity and deletion. The page did not show a publication date.
- [OpenAI, “Agents API quickstart”](https://developers.openai.com/api/docs/guides/agents-api/quickstart), accessed September 30, 2026. Specifies Platform key permissions, the beta header and SDK prerequisites; its general coding example is separate from the browser walkthrough.
- [OpenAI, “Agents API”](https://developers.openai.com/api/docs/guides/agents-api/overview) and [“OpenAI-hosted sandboxes”](https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted), accessed September 30, 2026. Explain the session model and separate model and hosted-container charges. Neither page supplied a publication date.
- [OpenAI API pricing](https://developers.openai.com/api/docs/pricing), accessed September 30, 2026. Current rates should be checked for the selected model and hosted container; no specific run cost is estimated here.
- [OpenAI, “DevDay 2026 Recap”](https://openai.com/index/devday-2026-recap/), published September 29, 2026. Source for the launch and OpenAI's separate API and Codex/ChatGPT Work plan-availability statements.
## Sources
- [Computer use | OpenAI API](https://developers.openai.com/api/docs/guides/agents-api/tools/computer-use) — Primary browser-task reference for hosted environment, event and approval names, result verification, activity, screenshots and deletion. Documentation, not a BIG CHANGE test.
- [Agents API quickstart | OpenAI API](https://developers.openai.com/api/docs/guides/agents-api/quickstart) — Platform application key permissions, SDK setup, beta header and session lifecycle. The general coding example is distinct from the computer-use walkthrough.
- [Agents API | OpenAI API](https://developers.openai.com/api/docs/guides/agents-api/overview) — Documents the managed session model and separate charges for model usage, OpenAI tools and hosted sandboxes.
- [OpenAI-hosted sandboxes | OpenAI API](https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted) — Confirms standard container rates for OpenAI-hosted sandboxes, separate model billing and deletion to request environment cleanup.
- [Pricing | OpenAI API](https://developers.openai.com/api/docs/pricing) — Current model and container rates. The reviewed pages do not state a distinct computer-use tool fee; no per-run estimate is made.
- [DevDay 2026 Recap | OpenAI](https://openai.com/index/devday-2026-recap/) — Vendor announcement for Agents API computer use and separate API versus Codex/ChatGPT Work Pro 500 and Enterprise availability.
The BIG CHANGE newsletter
The big picture. At your pace.
Recent stories on AI and robotics, the shifts worth watching and practical ideas to use. Choose a daily briefing, weekly digest or monthly perspective.
Sent at 09:00 Belgrade time: daily, Mondays or the first of the month. Your first edition arrives at the next scheduled send after you confirm.
Your privacy, your choice.
Necessary storage supports site security and remembers your choices. Optional Google Analytics stays off until you allow it. You can read every story with necessary storage only. Privacy details