> ## Documentation Index
> Fetch the complete documentation index at: https://predev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agents: start with https://docs.pre.dev/agents.md, which has complete recipes, plan access, polling rules, errors and limits.
> Authenticate with the workspace API key (pdk_…) from Integrations → Built-in, sent as Authorization: Bearer <key>.
> REST API: https://api.pre.dev (OpenAPI: https://docs.pre.dev/api-reference/openapi.json). AI Gateway: https://api.pre.dev/v1, OpenAI-compatible (OpenAPI: https://docs.pre.dev/api-reference/ai-gateway.openapi.json).
> pre.dev MCP server: npx -y @predotdev/mcp setup adds it to every local coding agent with every pre.dev tool plus the user's own Chrome; the hosted server is https://api.pre.dev/mcp. Search these docs over MCP at https://docs.pre.dev/mcp.

# Get your queue status

> Inspect pending and running tasks and the in-flight ceiling for your account.

```bash theme={null}
curl --fail-with-body https://api.pre.dev/browser-agent-status \
  -H "Authorization: Bearer $PREDEV_API_KEY"
```

| Field | Meaning |
| - | - |
| `pending` | Tasks waiting to start |
| `claimed` | Tasks assigned for execution |
| `running` | Tasks running |
| `total` | Pending + claimed + running tasks counted by this snapshot |
| `cap` | Your account's current in-flight ceiling |

## Size a submission

A request's task count must fit your available in-flight capacity as well as the service's batch-size limit. Lowering `concurrency` does not reduce how many submitted tasks count against the cap.

For example, a snapshot with `cap: 25` and `total: 20` suggests room for five tasks. Submit a small batch, then wait for capacity to free before sending the next one. Treat the snapshot as advisory: it is not a reservation, and the submission gate can still return `QUEUE_FULL`.

The cap depends on the plan and service configuration. Read `cap` rather than hard-coding a number or assuming the 1,000-task request ceiling is your account limit.

Node: `client.browserAgentStatus()`. Python: `client.browser_agent_status()` returns a dictionary. [Service capacity](https://predev.mintlify.site/browser-agents/api/capacity.md) is a separate endpoint and does not replace your account's cap.

## Errors

| Status | When |
| - | - |
| `401` | Missing or invalid key |
| `500` | Unexpected error |

Each status has an example body in the response examples. See [errors and retries](https://predev.mintlify.site/api-reference/errors.md).


## OpenAPI

````yaml api-reference/openapi.json GET /browser-agent-status
openapi: 3.1.0
info:
  title: pre.dev API
  description: >-
    Public REST API for software specifications, browser automation, and credit
    balance. Base URL: https://api.pre.dev. MCP is documented separately at
    https://docs.pre.dev/mcp/tools.
  version: 1.1.0
  contact:
    name: pre.dev Support
    url: https://pre.dev
    email: support@pre.dev
  license:
    name: Proprietary
    url: https://pre.dev/terms
servers:
  - url: https://api.pre.dev
    description: Production API Server
security:
  - apiKeyAuth: []
  - xApiKey: []
tags:
  - name: Specifications
  - name: Browser Agents
  - name: Account
paths:
  /browser-agent-status:
    get:
      tags:
        - Browser Agents
      summary: Get account queue status
      description: >-
        Snapshot of your queue and current inflight cap; does not reserve
        capacity.
      operationId: browserAgentStatus
      responses:
        '200':
          description: Account queue snapshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrowserAgentStatus'
              example:
                running: 2
                claimed: 0
                pending: 3
                total: 5
                cap: 25
        '401':
          description: Missing, invalid, or ineligible authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_key:
                  summary: No key sent
                  value:
                    error: Missing API key
                    message: >-
                      Please provide an API key via Authorization: Bearer
                      <token> header or x-api-key header
                invalid_key:
                  summary: Unknown key
                  value:
                    error: Authentication failed
                    message: Invalid API key
        '500':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Internal server error
components:
  schemas:
    BrowserAgentStatus:
      type: object
      properties:
        running:
          type: integer
        claimed:
          type: integer
        pending:
          type: integer
        total:
          type: integer
          description: Current inflight count reported by the queue snapshot.
        cap:
          type: integer
          description: >-
            Current account inflight limit, resolved by tier. Treat this as a
            snapshot, not a reservation.
      additionalProperties: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          description: Optional detail; not returned by every endpoint.
        code:
          type: string
          description: Machine-readable code when available.
        actionUrl:
          type: string
          format: uri
        requiresSubscription:
          type: boolean
        trialsUsed:
          type: integer
        maxTrials:
          type: integer
      additionalProperties: true
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Your pre.dev workspace API key (pdk_...) from Integrations, Built-in
        tab: https://pre.dev/projects/integrations?tab=built-in
    xApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Alternative to Authorization: Bearer.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.