{"record":{"id":"c7a78724484e12cb","repo":"vercel/ai","slug":"google-video-generation-error","errorCode":"GOOGLE_VIDEO_GENERATION_ERROR","errorMessage":"No videos in response. Response: ${JSON.stringify(finalOperation)}","messagePattern":"No videos in response\\. Response: (.+?)","errorType":"error_code","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/google/src/google-video-model.ts","lineNumber":288,"sourceCode":"    warnings: SharedV4Warning[],\n    currentDate: Date,\n  ): Promise<{\n    status: 'completed';\n    videos: Array<{ type: 'url'; url: string; mediaType: string }>;\n    warnings: SharedV4Warning[];\n    providerMetadata: SharedV4ProviderMetadata;\n    response: {\n      timestamp: Date;\n      modelId: string;\n      headers: Record<string, string> | undefined;\n    };\n  }> {\n    const response = finalOperation.response;\n    if (\n      !response?.generateVideoResponse?.generatedSamples ||\n      response.generateVideoResponse.generatedSamples.length === 0\n    ) {\n      throw new AISDKError({\n        name: 'GOOGLE_VIDEO_GENERATION_ERROR',\n        message: `No videos in response. Response: ${JSON.stringify(finalOperation)}`,\n      });\n    }\n\n    const videos: Array<{ type: 'url'; url: string; mediaType: string }> = [];\n    const videoMetadata: Array<{ uri: string }> = [];\n\n    // Get API key from headers to append to download URLs\n    const resolvedHeaders = await resolve(this.config.headers);\n    const apiKey = resolvedHeaders?.['x-goog-api-key'];\n\n    for (const generatedSample of response.generateVideoResponse\n      .generatedSamples) {\n      if (generatedSample.video?.uri) {\n        // Append the API key to the download URL for authentication, but only\n        // when the response-supplied URI stays on the provider's own origin —\n        // otherwise the key would leak to whatever host the response names.","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/google/src/google-video-model.ts#L270-L306","documentation":"When a Google Veo video generation operation reaches a completed state but its response contains no generateVideoResponse.generatedSamples, buildCompletedResult throws GOOGLE_VIDEO_GENERATION_ERROR with the full serialized operation for debugging. It indicates the API reported completion without producing any video samples.","triggerScenarios":"Polling a Veo video operation via doStatus where the completed operation's response lacks generatedSamples or has an empty array — e.g. generation rejected/filtered server-side or an unexpected API response shape.","commonSituations":"Prompt blocked by safety filters so no samples are returned; API response schema changes from Google; model returns status=done with no output.","solutions":["Inspect the JSON in the error message for failure reasons (e.g. safety/filtered flags) and adjust the prompt","Check the operation's error/filtered fields returned by the Veo API and surface them to the user","Update @ai-sdk/google in case the Veo response schema handling changed","Retry generation with a modified prompt or different model/settings"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// after polling, before consuming results:\nconst op = /* completed operation */;\nif (!op.response?.generateVideoResponse?.generatedSamples?.length) {\n  // handle 'no samples' case: check filtered/RAI reasons, retry with new prompt\n}","typeGuard":"function hasGeneratedSamples(op: unknown): op is { response: { generateVideoResponse: { generatedSamples: unknown[] } } } {\n  return !!(op as any)?.response?.generateVideoResponse?.generatedSamples?.length;\n}","tryCatchPattern":"try {\n  const result = await generateVideo({ model: google.videoModel('veo-...'), prompt });\n} catch (error) {\n  if (AISDKError.isInstance(error) && error.name === 'GOOGLE_VIDEO_GENERATION_ERROR') {\n    // inspect error.message JSON for failure reasons; adjust prompt or retry\n  }\n  throw error;\n}","preventionTips":["Check the serialized operation in the error message for RAI/safety filtering reasons","Keep @ai-sdk/google updated for Veo response schema changes","Avoid prompts likely to trip safety filters; validate prompts before submission"],"tags":["google","video-generation","api-response","veo"],"backgroundTag":"empty-provider-response","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}