---
title: "テキストからアクセント句を得る"
method: POST
path: "/accent_phrases"
tags: ["クエリ編集"]
---

# テキストからアクセント句を得る

`POST /accent_phrases`

テキストからアクセント句を得ます。
is_kanaが`true`のとき、テキストは次の AquesTalk 風記法で解釈されます。デフォルトは`false`です。
* 全てのカナはカタカナで記述される
* アクセント句は`/`または`、`で区切る。`、`で区切った場合に限り無音区間が挿入される。
* カナの手前に`_`を入れるとそのカナは無声化される
* アクセント位置を`'`で指定する。全てのアクセント句にはアクセント位置を1つ指定する必要がある。
* アクセント句末に`？`(全角)を入れることにより疑問文の発音ができる。

## Query parameters

- `text` string, required
- `speaker` integer, required
- `is_kana` boolean
- `core_version` string, nullable — AivisSpeech Engine ではサポートされていないパラメータです (常に無視されます) 。

## Response `200`

Successful Response

- AccentPhrase[]
  - `moras` Mora[], required
    - `text` string, required
    - `consonant` string, nullable
    - `consonant_length` number, nullable
    - `vowel` string, required
    - `vowel_length` number, required
    - `pitch` number, required
  - `accent` integer, required
  - `pause_mora` Mora — モーラ（子音＋母音）ごとの情報
    - `text` string, required
    - `consonant` string, nullable
    - `consonant_length` number, nullable
    - `vowel` string, required
    - `vowel_length` number, required
    - `pitch` number, required
  - `is_interrogative` boolean

## Other responses

- `400` — 読み仮名のパースに失敗
- `422` — Validation Error

## Changes

- **2024-05-02** `7d46d11815c2` — 2 breaking, 4 info
  - response property `items/moras/items/consonant` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `items/moras/items/consonant_length` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - `query` request parameter `core_version` list-of-types was widened by adding types `null`
  - for the `query` request parameter `core_version`, the type was generalized from `string` to no type
  - …2 more
- **2024-04-26** `907e5011a1aa` — 1 breaking, 5 info
  - `query` request parameter `core_version` list-of-types was narrowed by removing types `null`
  - for the `query` request parameter `core_version`, the type was generalized from no type to `string`
  - added `#/components/schemas/Mora` to the `items/pause_mora` response property `allOf` list for the response status `200`
  - removed `#/components/schemas/Mora, subschema #2` from the `items/pause_mora` response property `anyOf` list for the response status `200`
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/changes/accent_phrases/post.md)

---

[API](https://skmtc.dev/aivis-project/apis/aivisspeech-engine.md) · [All operations](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/llms.txt) · [OpenAPI document](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/revisions/715f105554e0?raw)
