Scriptable iPad app: OpenAI call returns “No question generated” and Dictation always fails with “Recognizing the audio failed”

I’m building a daily reminiscence app for my grandfather on iPad using Scriptable. It:

  1. Loads a simple JSON profile
  2. Calls the OpenAI Chat API to generate a gentle question
  3. Presents it via Alert + Speech
  4. Uses Dictation.start() to capture his spoken answer
  5. Writes both Q&A into a local JSON log

Most of the code is working, but I keep hitting two errors in my Console log:


Console log
2025-05-10 17:17:15: Reminiscence app starting: 5:17:15 PM
2025-05-10 17:17:15: Generating question…
2025-05-10 17:17:16: OpenAI API Error: Error: No question generated
2025-05-10 17:17:16: Presenting question: Margaret, do you remember any special songs you enjoyed when you were younger?
2025-05-10 17:17:19: Starting dictation…
2025-05-10 17:17:25: Dictation error: Error: Recognizing the audio failed. Please try again.
2025-05-10 17:17:25: Saved conversation entry
2025-05-10 17:17:25: Presenting thanks for response: [No response recorded]


What I’ve tried so far

  • OpenAI “no question generated”
    • Verified OPENAI_API_KEY is set and valid
    • Logged out the raw response from https://api.openai.com/v1/chat/completions
    • Fallback to hard-coded questions works if I disable useOpenAI
  • Dictation error
    • Confirmed Scriptable has microphone permission
    • Tried both FileManager.local() and FileManager.iCloud() (for writing)
    • Wrapped await Dictation.start() in try/catch

My two big questions are

  1. OpenAI: Why does my call sometimes throw “No question generated”? Is my request payload malformed, or is Scriptable handling the JSON response incorrectly?
  2. Dictation: What steps are required to get reliable speech-to-text in Scriptable? The prompt appears, but Dictation.start() always fails with “Recognizing the audio failed.”

Any pointers on how to debug these two errors (or better patterns for calling OpenAI + Dictation in Scriptable) would be hugely appreciated. Thank you!