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

# Generate streaming token

> Generates a temporary authentication token for use with streaming services. See [Authenticate with a temporary token](https://www.assemblyai.com/docs/streaming/authenticate-with-a-temporary-token) for more details.




## OpenAPI

````yaml api-reference/specs/streaming-token.yaml GET /v3/token
openapi: 3.0.3
info:
  title: AssemblyAI Streaming Token API
  description: API for generating temporary authentication tokens for streaming services
  version: 1.0.0
  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://streaming.assemblyai.com
    description: Production server
    x-fern-server-name: Default
security: []
paths:
  /v3/token:
    get:
      summary: Generate temporary streaming token
      description: >
        Generates a temporary authentication token for use with streaming
        services. See [Authenticate with a temporary
        token](https://www.assemblyai.com/docs/streaming/authenticate-with-a-temporary-token)
        for more details.
      operationId: generateStreamingToken
      parameters:
        - name: expires_in_seconds
          in: query
          description: >
            Token redemption window, in seconds. The token must be used to open
            a WebSocket connection within this window. If the window has elapsed
            when the WebSocket is opened, the server rejects the session on the
            first frame. This does NOT cap the duration of the resulting
            streaming session — once the WebSocket is open the session runs for
            up to `max_session_duration_seconds`.
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 600
            example: 60
        - name: max_session_duration_seconds
          in: query
          description: >
            Maximum duration of the streaming session started with this token,
            in seconds. If you need to finalize work before the session ends,
            run a client-side timer using the value you passed here.
          required: false
          schema:
            type: integer
            minimum: 60
            maximum: 10800
            example: 600
            default: 10800
      responses:
        '200':
          description: Successfully generated temporary token
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - expires_in_seconds
                properties:
                  token:
                    type: string
                    description: The temporary authentication token
                    example: your-temporary-token
                  expires_in_seconds:
                    type: integer
                    description: >
                      The token redemption window in seconds — the time the
                      client has to use this token to open a WebSocket before it
                      expires unused. This is not the session duration; see
                      `max_session_duration_seconds` for that.
                    example: 60
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        code:
          type: string
          description: Error code for programmatic handling
        details:
          type: object
          description: Additional error details if available
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Your AssemblyAI API key

````