PopNowAPI ドキュメント
本文

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, cedarPreset speaking voice; select before the first audio response.
reasoning_effort任意string—minimal, low, medium, high, xhighReasoning effort for the spoken response; reasoning consumes output tokens.
output_format任意string—pcm, g711_ulaw, g711_alawLive playback encoding; single-response tasks return a matching WAV container.
speed任意number10.25〜1.5Speaking-speed multiplier for output audio.
max_tokens任意integer51216〜32000Per-turn output cap, including reasoning, text and audio tokens.
max_context_tokens任意integer4096512〜123888Retained-history cap; this, the 4096-token instruction allowance and output must fit 128000.
audio_input_format任意stringpcmpcm, g711_ulaw, g711_alawEncoding of live microphone samples; PCM is 24 kHz mono 16-bit, G.711 is 8 kHz.
audio_noise_reduction任意stringnear_fieldnear_field, far_field, noneInput 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 に設定してください。

POST /api/v1/jobs/createTask
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 を付けて通知を受け取ります。

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

次に読む

このページの内容