Skip to documentation
On this page

Nano Banana API

Generate one image asynchronously per request. Supports text-to-image and image-to-image generation with your Seevio API key.

POST https://api.seevio.ai/v1/images/generations

Capabilities

FeatureSupported values
Generation modestext-to-image, image-to-image
Output resolutioninput.resolutionNot accepted for this model.
Aspect ratioauto, 1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 5:4, 4:5, 21:9
Reference imagesPublic HTTPS PNG / JPEG / WebP URLs. Image-to-image requires 1–10 images, each up to 10 MB. Text-to-image requires an empty array.
PromptRequired non-empty prompt, up to 5000 characters.
Output formatpng, jpg

Pricing & credits

Each image costs 2 credits, including all supported resolutions and formats. Credits are reserved on acceptance, settled on success and refunded on failure. Generation times out after 30 minutes; refund_failed means refund recovery is pending.

Request idempotency is not supported. Each valid POST creates a new billable task. If a submission outcome is uncertain, query the returned taskId; retrying POST can create another task.

Authentication

Create an API key in the dashboard. The complete key is shown only once. Keep it on your server and send it as a Bearer token on every request.

Base URL

https://api.seevio.ai
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json

Set the SEEVIO_API_KEY environment variable before running these examples. JavaScript examples run on your server with Node.js; Python examples use the requests package.

Request body

FieldTypeRequiredDescription & constraints
model
stringYes

Model ID. To use Nano Banana, set this field to nano-banana.

callback_url
stringNo

Public HTTPS endpoint for completion and failure POST callbacks. Private networks and localhost are not allowed.

Example: https://example.com/webhooks/seevio
input
objectYes

Generation settings. Must contain a non-empty prompt.

Input parameters

FieldTypeRequiredDefaultDescription & constraints
input.prompt
stringYes

Required non-empty prompt, up to 5000 characters.

Example: A minimalist ceramic teapot on a stone pedestal, soft studio lighting
input.generation_type
stringNotext-to-image

For image editing, set generation_type to image-to-image and provide image_urls. All other parameters use the same contract.

Supported values
text-to-image | image-to-image
input.image_urls
string[]Conditional[]

Public HTTPS PNG / JPEG / WebP URLs. Image-to-image requires 1–10 images, each up to 10 MB. Text-to-image requires an empty array.

Example: ["https://example.com/teapot.png"]
input.aspect_ratio
stringNoauto

Aspect ratio

Supported values
auto | 1:1 | 9:16 | 16:9 | 3:4 | 4:3 | 3:2 | 2:3 | 5:4 | 4:5 | 21:9
Example: 1:1
input.resolution
stringNot supported

Not accepted for this model.

input.output_format
stringNopng
Supported values
png | jpg
Example: png

Aspect ratio defaults to auto. Unknown fields, including output quantity, are rejected. Each request generates exactly one image.

Quickstart

Submit this minimal request, save the returned taskId, then use the task query example below. The credits value in the create response is the reserved amount.

curl --fail-with-body https://api.seevio.ai/v1/images/generations \
  -H "Authorization: Bearer $SEEVIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana",
  "input": {
    "prompt": "A minimalist ceramic teapot on a stone pedestal, soft studio lighting",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "generation_type": "text-to-image"
  }
}'

Create task response example

{
  "taskId": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "credits": 2
}

Text to image

Generate one image asynchronously per request. Supports text-to-image and image-to-image generation with your Seevio API key.

curl --fail-with-body https://api.seevio.ai/v1/images/generations \
  -H "Authorization: Bearer $SEEVIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana",
  "input": {
    "prompt": "A minimalist ceramic teapot on a stone pedestal, soft studio lighting",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "generation_type": "text-to-image"
  }
}'

Image to image

For image editing, set generation_type to image-to-image and provide image_urls. All other parameters use the same contract.

Replace example.com media URLs with your own publicly accessible HTTPS files. The sample URLs illustrate the request shape and are not downloadable sample assets.

curl --fail-with-body https://api.seevio.ai/v1/images/generations \
  -H "Authorization: Bearer $SEEVIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana",
  "input": {
    "prompt": "Change the teapot to matte sage green. Preserve its shape and the studio lighting.",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "generation_type": "image-to-image",
    "image_urls": [
      "https://example.com/teapot.png"
    ]
  }
}'

Query a task

GET https://api.seevio.ai/v1/tasks/{taskId}

Replace the example ID with the taskId returned by creation. Queries only return tasks owned by the API key's user; inaccessible or unknown IDs return HTTP 404.

Poll every 10–20 seconds as a starting point, back off on HTTP 429 and stop when the status is completed or failed. Prefer webhooks for production. Each code example below performs one query.

curl --fail-with-body https://api.seevio.ai/v1/tasks/3f2aK9mR7xQp4TnZ8bLc6YwH \
  -H "Authorization: Bearer $SEEVIO_API_KEY"
StatusAllowed values and requirements
queuedAccepted and waiting for submission.
generatingGeneration is in progress.
completedTerminal success. Download data.results before expiry.
failedTerminal failure. Inspect failed_reason and billing_status.
FieldTypeAllowed values and requirements
idstringTask identifier. This is taskId from the create response.
created_atnumberTask creation time as Unix seconds.
modelstringThe public model ID used for this task.
billing_statusstringreserved, charged, refunded or refund_failed.
creditsnumberCredits reserved for this task. This value is retained after a refund; inspect billing_status to determine the billing outcome.
failed_reasonstring | nullFailure reason on failed tasks; null otherwise. Failed query responses omit data.
dataobjectPresent on non-failed task queries. Contains output and processing details.
data.resultsstring[]Image URL array; empty before completion and after expiry.
data.image_expires_atstring | nullImage expiry time in ISO 8601 format, or null until available.
data.processing_timenumber | nullProvider processing duration in seconds when available, otherwise null.

Queued

{
  "id": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "created_at": 1789171200,
  "model": "nano-banana",
  "credits": 2,
  "status": "queued",
  "billing_status": "reserved",
  "failed_reason": null,
  "data": {
    "results": [],
    "image_expires_at": null,
    "processing_time": null
  }
}

Completed

{
  "id": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "created_at": 1789171200,
  "model": "nano-banana",
  "credits": 2,
  "status": "completed",
  "billing_status": "charged",
  "failed_reason": null,
  "data": {
    "results": [
      "https://cdn.seevio.ai/api/images/example.png"
    ],
    "image_expires_at": "2026-10-12T00:00:00.000Z",
    "processing_time": 12
  }
}

Failed

When the query returns status=failed, generation has ended unsuccessfully. Read failed_reason for the cause and billing_status for the refund outcome. In this example, refunded means the credits were returned. credits retains the original reserved amount, and the response does not include data.

{
  "id": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "created_at": 1789171200,
  "model": "nano-banana",
  "credits": 2,
  "status": "failed",
  "billing_status": "refunded",
  "failed_reason": "Image generation failed."
}

Result links are provided for 30 days after storage. After expiry, results is empty.

Webhooks

Set callback_url in the create request to receive a JSON POST when the task completes or fails. Return a 2xx response within 15 seconds. Failed deliveries are retried; process repeated deliveries idempotently by task ID.

Your callback endpoint must accept POST requests with a JSON request body (Content-Type: application/json).

Create a task with a callback

curl --fail-with-body https://api.seevio.ai/v1/images/generations \
  -H "Authorization: Bearer $SEEVIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana",
  "input": {
    "prompt": "A minimalist ceramic teapot on a stone pedestal, soft studio lighting",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "generation_type": "text-to-image"
  },
  "callback_url": "https://example.com/webhooks/seevio"
}'

Callbacks use the task query response structure; refunded failure notifications also include top-level credits_refunded. Use id to identify the task and status to distinguish completed from failed. Notifications may repeat: process them idempotently by id and status. Callbacks are unsigned; verify the task with the authenticated query endpoint. Delivery failure does not refund a successful task.

Task completed: successful callback payload

created_at is the event creation time; task_created_at is the task creation time in Unix seconds. Examples show the recommended fields; responses may contain additional fields.

{
  "id": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "created_at": 1789171212,
  "model": "nano-banana",
  "credits": 2,
  "status": "completed",
  "billing_status": "charged",
  "failed_reason": null,
  "data": {
    "results": [
      "https://cdn.seevio.ai/api/images/example.png"
    ],
    "image_expires_at": "2026-10-12T00:00:00.000Z",
    "processing_time": 12
  },
  "task_created_at": 1789171200
}

Task failed: failure callback payload

{
  "id": "3f2aK9mR7xQp4TnZ8bLc6YwH",
  "created_at": 1789171212,
  "model": "nano-banana",
  "credits": 2,
  "status": "failed",
  "billing_status": "refunded",
  "failed_reason": "Image generation failed.",
  "task_created_at": 1789171200,
  "credits_refunded": 2
}

Receiver example

export async function POST(request: Request) {
  const callbackData = await request.json();

  if (callbackData.status === "completed") {
    const imageUrls = callbackData.data.results;
    // Save the image URLs and mark this task as completed in your application.
    console.log(callbackData.id, imageUrls);
  }

  if (callbackData.status === "failed") {
    const { failed_reason, credits_refunded } = callbackData;
    // Record the failure reason and refunded credits for this task.
    console.error(callbackData.id, failed_reason, credits_refunded);
  }

  return new Response(null, { status: 200 });
}

This Next.js example reads the JSON callback body and handles completed and failed tasks directly. Add persistence and task-ID deduplication for your application; queue slow work before acknowledging the callback.

Errors

HTTP errors have an error object with code and message. A successfully accepted task can still fail later; query the task or handle its failure callback.

{
  "error": {
    "code": "invalid_request",
    "message": "input.prompt is required."
  }
}
HTTPFieldWhat to do
400invalid_request
Fix the JSON, missing prompt, parameter range or media URL before retrying.
401invalid_api_key
Check the Bearer token and whether the API key is active.
402insufficient_credits
Add credits or reduce the task cost. The response may include required and available amounts.
403forbidden
Check the account-level restriction described in the error message.
404not_found
Check the task ID and that the key belongs to the task's user.
429rate_limited
Wait for the Retry-After interval before retrying.
500internal_error
Inspect the error message and API logs. Retry cautiously; resubmitting a create request can create another billable task.

Errors use error.code and error.message: 400 invalid_request, 401 invalid_api_key, 402 insufficient_credits, 403 forbidden, 404 not_found, 429 rate_limited, 500 internal_error. Insufficient provider balance is not a customer 402 error.

Rate limits

Create tasks: each API key allows up to 100 requests per minute by default. Custom rate limits are not currently available.

Query tasks: each API key allows up to 120 requests per minute by default. Query requests and task creation requests are counted separately.

Image and video creation requests share the same API key rate limit.

HTTP 429 includes Retry-After: 60 for creation and Retry-After: 5 for queries. Use backoff and avoid polling more frequently than necessary.

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 60
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded."
  }
}