Riferimento API di GPT-Realtime-2.1
GPT-Realtime-2.1 comprende richieste parlate.
Con una sola chiave API di PopNow chiami GPT-Realtime-2.1 dal tuo codice. Qui trovi gli ID del modello da inviare, ogni campo di input accettato, quanto costa ogni richiesta in USD e una richiesta da incollare nel terminale così com’è.
Le descrizioni dei parametri provengono dallo schema di input del modello e sono disponibili solo in inglese.
In sintesi
- Sviluppato da
- OpenAI
- Risultato
- Audio
- Da
- $0.0048 USD per_1k_tokens
- ID del modello
I prezzi sono indicati in USD e gli importi vengono addebitati sul tuo saldo PopNow. Alla ricezione viene riservato il massimo importo; al termine viene addebitato il consumo effettivo e il resto viene sbloccato. Le attività fallite non vengono addebitate. Per un preventivo esatto prima di eseguire, usa POST /api/v1/jobs/quote.
Voce in tempo reale
openai/gpt-realtime-2.1/realtime
Prezzo
| Opzione | USD |
|---|---|
Predefinito | $0.0048 per_1k_tokens |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
promptFacoltativo | string | — | fino a 4096 caratteri | Text that starts a single spoken response; live audio uses the Realtime WebSocket. |
voice_idFacoltativo | string | — | alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, cedar | Preset speaking voice; select before the first audio response. |
reasoning_effortFacoltativo | string | — | minimal, low, medium, high, xhigh | Reasoning effort for the spoken response; reasoning consumes output tokens. |
output_formatFacoltativo | string | — | pcm, g711_ulaw, g711_alaw | Live playback encoding; single-response tasks return a matching WAV container. |
speedFacoltativo | number | 1 | da 0.25 a 1.5 | Speaking-speed multiplier for output audio. |
max_tokensFacoltativo | integer | 512 | da 16 a 32000 | Per-turn output cap, including reasoning, text and audio tokens. |
max_context_tokensFacoltativo | integer | 4096 | da 512 a 123888 | Retained-history cap; this, the 4096-token instruction allowance and output must fit 128000. |
audio_input_formatFacoltativo | 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_reductionFacoltativo | string | near_field | near_field, far_field, none | Input denoising profile for a close microphone, room microphone, or preprocessed audio. |
realtime_sessionFacoltativo | object | — | — | Advanced native session configuration; overlapping regular controls must agree. Function tools are executed by your application. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in 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"
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
