> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ruxa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Nano Banana Edit

> Image editing model API based on Gemini 2.5 Flash Image

<Info>
  `google/nano-banana-edit` uses Google's `gemini-2.5-flash-image` model
  internally, supporting image editing and modification through natural language
  descriptions.
</Info>

## Query Task Status

After submitting a task, you can check the task progress and get the generation result through the unified query endpoint:

<Card title="Get Task Details" icon="magnifying-glass" href="/api-reference/common/get-task-detail">
  Learn how to query task status and get generation results
</Card>

<Tip>
  In production environments, it is recommended to use the `callback_url`
  parameter to receive automatic notifications when generation is complete,
  rather than polling the status endpoint.
</Tip>

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer Token authentication. Format: `Bearer sk-xxxxxx`

  <Expandable defaultOpen title="Details">
    * Get API Key: Visit the [API Key Management Page](https://ruxa.ai/dashboard/api-keys) to obtain your API Key

    * Usage: Add `Authorization: Bearer YOUR_API_KEY` to your request headers

    * Important: Keep your API Key secure and never share it with others

    * If you suspect your API Key has been compromised, reset it immediately in the management page
  </Expandable>
</ParamField>

## Request Body

Request body format is `application/json`.

<ParamField body="model" type="string" required default="google/nano-banana-edit">
  Model name, must be `google/nano-banana-edit`
</ParamField>

<ParamField body="callback_url" type="string" required>
  Callback URL for task completion notification. The system will POST task status and results to this URL.

  Example: `https://your-domain.com/api/callback`
</ParamField>

<ParamField body="input" type="object" required>
  Input parameters for the generation task

  <Expandable defaultOpen title="Properties">
    <ParamField body="input.prompt" type="string" required>
      Text prompt for image editing

      <Expandable defaultOpen title="Example">
        ```
        "Change the background to pixel art style"
        ```
      </Expandable>
    </ParamField>

    <ParamField body="input.output_format" type="enum<string>" required default="png">
      Output format for generated image

      Available options: `png`, `jpeg`
    </ParamField>

    <ParamField body="input.image_size" type="enum<string>" required default="1:1">
      Aspect ratio for generated image
    </ParamField>

    <ParamField body="input.image_urls" type="string[]" required>
      Array of original image URLs to edit

      <Expandable defaultOpen title="Example">
        ```json theme={null}
        ["https://example.com/your-image.png"]
        ```
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="code" type="integer" required>
  Response status code

  <Expandable defaultOpen title="Status Codes">
    * `200`: Success - Request processed successfully

    * `401`: Unauthorized - Missing or invalid authentication

    * `402`: Insufficient credits - Not enough credits to execute

    * `404`: Not found - Resource or endpoint does not exist

    * `422`: Validation error - Request parameters invalid

    * `429`: Rate limited - Request frequency limit exceeded

    * `500`: Server error - Unexpected failure during processing
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string" required>
  Response message, error description when request fails
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable defaultOpen title="Properties">
    <ResponseField name="data.taskId" type="string" required>
      Task ID for querying task status
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.ruxa.ai/api/v1/tasks/create \
    --header 'Authorization: Bearer sk-xxxxxx' \
    --header 'Content-Type: application/json' \
    --data '{
      "callback_url": "https://your-domain.com/api/callback",
      "input": {
        "prompt": "Change the background to pixel art style",
        "output_format": "png",
        "image_size": "1:1",
        "image_urls": ["https://example.com/your-image.png"]
      },
      "model": "google/nano-banana-edit"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "message": "success",
    "data": {
      "taskId": "task_gemini-2.5-flash-image_1766304530229_cf4dafd2"
    }
  }
  ```
</ResponseExample>
