Quickstart

Create your first Buble API generation task in a few requests.

Quickstart

This guide creates a text-to-image task, then polls the result.

1. Set your API key

export BUBLE_API_KEY="sk_your_api_key"

Use API keys only on the server side. Do not expose them in browser code.

2. List available models

curl https://buble.ai/api/v1/models \
  -H "Authorization: Bearer $BUBLE_API_KEY"

Pick a model and one of its operations[].mode values.

3. Create a text-to-image generation

curl https://buble.ai/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-pro",
    "mode": "text_to_image",
    "prompt": "A premium product photo of a matte black wireless speaker on a marble table, cinematic studio lighting",
    "aspect_ratio": "1:1",
    "resolution": "1K",
    "output_format": "png"
  }'

The response contains a generation id.

4. Poll the task

curl https://buble.ai/api/v1/generations/YOUR_GENERATION_ID \
  -H "Authorization: Bearer $BUBLE_API_KEY"

Continue polling until data.status becomes success or failed.

5. Use uploaded files when needed

For image-to-image or image-to-video workflows, upload the source file first:

curl https://buble.ai/api/v1/files \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -F "file=@./reference.png" \
  -F "file_type=image" \
  -F "model=google/nano-banana-pro" \
  -F "mode=image_to_image"

Then pass the returned data.url to image_urls, start_frame, or another input field supported by the selected mode.