How can I edit an image using `gemini-3-pro-image` with AI Gateway?

I have been seeing the doc and I had only find the below example. Someone knows how to get it?

import { generateText } from 'ai';
import 'dotenv/config';
 
async function main() {
  const result = await generateText({
    model: 'google/gemini-3-pro-image',
    prompt: `Create a detailed illustration of a turquoise-throated puffleg hummingbird resting on a branch covered with dew at sunrise`,
  });
 
  // Print any text response from the model
  if (result.text) {
    console.log(result.text);
  }
 
  // Images are available in result.files
  console.log(`Generated ${result.files.length} image(s)`);
  console.log('Usage:', JSON.stringify(result.usage, null, 2));
}
 
main().catch(console.error);

Can you tell us more about what you’re trying to do and what’s not working the way you expect?

This other post has some suggestions about what kind of info is helpful to share:

Hey @lusrodri! :blush: Just wanted to check in and see if you still need help with editing an image using gemini-3-pro-image. If you’ve found a solution or if there’s anything specific that’s still unclear, let’s figure this out together!