{"openapi":"3.1.0","info":{"title":"furikake","summary":"書誌のヨミから書名・著者のルビ（振り仮名）を作る API","version":"0.2.38+data-2026-11-05"},"paths":{"/v1/ruby":{"post":{"summary":"Ruby","description":"書誌ごとに書名・巻次・著者のルビを返す。LLM の答えがまだ無い区間はルビを付けずに返し（state が partial）、裏で LLM に聞く。\n確定までは最大1〜2時間。同じ入力で呼び直すと、答えが届いていれば確定した結果が返る。\n応答の形は shape で作る（最終結果のキャッシュは従来の形のまま）。処理時間は Server-Timing で返す","operationId":"ruby_v1_ruby_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AuthorSeg":{"properties":{"text":{"type":"string","title":"Text","description":"表記"},"ruby":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ruby","description":"表示用の読み（漢字の読みは平仮名、外来語・英字は片仮名）。ルビを付けない区間は null"},"yomi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Yomi","description":"目録表記（片仮名）の読み。ルビを付けない区間は null"},"grade":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Grade","description":"このルビを表示する上限の学年（1〜6 は小学校のその学年、7 は中学生、8 は高校生、9 は一般）。読者の学年が g なら grade >= g の区間だけルビを付ける。読みの無い区間と、漢字も数字も無い区間（英字）は null"},"person":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Person","description":"著者の表記から取り出した何人目の名前か（0 から）。同じ人の姓・名は同じ番号。役割語・区切りなど名前でない区間は null"}},"type":"object","required":["text","ruby","yomi","grade","person"],"title":"AuthorSeg"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RecordIn":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Title","description":"書名（表示に使うもの）","examples":["源氏物語"]},"volume":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Volume","description":"巻次。書名と一緒にヨミと照らし合わせ、ルビは分けて返す","examples":["上巻"]},"title_yomi":{"anyOf":[{"type":"string","maxLength":1000},{"items":{"type":"string","maxLength":1000},"type":"array","maxItems":10},{"type":"null"}],"title":"Title Yomi","description":"館のヨミ。書名と巻次のヨミが別の要素でも、つながっていてもよい。叢書名など別のもののヨミは、つなげずに別の要素にする","examples":[["げんじものがたり","じょうかん"]]},"title_yomi_fallback":{"anyOf":[{"type":"string","maxLength":1000},{"items":{"type":"string","maxLength":1000},"type":"array","maxItems":10},{"type":"null"}],"title":"Title Yomi Fallback","description":"NDL などのヨミ。館のヨミで読めないときと、読み残しを補うときに使う"},"author":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Author","description":"著者の表記。複数人や役割語（∥著・／訳）を含んだままでよい","examples":["紫式部∥著/与謝野 晶子∥訳"]},"author_yomi":{"anyOf":[{"type":"string","maxLength":1000},{"items":{"type":"string","maxLength":1000},"type":"array","maxItems":10},{"type":"null"}],"title":"Author Yomi","description":"館のヨミ。1人ずつの配列を勧める。複数人分を1つにつなげるなら、著者の表記と同じ順にする","examples":[["ムラサキシキブ","ヨサノアキコ"]]},"author_yomi_fallback":{"anyOf":[{"type":"string","maxLength":1000},{"items":{"type":"string","maxLength":1000},"type":"array","maxItems":10},{"type":"null"}],"title":"Author Yomi Fallback","description":"NDL などのヨミ"}},"type":"object","title":"RecordIn","description":"書誌1件。ヨミは文字列でも配列でもよい（文字列は要素1つの配列）。片仮名でもひらがなでもよい"},"RecordOut":{"properties":{"state":{"type":"string","title":"State","description":"書誌全体の状態。done（確定）・partial（一部が未完了。確定したルビだけ返す）・no_yomi（ヨミが無くルビなし）"},"title":{"items":{"$ref":"#/components/schemas/Seg"},"type":"array","title":"Title","description":"書名の区間。つなぐと title になる（送らなければ空）"},"volume":{"items":{"$ref":"#/components/schemas/Seg"},"type":"array","title":"Volume","description":"巻次の区間。つなぐと volume になる（送らなければ空）"},"author":{"items":{"$ref":"#/components/schemas/AuthorSeg"},"type":"array","title":"Author","description":"著者の表記の区間。つなぐと author になる。役割語・区切りもルビの無い区間として入る（送らなければ空）"}},"type":"object","required":["state","title","volume","author"],"title":"RecordOut"},"RubyIn":{"properties":{"records":{"items":{"$ref":"#/components/schemas/RecordIn"},"type":"array","title":"Records","description":"書誌の並び（1回に 100 件まで）"}},"type":"object","required":["records"],"title":"RubyIn"},"RubyOut":{"properties":{"version":{"type":"string","title":"Version","description":"処理のバージョン（コードの版+辞書データの版）"},"records":{"items":{"$ref":"#/components/schemas/RecordOut"},"type":"array","title":"Records","description":"書誌ごとの結果。リクエストの records と同じ順・同じ件数"}},"type":"object","required":["version","records"],"title":"RubyOut"},"Seg":{"properties":{"text":{"type":"string","title":"Text","description":"表記"},"ruby":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ruby","description":"表示用の読み（漢字の読みは平仮名、外来語・英字は片仮名）。ルビを付けない区間は null"},"yomi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Yomi","description":"目録表記（片仮名）の読み。ルビを付けない区間は null"},"grade":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Grade","description":"このルビを表示する上限の学年（1〜6 は小学校のその学年、7 は中学生、8 は高校生、9 は一般）。読者の学年が g なら grade >= g の区間だけルビを付ける。読みの無い区間と、漢字も数字も無い区間（英字）は null"}},"type":"object","required":["text","ruby","yomi","grade"],"title":"Seg","description":"区間。書誌の書名・巻次・著者名を区切ったもので、text をつなぐと送った文字列になる"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}