Your agent has logged into a portal, now it needs to read a handful of pages. Starting another browser session for each retrieval adds work when the site already recognizes the saved login.
Authenticated Fetch lets you reuse that login with the Fetch API. Pass a Context ID alongside the URL, and Fetch sends the saved cookies with the request. You can retrieve authenticated content without opening an interactive browser session for every page.
Log in with a Browser, then read with Fetch.
A Context saves browser state between sessions. With this release, Fetch can use the cookies saved in a Context to request pages behind a login.
For example, consider a workflow that checks an order history page in a supplier portal. Use a browser to complete the login and save the session. If the portal serves that page's content without JavaScript rendering, subsequent checks can use Fetch with the same Context.
The setup has three steps:
- Create a Context and start a browser session that uses it with
persist: true. - Log in to the site and end the browser session so its cookies are saved.
- Send the page URL and
contextIdto Fetch.
The request uses the same endpoint as any other Fetch call:
Replace the example URL with a page you have permission to access and the Context ID with the one used for your saved login. The response's content field contains the page as markdown.
Choose the output format you need
Contexts work with Fetch's existing output formats. Use raw content when you need the source response, markdown for readable text, or JSON with a schema when you need specific fields.
For the order-history example, a schema could describe order numbers and statuses. JSON extraction uses a language model to extract those fields from the fetched page. Your application can then check the result before passing it to the next step.
Authentication and extraction happen in the same Fetch request, you don't need to copy cookies into each request yourself.
How does it work?
Fetch reads the cookies from the Context's last saved browser session. Cookies follow browser-style domain and path rules, including when redirects are enabled, and expired cookies are dropped.
Fetch doesn’t write cookie changes back to the Context. If a site's login expires or needs to be refreshed, return to a browser session with persist: true, sign in again, and end the session to save the updated state.
A newly created Context needs a completed browser session before it has saved cookies to use. Contexts last saved before September 1, 2026 also need one browser session with persist: true to refresh them.

Getting started
Authenticated Fetch is available for no additional cost on every plan, get started in less than 5 minutes.
Start building with Browserbase
Run headless browsers for your agents and automations at scale. Get started free in minutes.
