All API docs

Audiobook API

Upload a file or submit text to produce a full audiobook with multi-voice narration, character portraits, scene illustrations, and published library entry. For lean single-voice synthesis, see the Text-to-Speech API.

Quick Start

Upload an EPUB and get a fully produced audiobook with AI narration, character portraits, and scene illustrations.

1. Upload a file

bash
curl -X POST https://notevibes.com/api/audiobook/create \
  -H "Authorization: Bearer nvb_your_api_key" \
  -F "[email protected]" \
  -F "title=My Book" \
  -F "multiVoice=true" \
  -F "generatePortraits=true" \
  -F "generateScenes=true" \
  -F "publish=true"

2. Poll for completion

bash
curl https://notevibes.com/api/audiobook/jobs/{jobId} \
  -H "Authorization: Bearer nvb_your_api_key"

Create Audiobook

POST
/api/audiobook/create

Submit text or upload a file to produce a full audiobook. Accepts either JSON (for raw text/HTML) or multipart FormData (for file uploads). Returns immediately with a job ID — generation runs asynchronously.

JSON Request Body

ParameterTypeDescription
title*stringBook title
content*stringFull text of the book. Chapters are auto-detected from headings.
contentTypestring"text/plain" (default) or "text/html". Plain text splits on chapter heading patterns; HTML splits on <h1>/<h2> tags.
settings.voicestringDefault narrator voice ID. Default: "en-US-Chirp3-HD-Achernar".
settings.multiVoicebooleanEnable AI character detection and multi-voice narration. Default: true.
settings.speakingRatenumberSpeaking rate multiplier (0.5 - 2.0). Default: 1.0.
settings.generatePortraitsbooleanGenerate AI character portraits and book cover. Default: false.
settings.generateScenesbooleanGenerate AI scene illustrations for each chapter. Default: false.
settings.sceneDensitystring"chapter" (1 per chapter) or "scene" (1 per detected scene). Default: "chapter".
settings.readAlongbooleanGenerate word-level read-along sync timings for each chapter. Default: false.
settings.batchbooleanUse batch mode for portraits/scenes (cheaper, async). When false, generates inline (slower but immediate). Default: true.
settings.publishbooleanPublish to library as public after completion. Default: false (private draft).
settings.backgroundMusicbooleanGenerate AI background music per chapter (mixed under narration). Costs 6,000 credits per chapter. Default: false.
settings.musicStylestringOptional music style hint (e.g. "calm piano", "orchestral", "lo-fi"). Used with backgroundMusic or lullabies.
settings.autoTagEmotionsbooleanAuto-insert Gemini 3.1 inline emotion/delivery [tags] (e.g. [whispers], [long pause], [menacing]) into each chapter before audio generation. Uses character detection outputs when available, otherwise tags purely from text. Default: false.

FormData Fields (File Upload)

ParameterTypeDescription
file*FileThe book file (EPUB, PDF, DOCX, TXT, AZW3, MOBI).
titlestringBook title. If omitted, derived from filename.
voicestringDefault narrator voice ID.
multiVoicestring"true" or "false". Default: "true".
speakingRatestringSpeaking rate as string number.
generatePortraitsstring"true" to generate AI portraits + cover.
generateScenesstring"true" to generate scene illustrations.
sceneDensitystring"chapter" or "scene".
readAlongstring"true" to generate word-level read-along sync.
batchstring"false" for fast inline image generation. Default: "true" (batch).
publishstring"true" to publish publicly after completion.
backgroundMusicstring"true" to generate AI background music per chapter.
musicStylestringOptional music style hint (e.g. "calm piano").
autoTagEmotionsstring"true" to auto-insert Gemini 3.1 inline emotion/delivery [tags] into each chapter before audio generation.

Response

json
{
  "jobId": "abc123def456",
  "status": "processing",
  "estimatedCredits": 4500
}

Error Responses

StatusReason
400Missing required fields or unsupported file type
401Invalid or missing API key
402Insufficient credits
403API key lacks write permission

Bedtime Stories & Lullabies

POST
/api/audiobook/create

Generate AI-powered personalized bedtime stories or lullabies. Set sourceType to "bedtime-story" for a narrated story or "bedtime-lullaby" for a fully sung lullaby.

Request Body

ParameterTypeDescription
sourceType*string"bedtime-story" (narrated) or "bedtime-lullaby" (sung by AI).
characters*stringCharacter names (e.g. "Emma and Buddy the dog").
promptstringCreative direction for the story or lullaby. Auto-generated from characters if omitted.
durationstring"mini" (~2-5 min), "short" (~5-8 min), or "medium" (~10-15 min). Stories only. Default: "short".
languagestringLanguage code (e.g. "en", "es"). Default: "en".
settings.voicestringNarrator voice ID. Default: "en-US-Chirp3-HD-Achernar".
settings.backgroundMusicbooleanAdd instrumental background music under narration. Stories only. Default: false.
settings.generatePortraitsbooleanGenerate character portraits and cover. Default: true for stories, false for lullabies.
settings.generateScenesbooleanGenerate scene illustrations. Default: true for stories, false for lullabies.
settings.publishbooleanPublish to library after completion. Default: false.

Bedtime Story Example

bash
curl -X POST https://notevibes.com/api/audiobook/create \
  -H "Authorization: Bearer nvb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceType": "bedtime-story",
    "characters": "Luna and her cat Whiskers",
    "prompt": "An adventure about stargazing, for a 5 year old who loves painting",
    "duration": "short",
    "settings": {
      "backgroundMusic": true,
      "generatePortraits": true,
      "publish": true
    }
  }'

Lullaby Example

bash
curl -X POST https://notevibes.com/api/audiobook/create \
  -H "Authorization: Bearer nvb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceType": "bedtime-lullaby",
    "characters": "Mia",
    "prompt": "A gentle lullaby about butterflies and flowers, soft acoustic guitar",
    "settings": {
      "publish": true
    }
  }'

Credits

TypeCost
Bedtime story (narration)TTS credits based on word count
Background music (per chapter)6,000 credits
Character song (each)6,000 credits
Lullaby6,000 credits (fixed)

Get Job Status

GET
/api/audiobook/jobs/:jobId

Poll this endpoint to track progress. Recommended interval: every 5-10 seconds.

Response (Completed)

json
{
  "jobId": "abc123def456",
  "status": "completed",
  "step": "completed",
  "title": "My Book",
  "progress": { "currentChapter": 12, "totalChapters": 12 },
  "estimatedCredits": 4500,
  "result": {
    "bookId": "lib_xyz789",
    "slug": "my-book",
    "libraryUrl": "/library/my-book",
    "exportUrls": {
      "zipUrl": "https://storage.googleapis.com/.../chapters.zip",
      "mergedUrl": "https://storage.googleapis.com/.../full-book.mp3"
    },
    "totalDuration": 3600,
    "chapterCount": 12,
    "creditsUsed": 4320,
    "portraits": {
      "generated": 5,
      "coverUrl": "https://storage.googleapis.com/.../cover.webp"
    },
    "scenes": {
      "status": "submitted",
      "batchName": "projects/.../batchPredictionJobs/123"
    },
    "readAlong": {
      "status": "submitted",
      "submitted": 12
    }
  }
}

Pipeline Steps

StepDescription
queuedWaiting for a processing slot
parsing_fileParsing uploaded file (EPUB, PDF, etc.)
creating_documentSetting up the production document
splitting_chaptersSplitting content into chapters
generating_storyAI story generation (bedtime stories only)
generating_lullabyAI lullaby lyrics + music generation (lullabies only)
detecting_charactersAI character detection and voice assignment
generating_audioTTS synthesis (track via progress.currentChapter)
generating_musicBackground music generation and mixing
exportingMerging audio and creating ZIP
adding_to_libraryCreating the library entry
generating_coverAI cover art generation
submitting_batchesSubmitting portraits, scenes, and read-along sync
publishingMaking the book publicly visible
completedAll done