Skip to content

Commit 7b1280d

Browse files
authored
Merge pull request #1695 from silentoplayz/codex/docs-stt-upload-api
docs: document the speech-to-text upload API
2 parents db6f9e8 + c00f544 commit 7b1280d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎docs/reference/api-endpoints.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,19 @@ The count is obtained from the upstream provider behind the resolved connection,
347347
The Messages API previously always reported `input_tokens: 0` in the streaming `message_start` block. Input tokens are now counted up front and reported in both streaming and non-streaming responses. If counting fails the request still succeeds, so clients should treat the value as best-effort rather than guaranteed.
348348
:::
349349

350+
### Speech-to-text transcription
351+
352+
Send recorded audio to `POST /api/v1/audio/transcriptions` with bearer authentication and a `multipart/form-data` body. Include the recording in the required `file` field. The optional `language` field supplies a language hint to transcription engines that use it. Non-admin callers need the speech-to-text permission (`chat.stt`).
353+
354+
```bash
355+
curl https://open-webui.example.com/api/v1/audio/transcriptions \
356+
-H "Authorization: Bearer $OPEN_WEBUI_TOKEN" \
357+
-F "file=@recording.wav" \
358+
-F "language=en"
359+
```
360+
361+
Read the transcript from `text` in the JSON response. To ask a model about the recording, send that transcript as a user message in a separate [chat completions request](#chat-completions).
362+
350363
### Image Generation and Editing
351364

352365
- **Endpoints**: `POST /api/v1/images/generations` (body: `prompt`, optional `model`, `size`, `n`, `steps`, `negative_prompt`) and `POST /api/v1/images/edit` (body: `image` as one or more base64-encoded images or URLs, `prompt`, optional `model`, `size`, `n`, `negative_prompt`, `background`).

0 commit comments

Comments
 (0)