Start the microphone, or stop it and transcribe
POSThttp://127.0.0.1:{port}/recording/toggle
Send Authorization: Bearer <token>, with the token from the discovery file. See the Local API overview for the port, the token and the response envelope.
Works on Linux only. macOS does not serve this path. Windows answers it with ok: false and the code ENGINE_UNAVAILABLE. The route takes no request body and no mode_id, so it uses the current Mode.
When the recorder is idle, the call starts it. When the recorder is recording, the call stops it and transcribes, and it waits for that transcription — so it is as slow as a /transcribe call.
A call during the stopping or the transcribing state is refused with HTTP 400 and the code INVALID_REQUEST, because a transcription is already in progress.
Responses
200 Recorder state after the toggle
application/json, RecordingStateResponse
okbooleanrecordingRecordingStateState of the live recorder. Linux only.
is_recordingbooleanTrue for the
recordingstate only.statestringone of "idle", "recording", "stopping", "transcribing", "retrying", "completed", "cancelled", "failed"
400 A transcription is already in progress
application/json, ErrorEnvelope
okbooleanrequiredone of false
errorobjectrequiredcodestringrequiredone of "MODEL_NOT_INSTALLED", "MODEL_NOT_FOUND", "ENGINE_UNAVAILABLE", "MISSING_API_KEY", "FILE_NOT_FOUND", "FILE_ACCESS_DENIED", "FILE_NOT_ALLOWED", "AUDIO_DECODE_FAILED", "TRANSCRIPTION_FAILED", "MODE_NOT_FOUND", "MODE_NAME_TAKEN", "INVALID_REQUEST", "RATE_LIMITED", "TIMEOUT"
messagestringrequiredhintstring
The whole spec is openapi.yaml.