AI 0.29.0: Try speech-to-text in the AI Playground, and API keys kept out of logs
AI 0.29.0 lets you try speech-to-text right in the PhoenixKit AI Playground before building it into your Phoenix app, keeps API keys out of logs and error messages, and makes AI usage logging more robust.
Speech-to-text in the Playground
A new “Speech to text” card records a clip with PhoenixKit’s audio recorder (core 3.4 or later), or takes an audio file, and transcribes it with transcribe/3. The clip stays, so you can run it again with another model, language hint, transcription path or instructions and compare the results, with the last five answers listed with their model, time and cost. A hint says beforehand which path your settings will use and whether the model is known to understand audio. The chat message has a Dictate button with the same settings, so you can try the exact component you would embed in your own pages.
The Speech to text card: one clip run through two models and paths, the answers listed with their time and cost.
API keys stay secret
An API key pasted with a stray space or newline produced an HTTP error that carried the whole Authorization header, and that error was logged and stored. Errors now name only their kind, and keys are trimmed when saved. Usage rows are always written, even when a message contains characters PostgreSQL refuses, so spend caps count every paid call.
Clearer numbers and better translations
Numbers on the admin pages now follow the reader’s language, so an Estonian or Russian reader sees 128 000 instead of 128,000, which in those languages reads as 128. The Estonian and Russian translations were checked against one glossary, with about 190 corrections, and the endpoint form, the voice languages and the permission description are now translated too.
The usage summary in Estonian: 341,3K tokens, written the Estonian way.
Upgrading
No migration. Some error results change for existing callers: an HTTP client error that is not a transport error (an invalid header value, or a body that does not decode) is reported as {:error, {:connection_error, {:http_error, module, tag}}} and is not retried, a successful response whose JSON is not an object is {:error, :invalid_response_format}, and a 200 response that carries an error and no answer is now an error (it used to count as a success and be cached). A user_uuid: that is not a UUID gets no per-user spend cap; the endpoint and site caps still apply. Dictate records only on PhoenixKit 3.4 or later, which ships the audio recorder.
Full release notes: AI 0.29.0
0.29.0 · 8 November 2026
No migration. See “Changed” for error returns that are new for existing callers.
Added
- Speech to text in the Playground. A “Speech to text” card records a clip with core’s audio recorder (PhoenixKit 3.4 and later) or takes a picked file, plays it back, and writes it down with
transcribe/3. The clip stays, so it can be run again with another model (suggested from the models known to take audio), language hint, path (automatic, chat or/audio/transcriptions) or instructions. The last five answers are listed with endpoint, model, path, language, length, time and cost, and each can be copied or used as the chat message. Before any call a hint says which path the settings take and whether the model is known to hear. The chat message has aDictatebutton with the same settings, so the component a host embeds can be tried as it is. PhoenixKitAI.Numbers: integers and decimals as the page’s language writes them. The admin pages use it:128,000and2.5in English,128 000and2,5in Estonian and Russian, where128,000read as 128.Budget.check/3takes the moment the windows are taken at;PhoenixKitAI.Web.MessageShape.describe_exit/1describes a task’s exit without its payload.- Core 3.4.0 ships the audio recorder, so
Dictaterecords on a host that has updated core; before, it showed nothing to record with.
Changed
- An HTTP client error that is not a transport error (an invalid header value, a body that does not decode) is
{:error, {:connection_error, {:http_error, module, tag}}}({:error, :invalid_json_response}for an image adapter’s undecodable body) instead of carrying the exception, and is not retried. Its text in a flash or a usage row names only its kind. - A 200 whose JSON is not an object (
[],42) is{:error, :invalid_response_format}, and a 200 with anerrorand no answer is an error whatever its shape, classified by its code (a 502 when it has none). Before, the first raised and the second was a success the request cache kept. Text to speech no longer returns such a body as audio. - A failure row’s
metadata.error_reasonwith content capture off is the whole reason when it holds no text ({:api_error, 500}), else its tag, for every verb. - Retry and limiter options are checked: a
retry:setting that is not a positive integer is its default (with a warning), andconcurrency: [wait: :infinity]waits for a slot. - A
user_uuid:that is not a uuid has no per-user spend cap, as it already had no per-user task limit. The endpoint and site caps apply. - Translations: 191 Estonian and Russian corrections against one glossary (
dev_docs/guides/translation-glossary.md). The endpoint form’s parameter labels, placeholders and badges, the voice languages and the permission description are now translated, counts take their plural forms, and a few English texts are clearer (“The check found changes”, “Who is notified”).
Fixed
- A stored API key with a stray character no longer reaches the log, a flash or a usage row. The client’s error held the whole
Authorizationheader and was logged and stored as it was; a key pasted with a trailing newline or space is also trimmed now. Likewise a truncated answer no longer reaches the log or the row with content capture off, and is not retried and paid again. - A usage row is written whatever the call carried. A NUL character in a message or an answer, or a
model:longer than the column, made PostgreSQL refuse the row: the caller got a raise after the provider was paid (or, withrequest_log_mode: :async, the row was lost and the caps never counted the call). Labels are cut to fit, NUL characters dropped, and a database error while writing a row is logged instead of raised. - Spend caps: a refusal just before midnight no longer takes the next month’s (or day’s) one notice; a visitor id no longer reads as a database outage after every call; a failed read no longer makes a warning fire again for a crossing already warned about; a node warns for each month’s crossing; of the callers finding the month’s sum expired only one scans, and a slow scan no longer replaces a newer sum; a cap not migrated yet stops a vision batch whose items carry their own options.
retry: [max_attempts: nil]no longer retries for ever,concurrency: [wait: :infinity]no longer leaves a slot taken, andmodel: ""is no model on the vision and image verbs, as on chat. The endpoint cache no longer raises when it restarts during a lookup.- The Playground’s chat no longer holds the page while the model answers, and its log lines no longer carry what was typed (a realtime event) or a task’s arguments (an exit). Dictate’s and the endpoint form’s exit lines now say which exception it was.
AI 0.29.0. Install or update: {:phoenix_kit_ai, "~> 0.29"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.