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

# Create a translation room

> Create a live translation room.

**Languages are not set here.** Each participant declares their own when you request
their join token, so you can create a room before knowing who will be in it or what
they speak. The translator joins on its own once the room holds two languages, and
leaves when fewer than two remain — you never dispatch or dismiss it yourself.

The response carries the room's `id`, for looking up its usage later, and the realtime
`url` your clients connect to. Get a token for each participant, including the first,
from `POST /v1/rooms/{room_name}/token`.

`room_name` must be unique among rooms that are currently live; reusing the name
of a live room returns 409. Omit it to have one generated.

`streaming_mode` records how the room's audio will arrive — `mono` when both languages
come from one device, `dual` when each speaker has their own. It is optional: omit it
and the room's **first join token** decides, by how many languages it asks for. Either
way the mode is fixed for the room's lifetime and every later join token must match it.

Requires credit: a room cannot be started while the organization's balance is at
or below zero, and the request returns 402 if it is. A call already in progress is
never cut off, so a long room can run the balance negative.



## OpenAPI

````yaml https://api.staging.glot.com/openapi.json post /v1/rooms
openapi: 3.1.0
info:
  title: glot-api
  version: 0.1.0
servers: []
security: []
tags:
  - name: rooms
    description: Create translation rooms and let participants join them.
  - name: usage
    description: Minutes and charges over time, for reporting and charts.
  - name: billing
    description: Buy prepaid credit and review the balance behind it.
  - name: api-keys
    description: Create and revoke keys used to authenticate requests.
  - name: supported-languages
    description: Languages available for translation.
  - name: users
    description: The authenticated user's own profile.
paths:
  /v1/rooms:
    post:
      tags:
        - rooms
      summary: Create a translation room
      description: >-
        Create a live translation room.


        **Languages are not set here.** Each participant declares their own when
        you request

        their join token, so you can create a room before knowing who will be in
        it or what

        they speak. The translator joins on its own once the room holds two
        languages, and

        leaves when fewer than two remain — you never dispatch or dismiss it
        yourself.


        The response carries the room's `id`, for looking up its usage later,
        and the realtime

        `url` your clients connect to. Get a token for each participant,
        including the first,

        from `POST /v1/rooms/{room_name}/token`.


        `room_name` must be unique among rooms that are currently live; reusing
        the name

        of a live room returns 409. Omit it to have one generated.


        `streaming_mode` records how the room's audio will arrive — `mono` when
        both languages

        come from one device, `dual` when each speaker has their own. It is
        optional: omit it

        and the room's **first join token** decides, by how many languages it
        asks for. Either

        way the mode is fixed for the room's lifetime and every later join token
        must match it.


        Requires credit: a room cannot be started while the organization's
        balance is at

        or below zero, and the request returns 402 if it is. A call already in
        progress is

        never cut off, so a long room can run the balance negative.
      operationId: create_room_v1_rooms_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRoomRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRoomResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateRoomRequest:
      properties:
        room_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Room Name
          description: >-
            Optional. A name for the room, which must not be in use by another
            room that is currently live. **Omit it and a unique name is
            generated**, returned as `room` in the response.
          examples:
            - standup
        streaming_mode:
          anyOf:
            - $ref: '#/components/schemas/StreamingMode'
            - type: 'null'
          description: >-
            Optional. How this room's audio will reach the translator:


            - `mono` — both languages come from the same device, such as two
            colleagues sharing one phone.

            - `dual` — each speaker joins from their own device.


            **Omit it and the first join token decides**: a token requesting two
            languages makes the room `mono`, one language makes it `dual`.
            Either way the mode is fixed for the room's lifetime, and every
            later join token must match it or the request returns 409 — so set
            it here when you already know, to get that error on the room instead
            of on your first token.
          examples:
            - dual
      type: object
      title: CreateRoomRequest
      description: >-
        Request to create a translation room.


        Nothing is required. Languages are **not** set here — each participant
        declares their

        own when you request their join token, so a room can be created before
        anyone has

        chosen one.
    CreateRoomResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        room:
          type: string
          title: Room
        url:
          type: string
          title: Url
        streaming_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Streaming Mode
      type: object
      required:
        - id
        - room
        - url
        - streaming_mode
      title: CreateRoomResponse
      description: >-
        A created room, ready for participants.


        Creating a room does not issue any credentials — get a join token for
        each

        participant from `POST /v1/rooms/{room_name}/token`, which is also where
        that

        participant's languages are set. Use `id` to look the room and its usage
        up later.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StreamingMode:
      type: string
      enum:
        - mono
        - dual
      title: StreamingMode
      description: >-
        How a room's audio reaches the duplex model.


        A property of the **model's** wire contract, not a policy of ours — it
        supports these

        two modes and no others — which is why it lives here beside the rest of
        the API↔worker

        contract rather than in either deployable. The API validates a caller's
        choice against

        this enum at its boundary, exactly as it does for ``LanguageCode``; the
        worker will read

        the same values back off a dispatch, and one definition is what stops
        the two sides

        disagreeing about a mode's spelling.


        * ``MONO`` — both languages arrive on a single uplink, because both
        speakers share one
          device.
        * ``DUAL`` — each speaker has their own device, so each language arrives
        on its own
          track.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````