---
title: "Mint a short-lived BrowserAgent (TCG) token"
method: POST
path: "/api/v1/cwa/agent/browser_tokens"
tags: ["CWA"]
---

# Mint a short-lived BrowserAgent (TCG) token

`POST /api/v1/cwa/agent/browser_tokens`

## Request

- Base URL: `https://toolkit.browserstack.com`
- URL: `https://toolkit.browserstack.com/api/v1/cwa/agent/browser_tokens`
- Auth: API key in cookie `_wdt_rails_session`

Mint a short-lived TCG bearer for the in-extension BrowserAgent engine (LV-3757). Paid-only; counted against the monthly AI generation quota unless resuming a recent one.

## Request body

- object
  - `resume` boolean: Reuse a recent counted generation without spending quota (only honoured while one is recent).

## Response `200`

Token minted

- object
  - `success` boolean
  - `data` object
    - `jwt` string
    - `tcg_host` string
    - `remaining_generations` integer
    - `limits` object
      - `max_steps_per_automation` integer
      - `monthly_generations` integer

## Other responses

- `402`: Monthly generation quota exhausted
- `502`: Upstream token mint failed

---

[API](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api.md) - [All operations](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/llms.txt) - [OpenAPI document](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/revisions/cbd06b547b6a?raw)
