Skip to content

API backend: word-level timestamps - #13

Merged
TroyHernandez merged 3 commits into
mainfrom
word-timestamps
Jun 18, 2026
Merged

API backend: word-level timestamps#13
TroyHernandez merged 3 commits into
mainfrom
word-timestamps

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

With response_format = "verbose_json", .via_api now sends timestamp_granularities[]=word and parses the response's words array into result$words (word/start/end) — matching the native whisper backend, which always returns word timings. Works against OpenAI and a self-hosted whisper::serve().

This completes the word-timestamp chain so lc40's make_srt gets per-word timing through the serve path (it previously fell back to segment-level because the API path never carried words).

Additive — result$words is new; existing code is unchanged. Verified end-to-end against the troy-g5:7809 serve (48 words). Version 0.2.1.2 -> 0.2.1.3.

Depends on a whisper serve that honors word granularity (whisper >= 0.3.0.4, cornball-ai/whisper#15).

For response_format='verbose_json', .via_api now sends
timestamp_granularities[]=word and parses the response's words array into
result$words (word/start/end), matching the native whisper backend. Works
against OpenAI and a self-hosted whisper::serve(). Verified end-to-end
against a whisper serve (48 words returned). Bumps to 0.2.1.3.
OpenAI treats timestamp_granularities[] values as separate; requesting word
alone can suppress segments and break the verbose_json segment contract. Send
both segment and word (two array-style fields) so segments are preserved and
words added. Verified against the whisper serve: 2 segments + 48 words.
@TroyHernandez
TroyHernandez merged commit 79e95d9 into main Jun 18, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the word-timestamps branch June 18, 2026 01:18
TroyHernandez added a commit that referenced this pull request Jun 19, 2026
…route

#13 added result$words but the public return docs omitted it; #12 left
result$backend ambiguous (it reports the execution route, not the engine).
Document both in stt() Rd and README; the resolved backend/source pair
lives in the call_record attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant