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

# Nano Banana 2 — Text to Image

> Generate images from text prompts using Google's Nano Banana 2 model

Generate images from text descriptions with Google's Nano Banana 2 model. Supports multiple aspect ratios and resolution tiers.

| Property            | Value                                 |
| ------------------- | ------------------------------------- |
| **Provider**        | Google                                |
| **Model**           | Nano Banana 2                         |
| **Capability**      | Text to Image                         |
| **Base Cost**       | 134,000 micro-cents/request (\$0.134) |
| **Processing Time** | \~30 seconds                          |

## Request Body

<ParamField body="model" type="string" required placeholder="google/nano-banana-2/text-to-image">
  Model slug. Use `google/nano-banana-2/text-to-image` for text-to-image generation.
</ParamField>

<ParamField body="input" type="object" required>
  Input parameters for text-to-image generation.

  <Expandable title="properties" defaultOpen>
    <ParamField body="prompt" type="string" required>
      Text description of the image to generate. Max length: 5,000 characters.
    </ParamField>

    <ParamField body="aspect_ratio" type="string">
      Output aspect ratio. Default: `9:16`. Options: `9:16`, `16:9`, `1:1`, `2:3`, `3:2`, `4:3`, `3:4`, `4:5`, `5:4`, `21:9`.
    </ParamField>

    <ParamField body="resolution" type="string">
      Output resolution. Default: `1k`. Options: `1k`, `2k`, `4k`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="webhookUrl" type="string">
  HTTPS URL to receive a webhook notification when the job completes or fails.
</ParamField>

## Pricing

**Base cost:** 134,000 micro-cents per request (\$0.134)

```
finalCost = baseCost × resolution
```

| Factor         | Option | Multiplier |
| -------------- | ------ | ---------- |
| **Resolution** | `1k`   | 1x         |
|                | `2k`   | 1x         |
|                | `4k`   | 1.8x       |

<Tip>
  **Default cost:** 1k resolution = 134,000 × 1 = **134,000 micro-cents (\$0.134)**

  **4k cost:** 134,000 × 1.8 = **241,200 micro-cents (\$0.2412)**
</Tip>

## Response

<ResponseField name="jobId" type="string">
  Unique identifier for the submitted job.
</ResponseField>

<ResponseField name="status" type="string">
  Initial job status. Always `"pending"` on successful submission.
</ResponseField>

<ResponseField name="estimatedCompletionTime" type="string">
  ISO 8601 timestamp of the estimated completion time.
</ResponseField>

<ResponseField name="costMicroCents" type="number">
  The cost of the job in micro-cents.
</ResponseField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.muvi.video/v1/jobs/submit \
    -H "Authorization: Bearer $PIXELBYTE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "google/nano-banana-2/text-to-image",
      "input": {
        "prompt": "A futuristic cityscape at sunset with flying cars",
        "aspect_ratio": "16:9",
        "resolution": "2k"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.muvi.video/v1/jobs/submit",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "model": "google/nano-banana-2/text-to-image",
          "input": {
              "prompt": "A futuristic cityscape at sunset with flying cars",
              "aspect_ratio": "16:9",
              "resolution": "2k"
          }
      }
  )

  data = response.json()
  print(data)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.muvi.video/v1/jobs/submit", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "google/nano-banana-2/text-to-image",
      input: {
        prompt: "A futuristic cityscape at sunset with flying cars",
        aspect_ratio: "16:9",
        resolution: "2k"
      }
    })
  });

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>
