Skip to content

{"error":{"code":429,"message":"Resource has been exhausted (e.g. check quota).","status":"RESOURCE_EXHAUSTED"}} #1841

Description

@oojr

I am on a paid tier and I am getting resource exhausted trying to analyze a single image, text generations work with the same api

Environment details

  • Programming language: Javascript
  • OS: Mac M1
  • Language runtime version: NodeJS 24.15.0
  • Package version: 2.16.0

Steps to reproduce

const {
  GoogleGenAI,
  createUserContent,
  createPartFromUri,
} = require("@google/genai");

const GEMINI_API_TOKEN =
  process.env.GEMINI_API_KEY;

const ai = new GoogleGenAI({ apiKey: GEMINI_API_TOKEN });

async function runTest(imageUrl, mimeType = "image/jpeg") {
  const parts = [
    "Describe this receipt in one sentence.",
    createPartFromUri(imageUrl, mimeType),
  ];

  try {
    const result = await ai.models.generateContent({
      model: "gemini-3.5-flash-lite",
      contents: createUserContent(parts),
    });

    console.log(result.text);
    return result.text;
  } catch (error) {
    console.error("[auditReceiptImage Error]", error);
    throw error;
  }
}

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions