---
title: "Mint a Cloudflare Think chat token"
method: POST
path: "/api/copilot/chats/{chatId}/token"
tags: ["Copilot"]
---

# Mint a Cloudflare Think chat token

`POST /api/copilot/chats/{chatId}/token`

## Request

- Base URL: `https://api.setluca.com`
- URL: `https://api.setluca.com/api/copilot/chats/{chatId}/token`
- Auth: API key in cookie `luca.session_token`

Mints a short-lived token, also set as a cookie, that lets the browser talk straight to this chat's agent. It lives for one minute and is bound to one chat, so it can't be reused anywhere else.

**Session-only.** This endpoint isn't on the API-key allowlist. An organization API key gets a 403 here, whatever scopes it holds.

## Path parameters

- `chatId` string, uuid, required

## Headers

- `Luca-API-Version` '1'

## Response `200`

ok

- CopilotChatTokenResponse
  - `token` string, required
  - `doId` string, required
  - `chatId` string, uuid, required

## Other responses

- `401`: unauthorized
- `404`: not found
- `429`: rate limited
- `500`: internal error
- `503`: service unavailable

---

[API](https://skmtc.dev/setluca/apis/luca-api.md) · [All operations](https://skmtc.dev/setluca/apis/luca-api/llms.txt) · [OpenAPI document](https://skmtc.dev/setluca/apis/luca-api/revisions/90a200e4100b?raw)
