> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Openai Realtime

> Low-latency speech-to-speech over a WebSocket using the OpenAI Realtime GA event protocol. Connect with `wss://api.acedata.cloud/v1/realtime?model=gpt-realtime` and an `Authorization: Bearer <token>` header (browsers pass `realtime, acedata-token.<token>` via `Sec-WebSocket-Protocol`). Client and server exchange Realtime JSON events (`session.update`, `input_audio_buffer.append`, `response.create`, `response.output_audio.delta`, `response.done`, ...). The relay fixes the connection model, pcm16 @ 24kHz mono transport, output voice, transcription, and noise-reduction settings; choose the model and voice when connecting. A `session.update` may change GA fields `instructions`, `tools`, `tool_choice`, `output_modalities`, `include`, `prompt`, `reasoning`, `parallel_tool_calls`, `tracing`, `truncation`, may lower `max_output_tokens` from the platform cap, and may set `audio.input.turn_detection` to `null`, `server_vad`, or `semantic_vad` with their documented controls. It preserves the optional client `event_id`. Attempts to change fixed fields, exceed the output-token cap, use legacy beta fields, or send unknown fields return a recoverable `error` event; the top-level `event_id` uniquely identifies the server error event, while `error.event_id` contains the original client event ID when supplied, and `error.param` identifies the rejected field. The WebSocket remains open. Billed per assistant turn from `response.done.usage` (audio and text tokens priced separately).



## OpenAPI

````yaml /openapi/openai.json get /v1/realtime
openapi: 3.0.0
info:
  title: OpenAI generation
  version: 1.0.0
  description: API reference for OpenAI generation on Ace Data Cloud.
servers:
  - url: https://api.acedata.cloud
    description: Ace Data Cloud API
security:
  - bearerAuth: []
paths:
  /v1/realtime:
    get:
      summary: Openai Realtime
      description: >-
        Low-latency speech-to-speech over a WebSocket using the OpenAI Realtime
        GA event protocol. Connect with
        `wss://api.acedata.cloud/v1/realtime?model=gpt-realtime` and an
        `Authorization: Bearer <token>` header (browsers pass `realtime,
        acedata-token.<token>` via `Sec-WebSocket-Protocol`). Client and server
        exchange Realtime JSON events (`session.update`,
        `input_audio_buffer.append`, `response.create`,
        `response.output_audio.delta`, `response.done`, ...). The relay fixes
        the connection model, pcm16 @ 24kHz mono transport, output voice,
        transcription, and noise-reduction settings; choose the model and voice
        when connecting. A `session.update` may change GA fields `instructions`,
        `tools`, `tool_choice`, `output_modalities`, `include`, `prompt`,
        `reasoning`, `parallel_tool_calls`, `tracing`, `truncation`, may lower
        `max_output_tokens` from the platform cap, and may set
        `audio.input.turn_detection` to `null`, `server_vad`, or `semantic_vad`
        with their documented controls. It preserves the optional client
        `event_id`. Attempts to change fixed fields, exceed the output-token
        cap, use legacy beta fields, or send unknown fields return a recoverable
        `error` event; the top-level `event_id` uniquely identifies the server
        error event, while `error.event_id` contains the original client event
        ID when supplied, and `error.param` identifies the rejected field. The
        WebSocket remains open. Billed per assistant turn from
        `response.done.usage` (audio and text tokens priced separately).
      operationId: openaiRealtime
      parameters:
        - name: model
          in: query
          required: true
          description: >-
            Realtime model to use. Use gpt-realtime-2.1 for best quality or
            gpt-realtime-2.1-mini for lower cost. Older stable model IDs remain
            available for compatibility.
          schema:
            type: string
            enum:
              - gpt-realtime-2.1
              - gpt-realtime-2.1-mini
              - gpt-realtime-2
              - gpt-realtime
              - gpt-realtime-mini
            default: gpt-realtime-2.1
        - name: voice
          in: query
          required: false
          description: Output voice selected when the connection is established.
          schema:
            type: string
            enum:
              - alloy
              - ash
              - ballad
              - coral
              - echo
              - sage
              - shimmer
              - verse
              - marin
              - cedar
            default: alloy
      responses:
        '101':
          description: Switching Protocols — WebSocket established.
        '401':
          description: Unauthorized — missing or invalid bearer token.
        '403':
          description: Insufficient balance.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from https://platform.acedata.cloud

````