Paper Banana API Reference
The Paper Banana API lets you generate academic illustrations and scientific diagrams programmatically.
Paper Banana API Overview
The Paper Banana API provides a simple RESTful interface for generating high-quality academic illustrations, scientific diagrams, and research figures. Integrate Paper Banana API into your workflow to automate figure creation for papers, posters, and presentations.
Base URL: https://paperbanana.run/api/v1All API requests must be made over HTTPS. HTTP requests will be rejected.
Paper Banana API Authentication
All Paper Banana API requests require authentication via a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer sk-your-api-key-hereAPI keys can be created and managed from your API Keys dashboard. Keys are prefixed with sk-.
Team Plans
API access requires an active Team plan. Three tiers are available:
| Plan | Price | Credits/Year | API Keys | Rate Limit |
|---|---|---|---|---|
| Team Basic | $999/year | 75,000 | 3 | 120 RPM |
| Team Pro | $1,499/year | 115,000 | 10 | 300 RPM |
| Team Enterprise | $2,999/year | 225,000 | 25 | 600 RPM |
API Rate Limiting
Paper Banana API requests are rate-limited based on your Team plan tier. Rate limits are applied per API key.
When you exceed the rate limit, the API returns a 429 Too Many Requests response. Wait and retry with exponential backoff.
Paper Banana API Endpoints
/api/v1/creditsGet your current credit balance and plan info.
Response
{
"success": true,
"data": {
"remaining_credits": 45000,
"team_plan": "team-pro",
"rate_limit_rpm": 300
}
}/api/v1/generateGenerate an image. Supports two modes: standard (Nano Banana) and pipeline (Paper Banana academic illustration).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | "standard" or "pipeline" |
prompt | string | Yes | Text description (max 10,000 chars) |
model | string | No | "nano-banana-pro" (default), "nano-banana", "nano-banana-2" |
options.resolution | string | No | "1K" (default), "2K", "4K" |
options.aspect_ratio | string | No | "1:1" (default), "16:9", "9:16", etc. |
options.image_input | string[] | No | Reference image URLs (max 10, HTTPS only) |
options.content | string | No | Paper content for pipeline mode (max 100K chars) |
Example: Standard Generation
curl -X POST https://paperbanana.run/api/v1/generate \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"type": "standard",
"prompt": "A detailed diagram of a neural network architecture",
"model": "nano-banana-pro",
"options": {
"resolution": "2K",
"aspect_ratio": "16:9"
}
}'Response
{
"success": true,
"data": {
"task_id": "abc123-def456",
"type": "standard",
"model": "nano-banana-pro",
"credits_used": 15,
"status": "processing"
}
}/api/v1/tasksList your generation tasks. Supports pagination and filtering.
Query Parameters
| Param | Default | Description |
|---|---|---|
page | 1 | Page number |
limit | 20 | Items per page (max 100) |
type | all | "standard" or "pipeline" |
status | all | "pending", "processing", "success", "failed" |
/api/v1/task/:taskIdGet the status and result of a specific task.
Response (completed)
{
"success": true,
"data": {
"task_id": "abc123-def456",
"type": "standard",
"status": "success",
"prompt": "A neural network diagram",
"model": "nano-banana-pro",
"resolution": "2K",
"credits_used": 15,
"output_urls": [
"https://image.paperbanana.run/result.png"
],
"created_at": "2026-04-15T10:00:00Z",
"completed_at": "2026-04-15T10:00:45Z"
}
}Paper Banana API Credit Costs
Paper Banana API calls consume credits at full price (no resolution discount).
| Type | Resolution | Credits |
|---|---|---|
| Standard / Pipeline | 1K | 10 |
| Standard / Pipeline | 2K | 15 |
| Standard / Pipeline | 4K | 25 |
API Error Codes
| Status | Meaning |
|---|---|
400 | Bad Request — Invalid parameters |
401 | Unauthorized — Invalid or missing API key |
402 | Payment Required — Insufficient credits |
403 | Forbidden — No Team plan or exceeded limits |
404 | Not Found — Task does not exist |
429 | Too Many Requests — Rate limit exceeded |
500 | Internal Server Error |
502 | Bad Gateway — Upstream generation service error |
All error responses include an error field with a human-readable message.
Paper Banana API Quick Start
1. Check your credits
curl -H "Authorization: Bearer sk-your-key" \
https://paperbanana.run/api/v1/credits2. Generate an image
curl -X POST https://paperbanana.run/api/v1/generate \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"type": "standard",
"prompt": "A red apple on a white background",
"model": "nano-banana-pro"
}'3. Check task status
curl -H "Authorization: Bearer sk-your-key" \
https://paperbanana.run/api/v1/task/TASK_ID_HERE4. List all tasks
curl -H "Authorization: Bearer sk-your-key" \
"https://paperbanana.run/api/v1/tasks?page=1&limit=10"