{"record":{"id":"6626fe2d5e3d5b75","repo":"vercel/ai","slug":"google-vertex-transcription-models-do-not-support","errorCode":null,"errorMessage":"Google Vertex transcription models do not support Express Mode API keys. Use standard Google Cloud credentials instead.","messagePattern":"Google Vertex transcription models do not support Express Mode API keys\\. Use standard Google Cloud credentials instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/google-vertex/src/google-vertex-provider-base.ts","lineNumber":365,"sourceCode":"\n      const config = createConfig('speech');\n      return new GoogleVertexCloudTTSSpeechModel(modelId, {\n        provider: config.provider,\n        headers: config.headers,\n        fetch: config.fetch,\n      });\n    }\n\n    return new GoogleSpeechModel(modelId, createConfig('speech'));\n  };\n\n  // Cloud Speech-to-Text reuses the Vertex auth headers from createConfig, but\n  // targets the Speech-to-Text API.\n  const createTranscriptionModel = (\n    modelId: GoogleVertexTranscriptionModelId,\n  ) => {\n    if (apiKey) {\n      throw new Error(\n        'Google Vertex transcription models do not support Express Mode API keys. Use standard Google Cloud credentials instead.',\n      );\n    }\n\n    const config = createConfig('transcription');\n\n    // Gemini transcription models (`gemini-3.5-transcribe[-live]`) use the\n    // Vertex generateContent / Live API surfaces; everything else routes to\n    // Cloud Speech-to-Text (Chirp, telephony).\n    if (modelId.startsWith('gemini')) {\n      return new GoogleVertexGeminiTranscriptionModel(modelId, {\n        provider: config.provider,\n        baseURL: loadBaseURL(),\n        headers: config.headers,\n        fetch: config.fetch,\n        webSocket: options.webSocket,\n        project: loadGoogleVertexProject(),\n        location: loadGoogleVertexLocation(),","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/google-vertex/src/google-vertex-provider-base.ts#L347-L383","documentation":"createTranscriptionModel throws this Error whenever any transcription model is created while Express Mode API-key auth is configured. Vertex Cloud Speech-to-Text reuses Vertex auth headers but targets the Speech-to-Text API, which does not support Express Mode keys, so the provider throws unconditionally when apiKey is set.","triggerScenarios":"vertex.transcription('<model>') while the provider was built with `apiKey` (createGoogleVertex({ apiKey }) or GOOGLE_VERTEX_API_KEY in env) — the unconditional `if (apiKey)` throws.","commonSituations":"Adding transcription to a prototype set up with an Express Mode key; environments where GOOGLE_VERTEX_API_KEY is set globally and also used by the transcription pipeline; migration from the plain Google Speech API where API keys are accepted.","solutions":["Remove the apiKey and authenticate via service account (GOOGLE_APPLICATION_CREDENTIALS) or workload identity.","Unset GOOGLE_VERTEX_API_KEY in the process environment.","Route transcription through a provider instance configured with standard GCP credentials."],"exampleFix":"// before\nconst vertex = createGoogleVertex({ apiKey: key });\nconst stt = vertex.transcription('chirp-3');\n// after\nconst vertex = createGoogleVertex({ project: 'my-project', location: 'us-central1' });\nconst stt = vertex.transcription('chirp-3');","handlingStrategy":"validation","validationCode":"if (apiKey && wantsTranscription) {\n  throw new Error('Vertex transcription requires standard Google Cloud credentials, not an API key.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const model = vertex.transcription(modelId);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('transcription models do not support Express Mode')) {\n    // rebuild provider with ADC/service-account credentials\n  } else throw e;\n}","preventionTips":["Verify at app bootstrap that no GOOGLE_VERTEX_API_KEY is set when transcription is a feature.","Use GOOGLE_APPLICATION_CREDENTIALS / workload identity for Vertex Speech-to-Text."],"tags":["authentication","google-vertex","express-mode","transcription"],"backgroundTag":"incompatible-auth-method","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}