Documentation Index
Fetch the complete documentation index at: https://docs.tinyfish.ai/llms.txt
Use this file to discover all available pages before exploring further.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | https://api.browser.tinyfish.ai | Create a browser session |
DELETE | https://api.browser.tinyfish.ai/{session_id} | Terminate a browser session |
X-API-Key header. See Authentication.
Session creation typically takes 10-30 seconds. Set your HTTP client timeout to at least 60 seconds.
Request
Parameters
Target URL the session will navigate to on startup. Bare domains (e.g.
tinyfish.ai) are automatically prefixed with https://. Omit to start at about:blank.Inactivity timeout in seconds (5–86400). Defaults to your plan maximum.
Response
Unique identifier for this session.
WebSocket URL for browser connection. Pass this to Playwright’s
connect_over_cdp or any CDP client.HTTPS base URL for the session. Use to access session endpoints such as
/pages.DELETE — Terminate a Session
204.
Path Parameters
The
session_id returned when the session was created.Response
Returns204 No Content with an empty body on success.
Error Codes
| HTTP Status | Error Code | Cause |
|---|---|---|
| 400 | INVALID_INPUT | session_id is missing or empty. |
| 401 | MISSING_API_KEY / INVALID_API_KEY | Missing or invalid X-API-Key. |
| 404 | NOT_FOUND | Session does not exist or belongs to a different API key. |
| 502 | INTERNAL_ERROR | Browser infrastructure failed to terminate the session. Retry. |
Debugging — Open DevTools Inspector
PollGET {base_url}/pages and open the devtoolsFrontendUrl of the first non-blank page to inspect the live browser session.
The page starts at
about:blank and navigates asynchronously — skip blank pages when polling to get the correct inspector URL.Session Lifecycle
| Behavior | Details |
|---|---|
| Startup navigation | If url was provided at session creation, the browser navigates there immediately. The 201 response is returned before navigation completes — the page may still be loading when you connect. |
| Inactivity timeout | Sessions automatically terminate after the configured inactivity timeout. A session is considered inactive when no CDP commands are being sent. |
| Explicit termination | Send DELETE https://api.browser.tinyfish.ai/{session_id} to terminate a session immediately. Returns 204 No Content on success. Deleting an already-ended session is idempotent. |
| Session isolation | Each session is a fully isolated browser instance. No cookies, storage, or state is shared between sessions. |
SDK Methods
End-to-End Example
Create a session, connect with Playwright, take a screenshot, and extract the page title.Error Reference
| HTTP Status | Error Code | Cause | Resolution |
|---|---|---|---|
| 400 | INVALID_INPUT | url field is not a valid URL. | Check the details field in the error response for specifics. |
| 401 | MISSING_API_KEY / INVALID_API_KEY | Missing or invalid X-API-Key header. | Verify your API key at the dashboard. |
| 402 | INSUFFICIENT_CREDITS | No credits or active subscription. | Add credits or upgrade your plan. |
| 404 | NOT_FOUND | Browser API is not available on your plan. | Contact support to enable access. |
| 500 | INTERNAL_ERROR | Unexpected server error. | Retry after a brief delay. If persistent, check status.agent.tinyfish.ai. |
| 502 | INTERNAL_ERROR | Browser infrastructure failed to start the session. | Retry — this is usually transient. |
Related
Browser Overview
First request, success shape, and product routing
Authentication
API key setup
Error Codes
Full list of API error codes
Key Concepts
Understand where Browser fits in the overall API surface