Skip to main content
This walkthrough creates a text-to-image generation with NanoBanana Pro, then polls until the image is ready.
You’ll need an active API key. See Authentication to get one.

1. Create a generation

POST to a generation endpoint. A successful call returns 202 Accepted with a job_id.
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"
  }'
Response
{
  "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.
curl -s https://bananahub.io/api/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer $API_KEY"
Response
{
  "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
}
result.image_url is a presigned URL valid for 24 hours, and is regenerated on every poll — always use the freshest value.

Next steps

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.To clone the repository locally so that you can make and preview changes to your docs, follow the Cloning a repository guide in the GitHub docs.
  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!
Your preview updates automatically as you edit files.
Install the Mintlify GitHub app from your dashboard.Our GitHub app automatically deploys your changes to your docs site, so you don’t need to manage deployments yourself.
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.
Try changing the primary color to see an immediate difference!

Image-to-image

Transform existing images from URLs.

Webhooks

Get notified instead of polling.