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

# Finish a real-time session

> Flush the tail, settle once and complete the task.

Finishes a session: the server stops accepting new audio, flushes the trailing segment, waits for the
final result, settles the charge once and completes the task. A repeated finish returns the same task
and never charges twice.

### Path

<ParamField path="sessionId" type="string" required>
  The session to finish.
</ParamField>

### Header

<ParamField header="accessKey" type="string" required>
  API key for authentication.
</ParamField>

### Body

<ParamField body="capturedSamples" type="string | number">
  The client's confirmed capture length in samples. The decimal string form is the contract form; a
  JSON number is accepted for convenience. It marks a transport gap when it exceeds what the server
  received and never changes the charge.
</ParamField>

### Response

The same session view as [Get a real-time session](/api-reference/stt/getSession), with the terminal
`status` and the final `usage`. The task is now in the shared History.

<Note>
  A plain disconnect is not a successful finish. Use this endpoint (or the `session.finish` event) so
  the tail is committed and the task completes.
</Note>


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