{"openapi":"3.1.0","info":{"title":"noodl 動画生成API","version":"1.0.0","description":"AIキャラクター解説動画を生成するREST API。認証はAPIキー(Authorization: Bearer)。詳しい使い方は GET /api/v1/docs (markdown) を参照。"},"servers":[{"url":"https://noodl.jp/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"/api-keysで発行したAPIキー(ndl_で始まる)、またはOAuth 2.1で発行されたアクセストークン(ndla_で始まる)"},"oauth2":{"type":"oauth2","description":"OAuth 2.1(PKCE S256必須、Dynamic Client Registration対応)","flows":{"authorizationCode":{"authorizationUrl":"/oauth/authorize","tokenUrl":"/oauth/token","refreshUrl":"/oauth/token","scopes":{"full":"動画の作成・閲覧","read":"閲覧のみ"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"VideoOptions":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"VideoSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},"VideoDetail":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},{"type":"object","properties":{"etaSeconds":{"type":["number","null"]},"aheadCount":{"type":["integer","null"]},"videoUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"scriptJsonUrl":{"type":"string","format":"uri"},"scriptText":{"type":"string"},"reused":{"type":"boolean"}}}]},"Pronunciation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"surface":{"type":"string","minLength":2,"maxLength":30,"description":"表記(台本に出る形)"},"reading":{"type":"string","maxLength":50,"description":"読み(カタカナ)。登録時にひらがなはカタカナへ変換される"}},"required":["id","surface","reading"]}}},"security":[{"apiKey":[]},{"oauth2":["full"]}],"paths":{"/videos":{"post":{"summary":"動画生成を依頼する","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"同じ依頼を再送する場合に指定する。同一キーの2回目以降は既存の動画を200で返す(reused: true)。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"string","description":"動画のテーマまたは指示。1行のテーマでも、原稿・要点メモでもよい(genreにより上限が異なる。GET /optionsのgenresを参照)"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"],"description":"動画のジャンル。省略時はexplainer(解説動画)"},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ必須。themeが著作権上問題なく利用できるテキストであることの確認"},"orientation":{"type":"string","enum":["landscape","vertical"]},"character":{"type":"string"},"voice":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"数値のスタイルID、または「話者名」「話者名/スタイル名」の文字列(例: \"ずんだもん/ノーマル\")"},"character2":{"type":"string","description":"指定すると2人の対話形式になる(characterが左側、character2が右側)。characterと別のキャラクターを指定する。genreがexplainer/manualのときのみ"},"voice2":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"character2の声。voiceと同じ形式。character2を指定したときのみ指定でき、省略時はcharacter2の声(ずんだもん系→ID 3、四国めたん系→ID 2、それ以外は四国めたん/ノーマル(ID 2))"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"outro":{"type":"boolean"}},"required":["theme"]}}}},"responses":{"200":{"description":"冪等キーが既存動画と一致(reused: true)","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},{"type":"object","properties":{"etaSeconds":{"type":["number","null"]},"aheadCount":{"type":["integer","null"]},"videoUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"scriptJsonUrl":{"type":"string","format":"uri"},"scriptText":{"type":"string"},"reused":{"type":"boolean"}}}]}}}},"201":{"description":"作成した","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},{"type":"object","properties":{"etaSeconds":{"type":["number","null"]},"aheadCount":{"type":["integer","null"]},"videoUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"scriptJsonUrl":{"type":"string","format":"uri"},"scriptText":{"type":"string"},"reused":{"type":"boolean"}}}]}}}},"400":{"description":"検証エラー","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"認証エラー","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"リクエストボディが大きすぎる(256KBまで)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"上限超過またはレート制限","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"summary":"自分の動画一覧","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"前回応答のnextCursor"},{"name":"status","in":"query","schema":{"type":"string","enum":["queued","processing","done","failed"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}}},"nextCursor":{"type":["string","null"]}}}}}}}}},"/videos/{id}":{"get":{"summary":"1本の動画の詳細","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wait","in":"query","schema":{"type":"number","minimum":0,"maximum":55},"description":"指定秒数、done/failedになるまでサーバー側で待つ(ロングポーリング)。最大55秒。"},{"name":"includeScript","in":"query","schema":{"type":"boolean"},"description":"trueで台本本文(scriptText)を含める"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},{"type":"object","properties":{"etaSeconds":{"type":["number","null"]},"aheadCount":{"type":["integer","null"]},"videoUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"scriptJsonUrl":{"type":"string","format":"uri"},"scriptText":{"type":"string"},"reused":{"type":"boolean"}}}]}}}},"404":{"description":"見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/videos/{id}/retry":{"post":{"summary":"失敗した動画を再試行する","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"theme":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"stage":{"type":["string","null"],"enum":["script","scenes","render","upload",null]},"error":{"type":["string","null"]},"options":{"type":"object","properties":{"character":{"type":"string"},"voice":{"type":"number"},"character2":{"type":"string","description":"2人の対話形式のときのみ設定される(右側のキャラクター)"},"voice2":{"type":"number","description":"2人の対話形式のときのみ設定される(character2の声)"},"bgm":{"type":"string"},"background":{"type":"string"},"imageSetId":{"type":"string","format":"uuid"},"captions":{"type":"boolean"},"orientation":{"type":"string","enum":["landscape","vertical"]},"outro":{"type":"boolean"},"genre":{"type":"string","enum":["explainer","manual","quiz","novel"]},"rightsConfirmed":{"type":"boolean","description":"genre=novelのときのみ設定される"}}},"durationSec":{"type":["number","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}}},{"type":"object","properties":{"etaSeconds":{"type":["number","null"]},"aheadCount":{"type":["integer","null"]},"videoUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"scriptJsonUrl":{"type":"string","format":"uri"},"scriptText":{"type":"string"},"reused":{"type":"boolean"}}}]}}}},"400":{"description":"failed以外は再試行できない","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"今月の作成上限に達している(再試行も今月の1本として数える)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/options":{"get":{"summary":"選択肢(キャラ・話者・BGM・背景・自分の画像セット)","responses":{"200":{"description":"OK"}}}},"/me":{"get":{"summary":"プラン・今月の使用本数・上限","responses":{"200":{"description":"OK"}}}},"/pronunciations":{"get":{"summary":"読み方辞書の一覧","description":"動画を作るたびに、その時点の辞書が台本の表記と音声の読みに自動で反映される。すでに作った動画は変わらない。","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pronunciations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"surface":{"type":"string","minLength":2,"maxLength":30,"description":"表記(台本に出る形)"},"reading":{"type":"string","maxLength":50,"description":"読み(カタカナ)。登録時にひらがなはカタカナへ変換される"}},"required":["id","surface","reading"]}},"limit":{"type":"integer","description":"1ユーザーあたりの登録上限"}}}}}},"401":{"description":"認証エラー","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"summary":"読み方辞書に登録する","description":"同じ表記(全角半角・大文字小文字の違いは無視)が登録済みなら読みを更新する(upsert)。","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"surface":{"type":"string","minLength":2,"maxLength":30,"description":"表記(台本に出る形)"},"reading":{"type":"string","maxLength":50,"description":"読み。カタカナ(ひらがなも可)と長音「ー」のみ"}},"required":["surface","reading"]}}}},"responses":{"200":{"description":"既存の表記の読みを更新した(created: false)","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"surface":{"type":"string","minLength":2,"maxLength":30,"description":"表記(台本に出る形)"},"reading":{"type":"string","maxLength":50,"description":"読み(カタカナ)。登録時にひらがなはカタカナへ変換される"}},"required":["id","surface","reading"]},{"type":"object","properties":{"created":{"type":"boolean"}}}]}}}},"201":{"description":"新規に登録した","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"surface":{"type":"string","minLength":2,"maxLength":30,"description":"表記(台本に出る形)"},"reading":{"type":"string","maxLength":50,"description":"読み(カタカナ)。登録時にひらがなはカタカナへ変換される"}},"required":["id","surface","reading"]},{"type":"object","properties":{"created":{"type":"boolean"}}}]}}}},"400":{"description":"検証エラー、または上限(200件)に達している","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"認証エラー(scope=readのキーは403)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"413":{"description":"リクエストボディが大きすぎる(256KBまで)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/pronunciations/{id}":{"delete":{"summary":"読み方辞書から削除する","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"削除した","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"}}}}}},"404":{"description":"見つからない","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","validation_error","not_found","quota_exceeded","rate_limited"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/openapi.json":{"get":{"summary":"OpenAPI 3.1定義(JSON)","security":[],"responses":{"200":{"description":"OK"}}}},"/openapi.yaml":{"get":{"summary":"OpenAPI 3.1定義(YAML)","security":[],"responses":{"200":{"description":"OK"}}}},"/docs":{"get":{"summary":"使い方(markdown)","security":[],"responses":{"200":{"description":"OK"}}}}}}