さくらの AI Engine Inference API (1.0.0)

Download OpenAPI specification:Download

さくらの AI Engine チャット補完 / 音声書き起こし

Create chat completion

チャット補完のリクエストの代表例です。利用するモデルによってはサポートされていないパラメータもありますので、ご注意ください。

Authorizations:
BearerAuth
Request Body schema: application/json
model
required
string

利用するチャットモデル名。利用可能なモデルはコントロールパネル等をご確認ください。

required
Array of Developer message (object) or System message (object) or User message (object) or Assistant message (object) or Tool message (object)

チャットのメッセージ履歴。モデルによってサポートしているメッセージタイプが異なります。

max_tokens
integer >= 1

応答生成に使用する最大トークン数。

temperature
number [ 0 .. 2 ]
Default: 1

生成の多様性を制御するパラメータ。値が高いほど多様な応答が生成され、値が低いほど決定的な応答が生成されます。

string or ChatCompletionNamedToolChoice (object) (ChatCompletionToolChoiceOption)
Array of ChatCompletionTool (object)

モデルが利用可能なツールのリスト。

stream
boolean
Default: false

ストリーミング応答を有効にするかどうか。

Responses

Request samples

Content type
application/json
{
  • "model": "string",
  • "messages": [
    ],
  • "max_tokens": 1,
  • "temperature": 1,
  • "tool_choice": "none",
  • "tools": [
    ],
  • "stream": false
}

Create a transcription

Authorizations:
BearerAuth
Request Body schema: multipart/form-data
file
required
string <binary>

Audio file to transcribe. Common formats: mp3, mp4, m4a, wav, webm, etc. .

model
string
Value: "whisper-large-v3-turbo"

Transcription model identifier served by vLLM.

language
string
Default: "ja"

Source language hint (BCP-47, e.g. "ja", "en-US").

prompt
string

Optional decoding/prompt bias (proper nouns, style hints).

temperature
number [ 0 .. 1 ]
Default: 0

Decoding temperature.

stream
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "model": "whisper-large-v3-turbo",
  • "text": "本日はご利用いただきありがとうございます。"
}

Create embeddings

埋め込みベクトル作成のリクエストの代表例です。利用するモデルによってはサポートされていないパラメータもありますので、ご注意ください。

Authorizations:
BearerAuth
Request Body schema: application/json
model
required
string

利用する埋め込みモデル名。利用可能なモデルはコントロールパネル等をご確認ください。

required
string or Array of strings

Responses

Request samples

Content type
application/json
{
  • "model": "string",
  • "input": "string"
}

Response samples

Content type
application/json
{
  • "model": "multilingual-e5-large",
  • "data": [
    ]
}

Create speech (text-to-speech)

テキストから音声を生成します(TTS)。

  • 必須: input, model
  • instructionsは指定できますが現在は無視されます
  • response_formatは指定できますが現在は常にwavを返します
  • streamは非対応です(stream_formatを指定してもストリーミングにはなりません)
Authorizations:
BearerAuth
Request Body schema: application/json
model
required
string

音声合成モデル識別子(例:zundamon) 利用可能なmodelはコントロールパネル等をご確認ください。

input
required
string [ 1 .. 1000 ] characters

音声合成するテキスト(最大1000文字程度)

voice
string

話者/スタイル(例:normal) 利用可能なvoiceはコントロールパネル等をご確認ください。

instructions
string

追加指示(例: 話し方のトーンなど)。 ※現在は指定できますが無視されます。

response_format
string
Default: "wav"
Enum: "wav" "mp3" "ogg" "aac" "flac"

出力フォーマット。 ※現在は指定できますが常にwavを返します。

stream_format
string
Enum: "sse" "jsonl"

ストリーム形式。 ※現在は指定できますが無視されます。

Responses

Request samples

Content type
application/json
{
  • "model": "zundamon",
  • "voice": "normal",
  • "input": "こんにちは。",
  • "instructions": "落ち着いたトーンで話して",
  • "response_format": "wav",
  • "stream_format": "sse"
}

Create audio query (TTS)

音声合成用のクエリ(JSON)を作成します。
典型的には、/tts/v1/audio_queryでクエリを作成し、/tts/v1/synthesisに渡して音声(wav)を生成します。
このAPIはVOICEVOX Engine APIの/audio_query仕様を参考にした互換インターフェースを提供します。
公式仕様: https://voicevox.github.io/voicevox_engine/api/

Authorizations:
BearerAuth
query Parameters
text
required
string [ 1 .. 1000 ] characters

音声合成するテキスト

speaker
required
integer >= 0

話者/スタイルID(利用可能な値はコントロールパネル等をご確認ください)

enable_katakana_english
boolean
Default: true

カタカナ英語を有効にする。

core_version
string

音声合成のバージョン指定。 ※現在は指定できますが無視されます。

Responses

Response samples

Content type
application/json
{
  • "accent_phrases": [ ],
  • "speedScale": 1,
  • "pitchScale": 0,
  • "intonationScale": 1,
  • "volumeScale": 1,
  • "prePhonemeLength": 0.1,
  • "postPhonemeLength": 0.1,
  • "outputSamplingRate": 24000,
  • "outputStereo": false,
  • "kana": ""
}

Synthesize speech from audio query (TTS)

音声合成を行います。
/tts/v1/audio_query で作成したクエリ(JSON)をリクエストボディに渡して、音声(wav)を生成します。
このAPIはVOICEVOX Engine APIの/synthesis仕様を参考にした互換インターフェースを提供します。
公式仕様: https://voicevox.github.io/voicevox_engine/api/

Authorizations:
BearerAuth
query Parameters
speaker
required
integer >= 0

話者/スタイルID(利用可能な値はコントロールパネル等をご確認ください)

enable_interrogative_upspeak
boolean
Default: true

疑問系のテキストが与えられたら語尾を自動調整する

core_version
string

Core Version。 ※現在は指定できますが無視されます。

Request Body schema: application/json
required
Array of objects

アクセント句のリスト

speedScale
required
number

全体の話速

pitchScale
required
number

全体の音高

intonationScale
required
number

全体の抑揚

volumeScale
required
number

全体の音量

prePhonemeLength
required
number

音声の前の無音時間

postPhonemeLength
required
number

音声の後の無音時間

number or null

句読点などの無音時間。nullのときは無視される。デフォルト値はnull

pauseLengthScale
number
Default: 1

句読点などの無音時間(倍率)。デフォルト値は1

outputSamplingRate
required
integer

音声データの出力サンプリングレート

outputStereo
required
boolean

音声データをステレオ出力するか否か

kana
required
string

読み(かな)。 [読み取り専用] AquesTalk風記法によるテキスト。音声合成用のクエリとしては無視される

property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "accent_phrases": [ ],
  • "speedScale": 1,
  • "pitchScale": 0,
  • "intonationScale": 1,
  • "volumeScale": 1,
  • "prePhonemeLength": 0.1,
  • "postPhonemeLength": 0.1,
  • "pauseLength": null,
  • "pauseLengthScale": 1,
  • "outputSamplingRate": 24000,
  • "outputStereo": false,
  • "kana": "string"
}