Gemini Omni キャラクター作成
create characterエンドポイントを使用して、同じレスポンスで結果を受け取ってください。
概要
create characterエンドポイントを使用し、同じレスポンスから結果を読み取ってください。
クイックスタート
- APIキーを作成し、RUNAPI_API_KEYとして設定します。
- 本文がリクエストスキーマと一致するPOSTリクエストを送信します。
- 成功レスポンスのボディから結果を読み取る。
エンドポイント
- ベースURL
https://runapi.ai- API バージョン
v1- 認証
Authorization: Bearer YOUR_API_TOKEN
サポートされているモデル
現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。
リクエストスキーマ
このエンドポイントで宣言されたフィールドのみを送信してください。
gemini-omni-characterフィールド5件
audio_idsarraycreate-audioが返すオーディオプリセットID。
body_reference_image_urlstring省略可能な公開全身リファレンス画像 URL。reference_image_url はポートレートを提供する必要があります。
character_namestringキャラクターの表示名。
範囲(固定):210
descriptionsstringキャラクターの外見、アイデンティティ、スタイル、服装、または個性の説明。
範囲(固定):20000
reference_image_urlstring公開ポートレートリファレンス画像 URL。
成功レスポンス
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"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
},
"character": {
"properties": {
"id": {
"description": "作成されたキャラクターの識別子。",
"type": "string"
},
"images": {
"description": "順序付きのキャラクターリファレンス画像。最初にポートレート、次に省略可能な全身画像。",
"items": {
"properties": {
"url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"required": [
"url"
],
"type": "object",
"unevaluatedProperties": false
},
"maxItems": 2,
"type": "array"
},
"name": {
"description": "キャラクターの表示名。",
"type": "string"
}
},
"required": [
"id"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"description": "作成されたキャラクターの識別子。",
"type": "string"
}
},
"required": [
"id",
"character",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"character": {
"id": "chr_reference_presenter",
"images": [
{
"url": "https://cdn.runapi.ai/public/samples/portrait.jpg"
},
{
"url": "https://cdn.runapi.ai/public/samples/image.jpg"
}
],
"name": "Studio Presenter"
},
"id": "chr_reference_presenter"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Authentication required"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"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
}
]
}
レスポンス例
{
"error": "Validation failed",
"errors": {
"descriptions": [
"is required"
]
}
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Insufficient balance"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "API key credit limit exceeded"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request uses features that are not supported for the selected model"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Rate limit reached. Please retry later."
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Service under maintenance, please try again later"
}
エラー
POST /api/v1/gemini_omni/create_character
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request timed out"
}
生成されたコードサンプル
cURLを直接使用するか、お使いの言語向けのSDKをインストールしてください。各サンプルは、このリファレンスに示されたバリデーション済みリクエストを送信します。
インストール
pip install runapi-gemini-omni
import os
from runapi.gemini_omni import GeminiOmniClient
client = GeminiOmniClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.create_character.run(
descriptions="A presenter wearing a blue jacket in a bright studio.",
reference_image_url="https://cdn.runapi.ai/public/samples/portrait.jpg",
body_reference_image_url="https://cdn.runapi.ai/public/samples/image.jpg",
character_name="Studio Presenter"
)