Limits & Quotas
Rate limits, quotas, and resource constraints for Go Bananas!.
Rate Limits
Default Limits
| Resource | Limit | Window |
|---|---|---|
| API requests | 60 | Per minute |
| Image generations | 30 | Per minute |
| Uploads | 20 | Per minute |
| OAuth token endpoint | 30 | Per minute per IP |
OAuth Rate Limiting

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-ipheader for IP identification - Returns
429 Too Many Requestswhen 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:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705312800Rate Limit Response
When exceeded:
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:
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
| Resource | Default | Max |
|---|---|---|
| Monthly storage | 10 GB | Configurable |
| Images per session | 1,000 | None |
| Total images | Unlimited | Storage-based |
Quota Tracking
Check usage:
curl https://gobananasai.com/api/usage \
-H "X-API-Key: sk_live_xxx"Response:
{
"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/1.1 402 Payment Required
{
"error": "Monthly storage quota exceeded",
"code": "QUOTA_EXCEEDED"
}Image Limits
Generation Limits
| Parameter | Flash | Pro |
|---|---|---|
| Prompt length | 8,192 chars | 16,384 chars |
| Images per request | 4 | 4 |
| Character reference images | 4 | 5 |
| Min reference image size | 512x512 px | 512x512 px |
File Limits
| Parameter | Limit |
|---|---|
| Max upload size | 20 MB |
| Minimum valid dimensions | 1 × 1 px |
| Max total upload pixels | 4,194,304 (about 4.2 MP; equivalent to 2048 × 2048) |
| Supported upload formats | PNG, 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
| Parameter | Limit |
|---|---|
| Thumbnail size | 200 × 200 px |
| R2 object key | 1024 chars |
| Metadata fields | 64 KB total |
Text Limits
Input Limits
| Field | Min | Max |
|---|---|---|
| Prompt | 1 | 16,384 chars |
| Negative prompt | 0 | 1,024 chars |
| System instruction | 0 | 512 chars |
| Character name | 1 | 100 chars |
| Character base prompt | 10 | 2,000 chars |
| Product name | 1 | 100 chars |
| Style preset name | 1 | 128 chars |
| Session ID | 1 | 200 chars |
| Search query | 1 | 200 chars |
Description Limits
| Field | Max |
|---|---|
| Character description | 500 chars |
| Product description | 500 chars |
| API key label | 100 chars |
| Tags (each) | 50 chars |
Collection Limits
Array Limits
| Collection | Max Items |
|---|---|
| Images per request | 4 |
| Character reference images (Flash) | 4 |
| Character reference images (Pro) | 5 |
| Characters per scene | 5 |
| Multi-char total ref images (Flash) | 4 |
| Multi-char total ref images (Pro) | 5 |
| Tags per character | 20 |
| Bulk delete IDs | 20 |
| Search results | 200 |
Pagination Limits
| Parameter | Default | Max |
|---|---|---|
| List limit | 50 | 200 |
| Search limit | 15 | 50 |
| History limit | 50 | 200 |
API Key Limits
Per Tenant
| Resource | Limit |
|---|---|
| API keys | 10 |
| Active keys | 10 |
Key Format
| Type | Format |
|---|---|
| Live key | sk_live_ + 32 chars |
| Test key | sk_test_ + 32 chars |
Session Limits
Session Constraints
| Parameter | Limit |
|---|---|
| Session ID length | 200 chars |
| Images per session | 1,000 |
| Session lifetime | Indefinite |
Database Limits
D1 Constraints
| Parameter | Limit |
|---|---|
| Row size | 1 MB |
| Query result | 10 MB |
| Batch size | 1,000 statements |
| Database size | Plan-dependent |
Index Limits
| Table | Indexes |
|---|---|
| images | 5 |
| characters | 3 |
| sessions | 2 |
Cloudflare Limits
Workers
| Resource | Free | Paid |
|---|---|---|
| Requests/day | 100,000 | 10M+ |
| CPU time | 10ms | 30s |
| Memory | 128 MB | 128 MB |
D1
| Resource | Free | Paid |
|---|---|---|
| Storage | 5 GB | 10+ GB |
| Reads/day | 5M | 25B |
| Writes/day | 100K | 50M |
R2
| Resource | Free | Paid |
|---|---|---|
| Storage | 10 GB | Pay per use |
| Class A ops | 1M/month | Pay per use |
| Class B ops | 10M/month | Pay per use |
KV
| Resource | Free | Paid |
|---|---|---|
| Reads/day | 100K | 10M+ |
| Writes/day | 1K | 1M+ |
| Storage | 1 GB | 10+ 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
| Tier | RPM | TPM |
|---|---|---|
| Free | 15 | 32K |
| Pay-as-you-go | 1000 | 4M |
| Enterprise | Custom | Custom |
RPM = Requests per minute, TPM = Tokens per minute. See Gemini API Pricing.
Gemini Content Limits
| Parameter | Limit |
|---|---|
| Prompt | 16,384 chars (Flash + Pro) |
| Reference images | 14 (6 high-fidelity on Pro) |
| Output | PNG only |
OpenAI gpt-image-2 Limits
| Parameter | Limit |
|---|---|
| Prompt | 32,000 chars |
| Reference images | 16 (routed via /v1/images/edits) |
| Max edge | 3,840px (both edges multiples of 16) |
| Aspect ratio cap | Long-to-short ≤3:1 |
| Pixel range | 655,360 – 8,294,400 |
| Output formats | PNG, JPEG, WebP (with output_compression) |
| Quality tiers | low / medium / high / auto |
| Default request timeout | 240s |
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:
# 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