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

# REST with API key auth

> Convert speech to text using the REST API

Convert audio to text with support for multiple languages and context awareness. Use your API key for authentication.

### Request Body

<ParamField body="audio" type="string" required>
  Base64 encoded, 16kHz wav audio. Maximum size is 25MB or 6 minutes of audio.
</ParamField>

<ParamField body="language" type="array">
  Optional list of (ISO 639-1) language codes that the user is expected to speak.

  Setting the list size to 1 forces the transcription into the specified language. Not providing an input attempts autodetection on full list of languages (less accurate).
</ParamField>

<ParamField body="context" type="object">
  Optional contextual information about the circumstances surrounding the user dictation.

  Flow can use these information to make its output more accurate by for example, getting names right, resolving speech ambiguities, etc.

  All properties are optional and will use default values if not provided.

  <Info>
    See [Request Schema](/request_schema) page for an exhaustive list of context attributes.
  </Info>
</ParamField>

<ParamField body="properties" type="object" deprecated>
  Legacy API schema for providing context. Use the equivalent fields in the `context` field instead. If both `context` and `properties` are provided, `properties` will be ignored.

  <Info>
    See [Request Schema](/request_schema) page for an exhaustive list of properties.
  </Info>
</ParamField>

<ResponseExample>
  ```json Response (200 OK) theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "text": "Testing testing 1, 2, 3",
    "detected_language": "en",
    "total_time": 432,
    "generated_tokens": 9
  }
  ```
</ResponseExample>

<RequestExample>
  ```json Request theme={null}
  {
    "audio": "UklGRiQA....",
    "language": ["en"],
    "context": {
      "app": {
        "type": "email"
      },
      "dictionary_context": [],
      "textbox_contents": {
        "before_text": "",
        "selected_text": "",
        "after_text": ""
      },
      // ... for a full list of available fields, see the "Request Schema" page
    }
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /api
openapi: 3.1.0
info:
  title: Flow Voice API
  description: Speech-to-text API with advanced context awareness and language detection
  version: 1.0.0
servers:
  - url: https://platform-api.wisprflow.ai/api/v1/dash
    description: Production server
security: []
paths:
  /api:
    post:
      summary: Convert speech to text
      description: >-
        Transcribe audio with support for multiple languages and context
        awareness
      operationId: transcribeAudio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - audio
                - properties
              properties:
                audio:
                  type: string
                  description: >-
                    base64 encoded, 16kHz wav audio. Max size is 25MB / 6
                    minutes of audio
                  example: UklGRiQA....
                properties:
                  type: object
                  description: Additional configuration properties for the transcription
                  properties:
                    language:
                      type: string
                      description: 2-digit ISO language code
                      example: en
                      default: en
                    app_type:
                      type: string
                      enum:
                        - ai
                        - email
                        - other
                      description: >-
                        Flow formats appropriately depending on if the user is
                        prompting AI, writing an email, or other tasks.
                      default: other
                    dictionary:
                      type: array
                      items:
                        type: string
                      description: >-
                        List of dictionary words to help with transcription
                        accuracy
                      default: []
                    after_text:
                      type: string
                      description: >-
                        The text immediately after the cursor. Flow uses it to
                        decide spacing / punctuation.
                      default: ''
                    before_text:
                      type: string
                      description: >-
                        The text immediately before the cursor. Flow uses it to
                        decide spacing / punctuation.
                      default: ''
                    selected_text:
                      type: string
                      description: >-
                        The text the user has highlighted. Flow uses it to
                        decide spacing / punctuation.
                      default: ''
      responses:
        '200':
          description: Successful transcription
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier for the transcription
                    example: 550e8400-e29b-41d4-a716-446655440000
                  text:
                    type: string
                    description: The transcribed text with formatting
                    example: Testing testing 1, 2, 3
                  detected_language:
                    type: string
                    description: Detected language code
                    example: en
                  total_time:
                    type: integer
                    description: Total processing time in milliseconds
                    example: 432
                  generated_tokens:
                    type: integer
                    description: Number of tokens used
                    example: 9
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: No audio data provided!
        '401':
          description: Unauthorized
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Audio file size exceeds 25MB limit
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Error running inference
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: <API Key>

````