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

# Quickstart

> Create a generation and download the result in two requests.

This walkthrough creates a text-to-image generation with **NanoBanana Pro**, then polls until the image is ready.

<Note>
  You'll need an active API key. See [Authentication](/authentication) to get one.
</Note>

## 1. Create a generation

`POST` to a generation endpoint. A successful call returns `202 Accepted` with a `job_id`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -s -X POST https://bananahub.io/api/v1/text-generations \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "a red panda astronaut floating in a nebula",
      "aspect_ratio": "16:9",
      "resolution": "2K"
    }'
  ```

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

  resp = requests.post(
      "https://bananahub.io/api/v1/text-generations",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={
          "prompt": "a red panda astronaut floating in a nebula",
          "aspect_ratio": "16:9",
          "resolution": "2K",
      },
  )
  job_id = resp.json()["job_id"]
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch("https://bananahub.io/api/v1/text-generations", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "a red panda astronaut floating in a nebula",
      aspect_ratio: "16:9",
      resolution: "2K",
    }),
  });
  const { job_id } = await resp.json();
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "0193a7f2-1c4a-7e0b-9b3a-2f1d8c6e4a55",
  "status": "queued",
  "status_url": "/api/v1/jobs/0193a7f2-1c4a-7e0b-9b3a-2f1d8c6e4a55"
}
```

## 2. Poll until done

Poll `GET /jobs/{job_id}` until `status` is `done` or `failed`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -s https://bananahub.io/api/v1/jobs/$JOB_ID \
    -H "Authorization: Bearer $API_KEY"
  ```

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

  while True:
      job = requests.get(
          f"https://bananahub.io/api/v1/jobs/{job_id}",
          headers={"Authorization": f"Bearer {API_KEY}"},
      ).json()
      if job["status"] in ("done", "failed"):
          break
      time.sleep(2)

  print(job["result"]["image_url"])
  ```

  ```javascript Node.js theme={null}
  let job;
  do {
    await new Promise((r) => setTimeout(r, 2000));
    job = await fetch(`https://bananahub.io/api/v1/jobs/${job_id}`, {
      headers: { Authorization: `Bearer ${API_KEY}` },
    }).then((r) => r.json());
  } while (!["done", "failed"].includes(job.status));

  console.log(job.result.image_url);
  ```
</CodeGroup>

```json Response theme={null}
{
  "job_id": "0193a7f2-1c4a-7e0b-9b3a-2f1d8c6e4a55",
  "status": "done",
  "created_at": "2026-06-11T12:00:00Z",
  "started_at": "2026-06-11T12:00:01Z",
  "finished_at": "2026-06-11T12:00:09Z",
  "result": {
    "image_url": "https://cdn.bananahub.io/results/...?X-Amz-Signature=..."
  },
  "error": null
}
```

<Warning>
  `result.image_url` is a presigned URL valid for **24 hours**, and is regenerated on every poll — always use the freshest value.
</Warning>

## Next steps

<AccordionGroup>
  <Accordion title="Clone your docs locally" icon="copy">
    During the onboarding process, you created a GitHub repository with your docs content if you didn't already have one. You can find a link to this repository in your [dashboard](https://dashboard.mintlify.com).

    To clone the repository locally so that you can make and preview changes to your docs, follow the [Cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) guide in the GitHub docs.
  </Accordion>

  <Accordion title="Start the preview server" icon="rectangle-terminal">
    1. Install the Mintlify CLI: `npm i -g mint`
    2. Navigate to your docs directory and run: `mint dev`
    3. Open `http://localhost:3000` to see your docs live!

    <Tip>
      Your preview updates automatically as you edit files.
    </Tip>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Install our GitHub app" icon="github">
    Install the Mintlify GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app).

    Our GitHub app automatically deploys your changes to your docs site, so you don't need to manage deployments yourself.
  </Accordion>

  <Accordion title="Update your site name and colors" icon="palette">
    For a first change, let's update the name and colors of your docs site.

    1. Open `docs.json` in your editor.
    2. Change the `"name"` field to your project name.
    3. Update the `"colors"` to match your brand.
    4. Save and see your changes instantly at `http://localhost:3000`.

    <Tip>
      Try changing the primary color to see an immediate difference!
    </Tip>
  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="Image-to-image" icon="images" href="/api-reference/nanobanana-pro/image-to-image">
    Transform existing images from URLs.
  </Card>

  <Card title="Webhooks" icon="bell" href="/concepts/webhooks">
    Get notified instead of polling.
  </Card>
</CardGroup>
