From Vertex AI (Gemini image)
Move Gemini 2.5 Flash Image calls from Vertex AI generateContent to RawFrame.
On Vertex AI, Gemini image generation is a synchronous generateContent call that returns the image as
base64 in the response. On RawFrame it's a generation like any other: create it, wait a few
seconds, and download the image from a signed URL.
What changes
- No Google Cloud setup. No project, no enabled API, no service account or access tokens: one API key.
- Asynchronous by design.
POST /v1/generationsreturns immediately. Use the SDK'screateAndWait/create_and_waitto keep the synchronous feel. - Files, not base64. Outputs are stored for you and returned as signed links, so responses stay small.
- One request shape for this and every other image model.
Requests
Vertex AI generateContent | RawFrame |
|---|---|
POST .../publishers/google/models/gemini-2.5-flash-image:generateContent | POST https://api.rawframe.dev/v1/generations with model: "google/gemini-2.5-flash-image" |
| Google OAuth access token | Authorization: Bearer <API key> |
contents[].parts[] { "text": ... } | prompt |
contents[].parts[] { "inlineData": { "mimeType", "data" } } | an upload in references, role source_image to edit it or reference_image to guide the result |
generationConfig.imageConfig.aspectRatio | params.aspect_ratio |
generationConfig.seed | params.seed |
generationConfig.responseModalities | Not needed: we always ask for an image. |
| Other request fields | provider_options, passed through as is |
Responses
| Vertex AI | RawFrame |
|---|---|
candidates[0].content.parts[].inlineData.data (base64) | outputs[0].url: download it |
inlineData.mimeType | outputs[0].content_type |
finishReason such as SAFETY, or promptFeedback.blockReason | status: "failed" with error.code: "content_rejected", not charged |
Before and after
import { RawFrame } from "@rawframe/sdk";
const rf = new RawFrame();
const image = await rf.generations.createAndWait({
model: "google/gemini-2.5-flash-image",
prompt: "A ceramic coffee cup on a sunlit wooden table, product photo",
params: { aspect_ratio: "1:1" },
});
const png = await (await fetch(image.outputs![0]!.url)).arrayBuffer();