apicheats.dev openai/llms.txt Raw .md
POST

POST /realtime/client_secrets — OpenAI API

OpenAI API key (required); https://api.openai.com/v1

OpenAI API

Create client secret

Base URL
https://api.openai.com/v1
Auth
Authorization: Bearer <OPENAI_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 208 tokens · Vary: Accept

Critical gotchas

The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.

Audio transcription uploads use multipart form data rather than a JSON request body.

cURL

curl -X POST 'https://api.openai.com/v1/realtime/client_secrets' \  -H "Authorization: Bearer $OPENAI_API_KEY" \  -H 'Content-Type: application/json' \  -d '{}'

Parameters

Name In Type Required Description
expires_after body object No Configuration for the client secret expiration. Expiration refers to the time after which a client secret will no longer be valid for creating sessions. The session itself may continue after that time once started. A secret can be used to create multiple sessions until it expires.
session body object No Session configuration to use for the client secret. Choose either a realtime session or a transcription session.

Response 200 OK

{
  "value": "string",
  "expires_at": 0,
  "session": {
    "type": "realtime",
    "id": "string",
    "object": "realtime.session",
    "expires_at": 0,
    "output_modalities": [
      "audio"
    ],
    "model": "string",
    "instructions": "string",
    "audio": {
      "input": {
        "format": {
          "type": "audio/pcm",
          "rate": 24000
        },
        "transcription": {
          "model": "string",
          "language": "string",
          "languages": [
            "[recursive or deeply nested schema]"
          ],
          "prompt": "string"
        },
        "noise_reduction": null,
        "turn_detection": {
          "type": "server_vad",
          "threshold": 0,
          "prefix_padding_ms": 0,
          "silence_duration_ms": 0,
          "create_response": true,
          "interrupt_response": true,
          "idle_timeout_ms": 0
        }
      },
      "output": {
        "format": {
          "type": "audio/pcm",
          "rate": 24000
        },
        "voice": "ash",
        "speed": 1
      }
    },
    "include": [
      "item.input_audio_transcription.logprobs"
    ],
    "tracing": null,
    "tools": [
      {
        "type": "function",
        "name": "string",
        "description": "string",
        "parameters": {}
      }
    ],
    "tool_choice": "auto",
    "reasoning": {
      "effort": "low"
    },
    "max_output_tokens": 0,
    "truncation": "auto",
    "prompt": {
      "id": "string",
      "version": "string",
      "variables": {}
    }
  }
}
Get a free OpenAI API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.