Skip to content

Limits & Quotas ​

Rate limits, quotas, and resource constraints for Go Bananas!.

Rate Limits ​

Default Limits ​

ResourceLimitWindow
API requests60Per minute
Image generations30Per minute
Uploads20Per minute
OAuth token endpoint30Per minute per IP

OAuth Rate Limiting ​

OAuth Rate Limiting Flow

Rate limiting by endpoint type and IP identification

The /oauth/token endpoint has stricter rate limiting to prevent brute force attacks:

  • 30 requests per minute per IP address
  • Uses cf-connecting-ip header for IP identification
  • Returns 429 Too Many Requests when exceeded

Admin API IP Detection ​

The Admin API uses only the cf-connecting-ip header for rate limiting to prevent X-Forwarded-For spoofing attacks. This ensures accurate rate limiting even when behind proxies.

Rate Limit Headers ​

Responses include rate limit information:

http
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705312800

Rate Limit Response ​

When exceeded:

http
HTTP/1.1 429 Too Many Requests
Retry-After: 30

{
  "error": "Rate limit exceeded. Try again in 30 seconds.",
  "retryAfter": 30
}

Custom Limits ​

Per-tenant limits can be configured:

bash
curl -X PATCH /admin/tenants/{id} \
  -H "Authorization: Bearer <admin_session_token>" \
  -H "Content-Type: application/json" \
  -d '{"rate_limit_per_minute": 120}'

Storage Quotas ​

Default Quotas ​

ResourceDefaultMax
Monthly storage10 GBConfigurable
Images per session1,000None
Total imagesUnlimitedStorage-based

Quota Tracking ​

Check usage:

bash
curl https://gobananasai.com/api/usage \
  -H "X-API-Key: sk_live_xxx"

Response:

json
{
  "data": {
    "months": [
      {
        "month": "2024-01",
        "total_operations": 1523,
        "total_images": 2891,
        "total_bytes": 3019898880,
        "total_mb": 2880,
        "avg_duration_ms": 3421
      }
    ],
    "recent": { "bytes": 93323264, "images": 89 },
    "quota": {
      "monthlyQuotaMb": 10240,
      "monthlyUsedMb": 2880,
      "monthlyRemainingMb": 7360,
      "rateLimitPerMinute": 60
    }
  }
}

Quota Exceeded ​

When quota is exceeded:

http
HTTP/1.1 402 Payment Required

{
  "error": "Monthly storage quota exceeded",
  "code": "QUOTA_EXCEEDED"
}

Image Limits ​

Generation Limits ​

ParameterFlashPro
Prompt length8,192 chars16,384 chars
Images per request44
Character reference images45
Min reference image size512x512 px512x512 px

File Limits ​

ParameterLimit
Max upload size20 MB
Minimum valid dimensions1 × 1 px
Max total upload pixels4,194,304 (about 4.2 MP; equivalent to 2048 × 2048)
Supported upload formatsPNG, JPEG, WebP, single-frame GIF

Wider images are allowed within the total-pixel limit. Resize larger uploads first; export animated GIFs as one frame. These are upload limits, not generation-resolution limits. The server validates actual encoded contents before saving.

Scene reference URL imports ​

Scene creation and updates allow at most 20 combined existing references and new URLs. URL imports have a 20 MiB aggregate encoded-byte limit per request, in addition to the per-image upload limits above. All URLs are fetched and validated before any image is saved; an invalid later image rejects the import without saving earlier ones. This prevalidation buffers at most the aggregate allowance and does not refetch URLs for storage.

Storage, quota or database failures after validation can still leave an earlier imported image saved. The import is not a transaction across all images; inspect retained images before retrying after such a failure. Split larger imports into smaller requests.

Storage Limits ​

ParameterLimit
Thumbnail size200 × 200 px
R2 object key1024 chars
Metadata fields64 KB total

Text Limits ​

Input Limits ​

FieldMinMax
Prompt116,384 chars
Negative prompt01,024 chars
System instruction0512 chars
Character name1100 chars
Character base prompt102,000 chars
Product name1100 chars
Style preset name1128 chars
Session ID1200 chars
Search query1200 chars

Description Limits ​

FieldMax
Character description500 chars
Product description500 chars
API key label100 chars
Tags (each)50 chars

Collection Limits ​

Array Limits ​

CollectionMax Items
Images per request4
Character reference images (Flash)4
Character reference images (Pro)5
Characters per scene5
Multi-char total ref images (Flash)4
Multi-char total ref images (Pro)5
Tags per character20
Bulk delete IDs20
Search results200

Pagination Limits ​

ParameterDefaultMax
List limit50200
Search limit1550
History limit50200

API Key Limits ​

Per Tenant ​

ResourceLimit
API keys10
Active keys10

Key Format ​

TypeFormat
Live keysk_live_ + 32 chars
Test keysk_test_ + 32 chars

Session Limits ​

Session Constraints ​

ParameterLimit
Session ID length200 chars
Images per session1,000
Session lifetimeIndefinite

Database Limits ​

D1 Constraints ​

ParameterLimit
Row size1 MB
Query result10 MB
Batch size1,000 statements
Database sizePlan-dependent

Index Limits ​

TableIndexes
images5
characters3
sessions2

Cloudflare Limits ​

Workers ​

ResourceFreePaid
Requests/day100,00010M+
CPU time10ms30s
Memory128 MB128 MB

D1 ​

ResourceFreePaid
Storage5 GB10+ GB
Reads/day5M25B
Writes/day100K50M

R2 ​

ResourceFreePaid
Storage10 GBPay per use
Class A ops1M/monthPay per use
Class B ops10M/monthPay per use

KV ​

ResourceFreePaid
Reads/day100K10M+
Writes/day1K1M+
Storage1 GB10+ GB

Provider Limits ​

Provider limits stack on top of the Go Bananas! tenant limits — your own quota is whichever the provider enforces, applied per tenant API key.

Gemini Rate Limits ​

TierRPMTPM
Free1532K
Pay-as-you-go10004M
EnterpriseCustomCustom

RPM = Requests per minute, TPM = Tokens per minute. See Gemini API Pricing.

Gemini Content Limits ​

ParameterLimit
Prompt16,384 chars (Flash + Pro)
Reference images14 (6 high-fidelity on Pro)
OutputPNG only

OpenAI gpt-image-2 Limits ​

ParameterLimit
Prompt32,000 chars
Reference images16 (routed via /v1/images/edits)
Max edge3,840px (both edges multiples of 16)
Aspect ratio capLong-to-short ≤3:1
Pixel range655,360 – 8,294,400
Output formatsPNG, JPEG, WebP (with output_compression)
Quality tierslow / medium / high / auto
Default request timeout240s

OpenAI rate limits depend on your account tier and Organization Verification status; gpt-image-2 specifically requires Organization Verification. See OpenAI Rate Limits.

Increasing Limits ​

Tenant Limits ​

Contact admin to increase:

bash
# Increase rate limit
curl -X PATCH /admin/tenants/{id} \
  -H "Authorization: Bearer <admin_session_token>" \
  -H "Content-Type: application/json" \
  -d '{"rate_limit_per_minute": 120}'

# Increase quota
curl -X PATCH /admin/tenants/{id} \
  -H "Authorization: Bearer <admin_session_token>" \
  -H "Content-Type: application/json" \
  -d '{"monthly_quota_mb": 20480}'

Cloudflare Limits ​

Upgrade to paid plans for higher limits:

Provider Limits ​

  • Gemini API Pricing — request quota increases in Google Cloud Console
  • OpenAI Rate Limits — request increases via the OpenAI dashboard; gpt-image-2 requires Organization Verification

Next Steps ​

Released under the MIT License.