> ## Documentation Index
> Fetch the complete documentation index at: https://assembly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create temporary authentication token for Streaming STT

> Create a temporary authentication token for Streaming Speech-to-Text



## OpenAPI

````yaml post /v2/realtime/token
openapi: 3.1.0
info:
  title: AssemblyAI API
  description: AssemblyAI API
  version: 1.3.4
  termsOfService: https://www.assemblyai.com/legal/terms-of-service
  contact:
    name: API Support
    email: support@assemblyai.com
    url: https://www.assemblyai.com/docs/
servers:
  - url: https://api.assemblyai.com
    description: AssemblyAI API
security:
  - ApiKey: []
tags:
  - name: transcript
    description: Transcript related operations
    externalDocs:
      url: https://www.assemblyai.com/docs/guides/transcribing-an-audio-file
  - name: LeMUR
    description: LeMUR related operations
    externalDocs:
      url: >-
        https://www.assemblyai.com/docs/guides/processing-audio-with-llms-using-lemur
  - name: streaming
    description: Streaming Speech-to-Text
    externalDocs:
      url: https://www.assemblyai.com/docs/speech-to-text/streaming
paths:
  /v2/realtime/token:
    post:
      tags:
        - streaming
      summary: Create temporary authentication token for Streaming STT
      description: Create a temporary authentication token for Streaming Speech-to-Text
      operationId: createTemporaryToken
      requestBody:
        description: Params to create a temporary authentication token
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRealtimeTemporaryTokenParams'
      responses:
        '200':
          description: Temporary authentication token generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeTemporaryTokenResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  schemas:
    CreateRealtimeTemporaryTokenParams:
      x-label: Create Streaming STT temporary token parameters
      type: object
      x-fern-sdk-group-name: realtime
      additionalProperties: false
      properties:
        expires_in:
          x-label: Expires in
          description: The amount of time until the token expires in seconds
          type: integer
          minimum: 60
      required:
        - expires_in
      example:
        expires_in: 480
    RealtimeTemporaryTokenResponse:
      x-label: Streaming STT temporary token response
      type: object
      x-fern-sdk-group-name: realtime
      additionalProperties: false
      required:
        - token
      properties:
        token:
          x-label: Temporary authentication token
          description: The temporary authentication token for Streaming Speech-to-Text
          type: string
      example:
        token: fe4145dd1e7a2e149488dcd2d553a8018a89833fc5084837d66fd1bcf5a105d4
    Error:
      x-label: Error
      type: object
      additionalProperties: true
      required:
        - error
      properties:
        error:
          x-label: Error message
          description: Error message
          type: string
        status:
          x-label: Status
          type: string
          const: error
      example:
        error: format_text must be a Boolean
  responses:
    BadRequest:
      x-label: Bad request
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This is a sample error message
    Unauthorized:
      x-label: Unauthorized
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Authentication error, API token missing/invalid
    NotFound:
      x-label: Not found
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not found
    TooManyRequests:
      x-label: Too many requests
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too Many Requests
      headers:
        Retry-After:
          description: The number of seconds to wait before retrying the request
          schema:
            type: integer
    InternalServerError:
      x-label: Internal server error
      description: An error occurred while processing the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal Server Error
    ServiceUnavailable:
      x-label: Service unavailable
      description: Service unavailable
    GatewayTimeout:
      x-label: Gateway timeout
      description: Gateway timeout
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

````