{"components":{"schemas":{"ChapterInput":{"properties":{"summary":{"description":"Chapter outline/summary for AI generation","type":"string"},"title":{"description":"Chapter title","type":"string"}},"required":["title","summary"],"type":"object"},"CreateBookRequest":{"properties":{"author":{"description":"Author name (defaults to 'Unknown Author')","type":"string"},"chapter_count":{"description":"Number of chapters for AI to generate. Maximum depends on plan: starter=15, pro=30. Provide either chapters or chapter_count.","maximum":30,"minimum":1,"type":"integer"},"chapters":{"description":"Pre-defined chapter outlines. Provide either chapters or chapter_count. Maximum items depend on plan: starter=15, pro=30.","items":{"$ref":"#/components/schemas/ChapterInput"},"maxItems":30,"minItems":1,"type":"array"},"content_restrictions":{"type":"string"},"description":{"description":"Book blurb/premise","type":"string"},"generate_cover":{"default":true,"description":"Whether to generate an AI cover image for the eBook. Set to false to skip cover generation and ship with a placeholder page. Defaults to true.","type":"boolean"},"genre":{"description":"Genre name from GET /genres (e.g. literature_fiction, nonfiction)","type":"string"},"language":{"default":"en","description":"ISO 639-1 language code","type":"string"},"narrative_voice":{"type":"string"},"references_sources":{"type":"string"},"subject_theme":{"description":"Subject theme within genre","type":"string"},"target_audience":{"type":"string"},"title":{"type":"string"},"tone":{"type":"string"},"unique_elements":{"type":"string"}},"required":["title"],"type":"object"},"Error":{"properties":{"error":{"type":"string"}},"type":"object"},"JobStatus":{"properties":{"book_id":{"type":"integer"},"chapters_done":{"type":"integer"},"completed_at":{"format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"current_step":{"type":"string"},"download_url":{"description":"EPUB download URL (present when status is completed)","type":"string"},"epub_available":{"type":"boolean"},"epub_expires_at":{"format":"date-time","type":"string"},"error":{"type":"string"},"job_id":{"format":"uuid","type":"string"},"progress":{"maximum":1,"minimum":0,"type":"number"},"started_at":{"format":"date-time","type":"string"},"status":{"enum":["awaiting_payment","queued","generating","building_epub","completed","failed","expired"],"type":"string"},"total_chapters":{"type":"integer"}},"type":"object"}},"securitySchemes":{"rapidApiKey":{"description":"Authenticate via your RapidAPI subscription key. Rate limiting and quota enforcement are handled by RapidAPI.","in":"header","name":"X-RapidAPI-Key","type":"apiKey"}}},"info":{"contact":{"url":"https://www.scrivibe.com"},"description":"Programmatic eBook generation for AI agents. Create multi-chapter eBooks using Anthropic Claude AI and download as EPUB.","title":"Scrivibe B2A API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/books":{"post":{"operationId":"createBook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}},"description":"Book generation started"},"400":{"description":"Validation error"}},"summary":"Create a book and start AI generation"}},"/books/{job_id}":{"get":{"operationId":"getBookStatus","parameters":[{"in":"path","name":"job_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}},"description":"Job status with progress and download_url when complete"},"404":{"description":"Job not found"}},"summary":"Get book generation status and progress"}},"/books/{job_id}/epub":{"get":{"operationId":"downloadEpub","parameters":[{"in":"path","name":"job_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/epub+zip":{"schema":{"format":"binary","type":"string"}}},"description":"EPUB file download"},"404":{"description":"Job not found"},"409":{"description":"Book not ready yet"},"410":{"description":"EPUB expired"}},"summary":"Download generated EPUB file"}},"/genres":{"get":{"operationId":"listGenres","responses":{"200":{"description":"List of genres with their subject themes"}},"summary":"List all supported genres (content types and themes)"}},"/health":{"get":{"operationId":"healthCheck","responses":{"200":{"description":"Service health including epub_cleanup monitoring status"}},"security":[],"summary":"Health check with EPUB cleanup status"}}},"security":[{"rapidApiKey":[]}],"servers":[{"description":"Production","url":"https://www.scrivibe.com/v1"}]}
