Grok Voice
xai/grok-voiceGrok Voice listens to a recording of a user's speech and replies as a Grok voice agent with spoken audio and its transcript. Optional instructions set the agent's persona, and 28 built-in xAI voices are available.
- 基本料金
- $0.02USD / 実行
- 実行
- async
- モデルタイプ
- audio
- 入力フィールド
- 3
モデルを試す
プレイグラウンド
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
モデルカード
仕様
料金
- 基本価格
- $0.02 / 実行
コンテキストとモダリティ
- 入力
- スキーマ定義済み
- 出力
- audio
機能
- チャット
- 非対応
- ビジョン
- 非対応
- 推論
- 非対応
- 構造化出力
- 非対応
- 関数呼び出し
- 非対応
- 音声入力
- 非対応
アクセス
- 提供元
- xAI
- モデル ID
- xai/grok-voice
- 実行
- async
- ベース URL
- https://api.sandbase.ai
- API
- Unified Run API
- エンドポイント
- /v1/run
API README
Grok Voice
Grok Voice turns a spoken question (up to 10 minutes) into a spoken Grok reply plus its transcript, with 28 built-in voices.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
audio | audio file or URL, required | — | User speech, up to 10 minutes and 50 MB. |
prompt | string | — | Persona and context for the agent; omit for Grok's default. |
voice | string | — | Reply voice; omit for Grok's default. See the schema for supported values. |
Output
| Field | Notes |
|---|---|
url | Spoken reply (WAV, 24 kHz mono). |
content_type | MIME type of the reply. |
text | Transcript of the reply (empty when not provided). |
duration | Reply length in seconds. |
Billing
$0.00083 per second of the spoken reply (about $0.05 per minute), using the measured reply length. The quote before submission assumes a 30-second reply.
| Reply | Price |
|---|---|
| 10 s | $0.0083 |
| 30 s | $0.0249 |
| 60 s | $0.0498 |
Failed runs are not charged.
Prompting
- Keep the persona short and say how long answers should be.
Also on SandBase
Related: xai/grok-tts.
開発を始める
最初のリクエストを送信
統一認証と使用状況の追跡を備えたOpenAI互換エンドポイントです。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "xai/grok-voice",
"audio": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav",
"prompt": "You are a friendly assistant. Answer briefly and concretely."
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"入力スキーマ
3件のパラメータ · 必須 1件 · 任意 2件
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
audio | string | 必須 | Audio file or URL with the user's speech. Most common formats are supported; maximum duration 10 minutes, maximum file size 50 MB. |
voice | string | 任意 | Built-in xAI voice for the agent's reply. Uses Grok's default voice when omitted. · オプション: carina, zagan, helix, orion, luna, iris, altair, zenith, perseus, helios, lux, kepler, rigel, cosmo, celeste, ursa, sirius, lumen, castor, naksh, atlas, aurora, liora, ara, eve, leo, rex, sal carinazaganhelixorionlunairisaltairzenithperseusheliosluxkeplerrigelcosmocelesteursasiriuslumencastornakshatlasauroralioraaraeveleorexsal |
prompt | string | 任意 | Optional instructions describing the agent's persona and conversation context (up to 20,000 characters). Uses Grok's default persona when omitted. · 最大長: 20000 |
出力スキーマ
| フィールド | 型 | 説明 |
|---|---|---|
id | string | 生成タスクの一意な識別子 |
status | string | タスクのステータス: pending, running, completed, failed, timeout |
model | string | 生成に使用されたモデル |
outputs | array | 出力項目の配列 |
outputs[].url | string | 生成された成果物のURL |
outputs[].content_type | string | MIMEタイプ(例: image/png, video/mp4) |
error | object | null | 失敗時のエラー詳細。成功時は null |
error.type | string | 機械可読なエラー種別コード |
error.message | string | 人間が読めるエラー説明 |
非同期ワークフロー
このモデルは非同期で実行されます。リクエストを送信し、その後結果をポーリングしてください。
- 送信:/v1/run に POST し、返された
idを読み取ります。 - ポーリング:ステータスが
completed、failed、またはtimeoutになるまで /v1/run/{id} に GET します。 - 取得:完了レスポンスから
outputsを読み取ります。
モデルを選ぶ
モデルを比較
| モデル | 種類 | 通常価格 | 公開日 |
|---|---|---|---|
Grok Voiceこのモデル xAI | 音声 | $0.02 / 回 | 2026年9月16日 |
xAI | 音声 | $0.01 / 回 | 2026年3月17日 |
質問
FAQ
SandBase 経由で xAI Grok Voice を呼び出すにはどうすればよいですか?
SandBase API key を作成し、モデル ID「xai/grok-voice」を使用して https://api.sandbase.ai の Unified Run API (/v1/run) にリクエストを送信してください。このページのリクエスト例に、正確なペイロードが示されています。
別途 xAI アカウントは必要ですか?
いいえ。SandBase の API key と残高が 1つあれば、xAI Grok Voice とカタログ内の他のモデルを利用できます。xAI に別途登録する必要はありません。
