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

# Wispr Flow API reference

> API reference for the Wispr Flow plugin in Corsair: every `wisprflow.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Tokens

### generate

`tokens.generate`

Create a short-lived client JWT so a browser or app can call the client-side API without the org key

**Risk:** `write`

```ts theme={null}
await corsair.wisprflow.api.tokens.generate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | Your identifier for the end user or app |
| `duration_secs` | `number` | Yes | Token lifetime in seconds |
| `metadata` | `Record<string, any>` | No | Extra data stored with the token |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `access_token` | `string` | Yes | Client JWT for the client-side API |
| `expires_in` | `number` | Yes | Seconds until the token expires |

***

### revoke

`tokens.revoke`

Revoke one client JWT so it stops working immediately

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.wisprflow.api.tokens.revoke({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `access_token` | `string` | Yes | The client JWT to revoke |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string` | Yes | — |
| `message` | `string` | Yes | — |

***

### revokeClient

`tokens.revokeClient`

Revoke every client JWT issued to a client\_id

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.wisprflow.api.tokens.revokeClient({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `client_id` | `string` | Yes | Client whose tokens are all revoked |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string` | Yes | — |
| `message` | `string` | Yes | — |

***

## Transcriptions

### create

`transcriptions.create`

Transcribe base64 16kHz PCM16 WAV audio into formatted text. Billed per generated token

**Risk:** `destructive`

```ts theme={null}
await corsair.wisprflow.api.transcriptions.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `audio` | `string` | Yes | Base64-encoded 16kHz PCM16 WAV audio, up to 25MB or 6 minutes |
| `language` | `string[]` | No | ISO 639-1 codes the speaker may use. One code skips detection, empty detects from all languages. Defaults to \[]. |
| `context` | `object` | No | App, user, textbox, screen and conversation context that improves formatting and accuracy. Defaults to \{}. |

> [accordion] context full type
>
> ```ts theme={null}
> {
>   app?: {
>     name?: string,
>     type?: ai | email | other
>   },
>   dictionary_context?: string[],
>   user_identifier?: string,
>   user_first_name?: string,
>   user_last_name?: string,
>   textbox_contents?: {
>     before_text?: string,
>     selected_text?: string,
>     after_text?: string
>   },
>   screenshot?: string,
>   content_text?: string,
>   content_html?: string,
>   conversation?: {
>     id: string,
>     participants?: string[],
>     messages?: {
>       role: user | human | assistant,
>       content: string
>     }[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Transcription UUID |
| `text` | `string` | Yes | Transcribed text with formatting applied |
| `detected_language` | `string` | Yes | Detected ISO 639-1 language code |
| `total_time` | `number` | Yes | Processing time in milliseconds |
| `generated_tokens` | `number` | Yes | Tokens generated, the unit Wispr Flow bills on |

***

### warmup

`transcriptions.warmup`

Warm the API connection before a dictation session to cut first-request latency

**Risk:** `read`

```ts theme={null}
await corsair.wisprflow.api.transcriptions.warmup({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string` | Yes | — |

***


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