Create translation client secret
POST/realtime/translations/client_secrets
Create a Realtime translation client secret with an associated translation session configuration.
Client secrets are short-lived tokens that can be passed to a client app, such as a web frontend or mobile client, which grants access to the Realtime Translation API without leaking your main API key. You can configure a custom TTL for each client secret.
Returns the created client secret and the effective translation session object.
The client secret is a string that looks like ek_1234.
Create translation client secret
curl -X POST https://api.openai.com/v1/realtime/translations/client_secrets \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expires_after": {
"anchor": "created_at",
"seconds": 600
},
"session": {
"model": "gpt-realtime-translate",
"audio": {
"input": {
"transcription": {
"model": "gpt-realtime-whisper"
},
"noise_reduction": null
},
"output": {
"language": "es"
}
}
}
}'
{
"value": "ek_68af296e8e408191a1120ab6383263c2",
"expires_at": 1756310470,
"session": {
"id": "sess_C9CiUVUzUzYIssh3ELY1d",
"type": "translation",
"expires_at": 1756310470,
"model": "gpt-realtime-translate",
"audio": {
"input": {
"transcription": {
"model": "gpt-realtime-whisper"
},
"noise_reduction": null
},
"output": {
"language": "es"
}
}
}
}
Returns Examples
{
"value": "ek_68af296e8e408191a1120ab6383263c2",
"expires_at": 1756310470,
"session": {
"id": "sess_C9CiUVUzUzYIssh3ELY1d",
"type": "translation",
"expires_at": 1756310470,
"model": "gpt-realtime-translate",
"audio": {
"input": {
"transcription": {
"model": "gpt-realtime-whisper"
},
"noise_reduction": null
},
"output": {
"language": "es"
}
}
}
}