{"record":{"id":"12333528768028e0","repo":"vercel/ai","slug":"non-streaming-transcription-with-this-modelid-123335","errorCode":null,"errorMessage":"non-streaming transcription with ${this.modelId}","messagePattern":"non-streaming transcription with (.+?)","errorType":"exception","errorClass":"UnsupportedFunctionalityError","httpStatus":null,"severity":"error","filePath":"packages/openai/src/transcription/openai-transcription-model.ts","lineNumber":241,"sourceCode":"            }\n          } else {\n            formData.append(key, String(value));\n          }\n        }\n      }\n    }\n\n    return {\n      formData,\n      warnings,\n    };\n  }\n\n  async doGenerate(\n    options: OpenAITranscriptionCallOptions,\n  ): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>> {\n    if (isRealtimeTranscriptionModelId(this.modelId)) {\n      throw new UnsupportedFunctionalityError({\n        functionality: `non-streaming transcription with ${this.modelId}`,\n      });\n    }\n\n    const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n    const { formData, warnings } = await this.getArgs(options);\n\n    const {\n      value: response,\n      responseHeaders,\n      rawValue: rawResponse,\n    } = await postFormDataToApi({\n      url: this.config.url({\n        path: '/audio/transcriptions',\n        modelId: this.modelId,\n      }),\n      headers: combineHeaders(this.config.headers?.(), options.headers),\n      formData,","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/openai/src/transcription/openai-transcription-model.ts#L223-L259","documentation":"Realtime transcription models (detected via isRealtimeTranscriptionModelId, e.g. gpt-4o-transcribe realtime variants) only support streaming output. Calling doGenerate on OpenAITranscriptionModel with such a model id throws UnsupportedFunctionalityError because there is no non-streaming REST endpoint for it.","triggerScenarios":"Calling generateText-style transcription (transcribe(...)/doGenerate) with a realtime transcription model id; switching a model id string from a REST transcription model to a realtime one without changing the call to its streaming API.","commonSituations":"Swapping model ids in config (e.g. 'whisper-1' -> realtime model) while keeping the non-streaming transcribe() call; templated pipelines that always use doGenerate; misunderstanding that realtime models can also do one-shot transcription.","solutions":["Use the streaming API (streamTranscription/doStream) with realtime transcription models","Switch the model id to a REST-supported transcription model (e.g. whisper-1, gpt-4o-transcribe) for non-streaming use","Branch your code on the model id to select the right call style"],"exampleFix":"// before\nawait transcribe({ model: openai.transcription('gpt-4o-mini-transcribe-realtime'), audio })\n// after\nconst result = streamTranscribe({ model: openai.transcription('gpt-4o-mini-transcribe-realtime'), audio })","handlingStrategy":"type-guard","validationCode":"import { isRealtimeTranscriptionModelId } from '@ai-sdk/openai'; // or local copy\nif (isRealtimeTranscriptionModelId(modelId)) {\n  // use streaming API instead of transcribe()\n}","typeGuard":"function supportsNonStreamingTranscription(modelId: string): boolean {\n  return !isRealtimeTranscriptionModelId(modelId);\n}","tryCatchPattern":"try {\n  result = await transcribe({ model, audio });\n} catch (e) {\n  if (UnsupportedFunctionalityError.isInstance(e) && e.message.includes('non-streaming transcription')) {\n    // switch to the streaming transcription API for this model\n  } else throw e;\n}","preventionTips":["Keep a mapping of which transcription models support REST vs realtime","Route realtime model ids to streamTranscribe in your abstraction layer","Read the model's provider docs before switching model ids in shared config"],"tags":["openai","transcription","realtime","unsupported-functionality","streaming"],"backgroundTag":"realtime-model-nonstreaming-unsupported","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}