Yomi APIYomi APIDocs Open console

中文

Yomi API / Documentation / Nano Banana generation and editing

Media generation

Nano Banana generation and editing

Nano Banana is an image generation and editing model family based on Google's Gemini image capabilities (an industry model). Check the Model Catalog (Models in the console) for current availability and exact model IDs. The examples below illustrate only the request format.

Models and capabilities

  • Model ID: Use an available image-generation model from the Model Catalog (the examples use your-image-model-id as a placeholder).
  • Resolution: Supports 1K, 2K and 4K output.
  • Aspect ratio: Supports 10 aspect ratios. OpenAI-compatible mode defaults to 1:1, adjustable with the size parameter.
  • Strengths: Complex instruction understanding, high-quality text rendering and precise local editing.
  • Calling methods: The OpenAI-compatible Images API (shown here), or the native Gemini format described in Gemini native format.

Image generation

This endpoint is compatible with the OpenAI Images API and uses the standard parameters model, prompt, n, size.

POST https://api.yomiapi.com/v1/images/generations

Python example

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.yomiapi.com/v1"
)

response = client.images.generate(
    model="your-image-model-id",
    prompt="A Japanese cafe in the early morning, a cup of latte art by the window, soft natural light, a film-like texture",
    n=1,
    size="1024x1024"
)
print(response.data[0].url)

cURL example

curl https://api.yomiapi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-image-model-id",
    "prompt": "A Japanese cafe in the early morning, a cup of latte art by the window, soft natural light, a film-like texture",
    "n": 1,
    "size": "1024x1024"
  }'

Image editing

The editing endpoint modifies a source image according to a prompt, supporting:

  • Local edits: Precisely control the edited area while leaving the rest unchanged.
  • Angle changes: Change the viewpoint and camera angle.
  • Focus control: Adjust depth of field and the focus position.
  • Color adjustments: Modify hue, saturation and brightness.
  • Lighting adjustments: Change light direction and intensity.
POST https://api.yomiapi.com/v1/images/edits

Python example

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.yomiapi.com/v1"
)

response = client.images.edit(
    model="your-image-model-id",
    image=open("input.png", "rb"),
    prompt="Replace the background with a seaside scene at dusk, preserving the pose and lighting relationships of the person"
)
print(response.data[0].url)

Billing and cost

Image generation is a media capability. Billing methods and unit prices depend on the Model Catalog and actual charges shown under Usage.

Recommendations

  • Specify the subject, style and composition. For text inside an image, provide the exact text and its placement.
  • Describe one change at a time for editing. Several small edits are easier to control than one major rewrite.
  • High-resolution output takes longer. For batch tasks, first validate the prompt with the fast version, then generate with the standard version.