newcharactersheet
newcharactersheetauth.checkingAccount

API Reference

newcharactersheet API

Generate AI character sheets and scenes programmatically. Authenticate with an API key via the X-API-Key header.

OpenAPI Spec/api/openapi.json

Quick Start

Get an API key and generate your first character in two steps.

1. Get an API key

Sign in at Settings and create an API key, or use an existing key via the POST /api/api-keys endpoint.

2. Generate a character sheet

curl -X POST https://newcharactersheet.com/api/generate \
  -H "X-API-Key: ncs_dG9rZW4..." \
  -F "prompt=A cyberpunk street samurai with neon tattoos" \
  -F "visibility=private"
{
  "id": "6d3f...",
  "imageBase64": "iVBORw0KGgo...",
  "contentType": "image/png"
}

Authentication

Sign in and create an API key from Settings. Pass it in the X-API-Key header. Keys start with ncs_.

curl https://newcharactersheet.com/api/auth/me \
  -H "X-API-Key: ncs_your_key_here"

Auth

GET/api/auth/meOptional
Check authentication status

Response

{
  "authenticated": true,
  "uid": "fWx8k2mN..."
}

Generation

POST/api/generateRequired
Generate a character reference sheet

Accepts multipart/form-data. Returns the new sheet ID. Fetch the full sheet (with image URLs) via GET /api/sheets/:id.

Parameters

FieldTypeRequiredDescription
promptstringYesCharacter description (max 10,000 chars)
keywordsstringNoComma-separated tags
visibilitystringNo"public" or "private" (default)
stylestringNoArt style hint
referenceImagesfile[]NoReference images (max 50 MB each)

Request

curl -X POST https://newcharactersheet.com/api/generate \
  -H "X-API-Key: ncs_..." \
  -F "prompt=A medieval knight with golden armor" \
  -F "keywords=knight,medieval,armor" \
  -F "visibility=public" \
  -F "style=anime"

Response 201

{
  "id": "6d3f..."
}
POST/api/scene/generateRequired
Generate a scene image or video with characters

Create a scene featuring your characters. Use outputMode "picture" for an image, or "video" to animate it.

Parameters

FieldTypeRequiredDescription
promptstringNoScene description
sheetIdsstring[]NoCharacter sheet IDs to include (max 8)
outputModestringNo"picture" (default) or "video"

Request body

{
  "prompt": "Epic battle in a volcanic landscape",
  "sheetIds": ["6d3f..."],
  "outputMode": "picture"
}

Response 201

{
  "id": "s9f2...",
  "imageBase64": "iVBORw0KGgo...",
  "contentType": "image/png",
  "outputMode": "picture"
}

Workflow Example

1. Generate a character

curl -X POST https://newcharactersheet.com/api/generate \
  -H "X-API-Key: ncs_..." \
  -F "prompt=A fire mage with flowing red robes"
# → { "id": "char_abc..." }

2. Create a scene image with that character

curl -X POST https://newcharactersheet.com/api/scene/generate \
  -H "X-API-Key: ncs_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Standing on a cliff overlooking a burning city",
    "sheetIds": ["char_abc..."],
    "outputMode": "picture"
  }'
# → { "id": "scene_xyz...", "outputMode": "picture" }

3. Generate a video from the scene

curl -X POST https://newcharactersheet.com/api/scene/generate \
  -H "X-API-Key: ncs_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Camera slowly pans across the burning city",
    "sheetIds": ["char_abc..."],
    "outputMode": "video"
  }'
# → { "id": "vid_001...", "outputMode": "video" }

Sheets

GET/api/sheets/:idOptional
Get a sheet by ID

Public sheets need no auth. Private sheets require owner auth.

Response

{
  "id": "6d3f...",
  "ownerUid": "fWx8k2mN...",
  "sheetType": "character",
  "visibility": "public",
  "prompt": "A medieval knight...",
  "keywords": ["knight", "medieval"],
  "handle": "golden-knight",
  "createdAt": 1708300000000,
  "updatedAt": 1708300000000,
  "image": {
    "storagePath": "sheets/...",
    "publicUrl": "https://...",
    "contentType": "image/png",
    "width": 2048, "height": 2048
  },
  "video": {
    "storagePath": "sheets/...",
    "publicUrl": "https://...",
    "contentType": "video/mp4"
  },
  "accessUrl": "https://...",
  "videoAccessUrl": "https://...",
  "panelCuts": [
    { "id": "c1", "x": 0, "y": 0, "width": 0.5, "height": 0.5 }
  ],
  "stats": { "savesCount": 12, "likesCount": 34, "commentsCount": 5 },
  "project": { "id": "proj_1", "name": "My Project" },
  "characterRefs": ["sheet_abc..."],
  "savedFrom": { "sheetId": "orig_1", "ownerUid": "u123" },
  "viewerHasLiked": false
}
PATCH/api/sheets/:idRequired
Update sheet metadata

Request body

{
  "keywords": ["knight", "medieval", "armor"],
  "handle": "golden-knight"
}

Response

{
  "id": "6d3f...",
  "keywords": ["knight", "medieval", "armor"],
  "handle": "golden-knight"
}
DELETE/api/sheets/:idRequired
Delete a sheet you own

Returns 204 with no body.

GET/api/sheets/search?q=queryOptional
Search sheets

Response

{
  "results": [
    {
      "id": "6d3f...",
      "prompt": "A medieval knight...",
      "keywords": ["knight", "medieval"],
      "handle": "golden-knight",
      "imageUrl": "https://..."
    }
  ]
}
PATCH/api/visibility/:idRequired
Change sheet visibility

Request body

{ "visibility": "public" }

Response

{
  "id": "6d3f...",
  "visibility": "public"
}

API Keys

GET/api/api-keysRequired
List your API keys

Returns metadata only — no secrets.

Response

{
  "keys": [
    {
      "keyId": "a1b2c3...",
      "label": "my-agent",
      "last4": "Zw4x",
      "createdAt": 1708300000000
    }
  ]
}
POST/api/api-keysRequired
Create a new API key

The plaintext key is returned only once.

Request body

{ "label": "production" }

Response 201

{
  "key": "ncs_dG9rZW4...",
  "keyId": "a1b2c3..."
}
DELETE/api/api-keysRequired
Revoke an API key

Request body

{ "keyId": "a1b2c3..." }

Response

{ "ok": true }

Rate Limits & Quotas

All API routes are rate-limited per IP address. Generation routes have stricter limits. API keys have a daily request quota.

ScopeLimit
Global (all routes)60 requests / minute per IP
Generation routes10 requests / minute per IP
API key daily quota1,000 requests / day per key

Rate-limited responses return 429 with a Retry-After header. Quota-exceeded responses return 429 with code QUOTA_EXCEEDED.

Input Limits

ParameterLimit
Prompt length10,000 characters
File size (each)50 MB
Total upload size100 MB per request
Reference imagesMax 8 per request
Explore page sizeMax 100 items

Errors

All errors return a consistent shape:

{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "Authentication required"
  }
}

Common codes: 401 403 404 429 500