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

# Chunked flow

> Stream audio while the consultation is ongoing.

Use this when you record in segments and want to push audio as it arrives,
rather than waiting for the full file. The server accumulates the transcript
per session; you generate the note when the consultation ends.

## 1. Open a session

```bash theme={null}
curl -X POST https://api.recnote.ai/api/v1/sessions \
  -H "Authorization: Bearer $RECNOTE_API_KEY"
```

```json theme={null}
{ "sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }
```

## 2. Push chunks

Send each audio chunk as it becomes available. Order is preserved.

```bash theme={null}
curl -X POST https://api.recnote.ai/api/v1/sessions/$SID/chunks \
  -H "Authorization: Bearer $RECNOTE_API_KEY" \
  -F "file=@chunk-001.webm" \
  -F "language=sv"
```

```json theme={null}
{ "ok": true, "chunkTranscript": "..." }
```

Repeat for every chunk. Each chunk's text is appended to the session's running
transcript.

## 3. Generate the note

When recording is finished, generate from the accumulated audio:

```bash theme={null}
curl -X POST https://api.recnote.ai/api/v1/sessions/$SID/notes \
  -H "Authorization: Bearer $RECNOTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "language": "sv" }'
```

```json theme={null}
{
  "transcript": "...full accumulated transcript...",
  "note": { "cause": "...", "subjective": "...", "...": "..." }
}
```

<Note>
  Generating consumes the session's accumulated audio. Open a new session for
  the next consultation.
</Note>

## Chunking tips

* Cut chunks at natural pauses (silence ≥ 500 ms) where possible — splitting
  mid-word can cause the two halves to transcribe separately.
* Any of `wav`, `mp3`, `m4a`, `ogg`, `webm` works per chunk.
