Skip to content

Bug: Google Generative AI SDK appears to use only :predict endpoint for image generation #10674

@omarmaharem

Description

@omarmaharem

Description

API Route:

// Generate promise
  const generatePromise = generateImage({
    model: google.image("gemini-2.5-flash-image"),
    prompt,
    size: DEFAULT_IMAGE_SIZE,
  })

Error:

{
  "error": {
    "code": 404,
    "message": "models/gemini-2.5-flash-image-preview is not found for API version v1beta, or is not supported for predict. Call ListModels to see the list of available models and their supported methods.",
    "status": "NOT_FOUND"
  }
}

Where is the problem:

node_modules/.pnpm/@ai-sdk+google@2.0.44_zod@4.1.13/node_modules/@ai-sdk/google/dist/index.js
at line 1666

  url: `${this.config.baseURL}/models/${this.modelId}:predict`,

AI SDK Version

"ai": "^5.0.104",
"@ai-sdk/google": "^2.0.44",
"@ai-sdk/react": "^2.0.104",

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelprovider/black-forest-labsIssues related to the @ai-sdk/black-forst-labs provider. https://bfl.aisupport

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions