---
title: "Create voice session"
method: POST
path: "/api/experimental/voice/session"
tags: ["voice"]
---

# Create voice session

`POST /api/experimental/voice/session`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/experimental/voice/session`
- Auth: none required

Create a server-brokered voice session using the server's configured provider credentials and return the WebRTC SDP answer or WebSocket ephemeral token.

## Request body

- object
  - `model` string, required
  - `session` object, nullable
  - `transport` union, required
    - VoiceWebRTCTransportInput
      - `type` 'webrtc', required
      - `sdp` string, required
      - `dcid` union
        - number
        - 'Infinity' | '-Infinity' | 'NaN'
    - VoiceWebSocketTransportInput
      - `type` 'websocket', required

## Response `200`

VoiceSessionResponse

- VoiceSessionResponse
  - `data` object, required
    - `transport` union, required
      - VoiceWebRTCTransport
        - `type` 'webrtc', required
        - `sdp` string, required
      - VoiceWebSocketTransport
        - `type` 'websocket', required
        - `url` string, required
        - `token` string, required
        - `expiresAt` union, required
          - number
          - 'Infinity' | '-Infinity' | 'NaN'

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: LocationNotFoundError
- `503`: ServiceUnavailableError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-23** `ac94df0cef06`: 1 warning
  - removed the optional property `data/session` from the response with the `200` status
- **2026-10-21** `7709eeb4cfb8`: 1 info
  - added the optional property `data/session` to the response with the `200` status
- **2026-10-16** `f218d1138886`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/experimental/voice/session/post.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
