APIリファレンス
Gemini Omni 音声作成
create audioエンドポイントを使用して、同じレスポンスで結果を受け取ってください。
01
概要
create audioエンドポイントを使用し、同じレスポンスから結果を読み取ってください。
クイックスタート
- APIキーを作成し、RUNAPI_API_KEYとして設定します。
- 本文がリクエストスキーマと一致するPOSTリクエストを送信します。
- 成功レスポンスのボディから結果を読み取る。
エンドポイント
- ベースURL
https://runapi.ai- API バージョン
v1- 認証
Authorization: Bearer YOUR_API_TOKEN
02
サポートされているモデル
現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。
03
JSONボディリクエストスキーマ
このエンドポイントで宣言されたフィールドのみを送信してください。
gemini-omni-audioフィールド4件
audio_idstring
必須
オーディオプリセットに使用される音声アイデンティティ。
example_dialoguestring
任意
音声スタイルを示すサンプルダイアログ。
範囲(固定):120
namestring
必須
オーディオプリセットの表示名。
範囲(固定):210
voice_descriptionstring
任意
ピッチ、トーン、アクセントなどの声の特性。
範囲(固定):20000
04
HTTP 200成功レスポンス
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"audio": {
"properties": {
"id": {
"description": "作成されたオーディオプリセットの識別子。",
"type": "string"
},
"name": {
"description": "オーディオプリセットの表示名。",
"type": "string"
}
},
"required": [
"id"
],
"type": "object",
"unevaluatedProperties": false
},
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"description": "作成されたオーディオプリセットの識別子。",
"type": "string"
}
},
"required": [
"id",
"audio",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"audio": {
"id": "aud_reference_narrator",
"name": "Studio Narrator"
},
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "aud_reference_narrator"
}
05
HTTP 401エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "Authentication required"
}
06
HTTP 400エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"oneOf": [
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "人間が読める形式のバリデーションサマリー。",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "公開リクエストフィールドをキーとするバリデーションメッセージ。各フィールドに対して人間が読める文字列の配列が含まれます。",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
レスポンス例
JSON
{
"error": "Validation failed",
"errors": {
"audio_id": [
"is required"
]
}
}
07
HTTP 402エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "Insufficient balance"
}
08
HTTP 429エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "API key credit limit exceeded"
}
09
HTTP 409エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "The request uses features that are not supported for the selected model"
}
10
HTTP 429エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "Rate limit reached. Please retry later."
}
11
HTTP 503エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "Service under maintenance, please try again later"
}
12
HTTP 504エラー
POST /api/v1/gemini_omni/create_audio
レスポンススキーマ
JSON
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
JSON
{
"error": "The request timed out"
}
13
生成されたコードサンプル
cURLを直接使用するか、お使いの言語向けのSDKをインストールしてください。各サンプルは、このリファレンスに示されたバリデーション済みリクエストを送信します。
インストール
Shell
pip install runapi-gemini-omni
PYTHON
import os
from runapi.gemini_omni import GeminiOmniClient
client = GeminiOmniClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.create_audio.run(
audio_id="achernar",
name="Studio Narrator",
voice_description="A calm and clear narration voice.",
example_dialogue="Welcome to the studio."
)