CharaStudio

Character API

Create Character

POST /v1/characters

Request Body:

{
  "name": "Lin Shuang",
  "description": "A calm and composed female swordswoman with silver hair...",
  "personality": "Calm, Reserved, Loyal",
  "first_mes": "...",
  "spec_version": "CharaStudio-v1"
}

Response:

{
  "success": true,
  "data": {
    "id": "char_abc123",
    "name": "Lin Shuang",
    "created_at": "2026-05-01T12:00:00Z"
  }
}

Get Character

GET /v1/characters/{character_id}

Update Character

PATCH /v1/characters/{character_id}

Delete Character

DELETE /v1/characters/{character_id}

List Characters

GET /v1/characters

Query Parameters:

ParameterTypeDescription
limitintegerItems per page (default 20, max 100)
offsetintegerOffset
searchstringSearch by name

Story API

Create Story

POST /v1/stories

Request Body:

{
  "title": "Frost Moon Legend",
  "world_id": "world_xyz789",
  "outline": "..."
}

Generate Story Content

POST /v1/stories/{story_id}/generate

Request Body:

{
  "scene_id": "scene_abc123",
  "mode": "incremental",
  "params": {
    "temperature": 0.8,
    "max_tokens": 1024
  }
}

Get Story Nodes

GET /v1/stories/{story_id}/nodes

World Card API

Create World Card

POST /v1/worlds

List Scenes

GET /v1/worlds/{world_id}/scenes

Add Scene Card

POST /v1/worlds/{world_id}/scenes

Image Generation API

Generate Comic Panels

POST /v1/generate/comic

Request Body:

{
  "story_id": "story_abc123",
  "scene_id": "scene_xyz456",
  "panels": [
    {
      "description": "Character standing at Frost Moon City gate",
      "style": "fantasy_anime",
      "camera": "wide_shot"
    },
    {
      "description": "Character looking up at the city gate",
      "style": "fantasy_anime",
      "camera": "medium_shot"
    }
  ]
}

Code Examples

Python

import charastudio

client = charastudio.Client(api_key="YOUR_API_KEY")

# Create character
character = client.characters.create(
    name="Lin Shuang",
    description="A calm and composed female swordswoman",
    personality="Calm, Reserved"
)

print(f"Created character: {character.id}")

# Generate comic panels
images = client.generate.comic(
    story_id="story_abc123",
    scene_id="scene_xyz456",
    panels=panels
)

JavaScript

import { CharaStudio } from 'charastudio-sdk';

const client = new CharaStudio({ apiKey: 'YOUR_API_KEY' });

// Create character
const character = await client.characters.create({
  name: 'Lin Shuang',
  description: 'A calm and composed female swordswoman',
  personality: 'Calm, Reserved'
});

console.log(`Created character: ${character.id}`);