Genace

Imagen API is only accessible to billed users at this time. — Gemini API 400 INVALID_ARGUMENT

HTTP 400 INVALID_ARGUMENT Do not retry as-is

The exact error

{"error":{"code":400,"message":"Imagen API is only accessible to billed users at this time.","status":"INVALID_ARGUMENT"}}

This 400 came back from the Gemini API (an API key from Google AI Studio, not a Google Cloud Vertex project) when code asked an Imagen model for an image. The request was well formed. The account behind the key was the problem.

What it means

The message itself says what was wrong: Imagen on the Gemini API was only open to users with billing. In openjourney issue #1, a developer calling ai.models.generateImages with imagen-4.0-generate-preview-06-06 through the JavaScript SDK got this exact payload, with HTTP 400 and status INVALID_ARGUMENT. The issue title sums up the community finding: it only works if Google billing is activated. That conclusion comes from the reporter, not from Google, and the issue was closed without a maintainer reply.

The bigger point today is that Imagen itself is gone from this API. Google’s Imagen page for the Gemini API now says Imagen models are shut down and no longer available in the Gemini API, and tells developers to migrate to Nano Banana. The page gives no shutdown date. So if you still see this string, you are most likely running older code, or reading logs from before the shutdown, and the fix is a migration. Enabling billing would not bring Imagen back to the Gemini API.

Vertex AI (now branded Gemini Enterprise Agent Platform) is a separate surface with a separate status. Google’s Vertex Imagen docs describe the Imagen endpoints as deprecated, list them under “Discontinued endpoints” with gemini-2.5-flash-image as the replacement, and recommend updating before June 30, 2026 to avoid service disruption. Moving an Imagen call from a Gemini API key to Vertex is therefore not a long-term fix either.

How to confirm it’s this

  • HTTP status is 400 and status is INVALID_ARGUMENT.
  • The failing call is an Imagen model name (for example imagen-4.0-generate-preview-06-06) sent through generateImages / generate_images.
  • You authenticate with a Gemini API key. If you authenticate to a Google Cloud project on Vertex AI, this page does not describe your setup.
  • In Google AI Studio, check the project’s billing tier. Google’s billing page says new accounts start on the Free Tier and move to the Paid Tier only after a billing account is linked and set up.

Fix

  1. Migrate off Imagen. Google’s Imagen page gives the migration steps: use gemini-2.5-flash-image (or a Nano Banana 2 model such as gemini-3.1-flash-image) instead of an Imagen model name, call client.models.generate_content instead of client.models.generate_images, and read the image from the returned content parts rather than from an image-specific response object.
  2. Update your response parsing. Code that expects a list of generated images will not match what Nano Banana returns. Check for an image part before decoding anything.
  3. Check billing for the new model too. Google’s billing page describes linking a billing account in AI Studio to reach the Paid Tier. Check Google’s pricing and rate-limit pages for the limits that apply to your image model on your tier, rather than assuming.
  4. Remove the old model name from config and retry lists. An agent that falls back to Imagen on errors will keep hitting a retired model.

Retry or not

No. A 400 INVALID_ARGUMENT about account eligibility is not transient, and the same request will fail the same way. Google’s API errors page pairs its 400 codes with actions such as checking parameters or verifying billing status, not with retrying. On top of that, the model is shut down on this API, so no amount of waiting changes the answer. An agent should fail fast here and report that the image path needs to be migrated.

When it’s not this

  • limit: 0 on a free-tier metric. That is a 429 from a Nano Banana model on a key with no free image allowance. Different status, different fix. See the free-tier quota page below.
  • A billing prerequisite reported as failed_precondition. Google’s API errors page lists that code for the Interactions API, with disabled billing as its example. It is a different code from the gRPC-style INVALID_ARGUMENT quoted above.
  • You are on Vertex AI. The report above is from the Gemini API key path. On Vertex, Imagen quota problems look like the base-model quota error linked below.
  • The model is not found. Google’s API errors page lists a separate 404 model_not_found code. A retired or misspelled model name may surface that way instead.

Error text last verified against the sources below on .

Where these facts come from