GPT-Realtime-2.1 API リファレンス
GPT-Realtime-2.1 は発話を理解し、推論と関数呼び出しを使いながら、音声またはテキストを逐次返します。
PopNow の API キー 1 つで、GPT-Realtime-2.1 を自分のコードから呼び出せます。送るモデル ID、受け付ける入力フィールド、1 回あたりの料金(USD)、ターミナルに貼ってそのまま動くリクエストをこのページにまとめました。
パラメーターの説明はモデルの入力 schema から取っているため、英語のみです。
概要
- 開発元
- OpenAI
- 出力
- 音声
- 最安
- $0.0048 USD per_1k_tokens
料金は USD で表示され、PopNow の残高から差し引かれます。受付時に最大料金を確保し、完了後に実際の使用量で精算して差額を返却します。失敗したタスクは課金されません。実行前の正確な見積もりは POST /api/v1/jobs/quote で取得できます。
リアルタイム音声
openai/gpt-realtime-2.1/realtime
料金
| オプション | USD |
|---|---|
既定 | $0.0048 per_1k_tokens |
パラメーター
| フィールド | 型 | 既定値 | 指定できる値 | 説明 |
|---|---|---|---|---|
prompt任意 | string | — | 4,096 文字まで | Text that starts a single spoken response; live audio uses the Realtime WebSocket. |
voice_id任意 | string | — | alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, cedar | Preset speaking voice; select before the first audio response. |
reasoning_effort任意 | string | — | minimal, low, medium, high, xhigh | Reasoning effort for the spoken response; reasoning consumes output tokens. |
output_format任意 | string | — | pcm, g711_ulaw, g711_alaw | Live playback encoding; single-response tasks return a matching WAV container. |
speed任意 | number | 1 | 0.25〜1.5 | Speaking-speed multiplier for output audio. |
max_tokens任意 | integer | 512 | 16〜32000 | Per-turn output cap, including reasoning, text and audio tokens. |
max_context_tokens任意 | integer | 4096 | 512〜123888 | Retained-history cap; this, the 4096-token instruction allowance and output must fit 128000. |
audio_input_format任意 | string | pcm | pcm, g711_ulaw, g711_alaw | Encoding of live microphone samples; PCM is 24 kHz mono 16-bit, G.711 is 8 kHz. |
audio_noise_reduction任意 | string | near_field | near_field, far_field, none | Input denoising profile for a close microphone, room microphone, or preprocessed audio. |
realtime_session任意 | object | — | — | Advanced native session configuration; overlapping regular controls must agree. Function tools are executed by your application. |
リクエスト例
このリクエストはそのまま実行できます。省略したフィールドには既定値が入ります。先にキーを環境変数 POPNOW_API_KEY に設定してください。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "openai/gpt-realtime-2.1/realtime",
"input": {
"prompt": "A bright, cheerful scene with soft natural light"
}
}'レスポンスにはすぐに taskId が入ります。結果は GET /api/v1/jobs/recordInfo で取得するか、callBackUrl を付けて通知を受け取ります。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
