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

# Upload Audio

> Upload audio as a raw binary body. For `single` uploads (the default upload type), send one complete recording (max 10 MB) and the server performs Voice Activity Detection (VAD) chunking inline — for larger recordings use `chunked` uploads or the SDKs. For `chunked` uploads, call this repeatedly with sequentially numbered filenames (`audio_0.webm`, `audio_1.webm`, ...); the server stores each chunk by its sequence number. The audio content type is detected automatically from the file extension; set the `Content-Type` header only to override it.


Send audio as a **raw binary body** (not multipart, not JSON). `single`: call once with the complete file (≤10 MB) as `audio_0.webm`. `chunked`: call once per chunk, incrementing the sequence (`audio_0.webm`, `audio_1.webm`, …).

<Warning>
  This endpoint can't be tried from the browser — the docs playground can't send raw binary bodies. Use the cURL below (or any HTTP client) instead; every other EkaScribe endpoint works in the playground.
</Warning>

<Info>
  No `Content-Type` header needed — it's detected from the `file_sequence` extension (`.webm`, `.mp3`, `.wav`, `.ogg`, `.m4a`, `.mp4`).
</Info>

```bash theme={null}
curl -X POST "https://api.eka.care/voice/v1/sessions/{session_id}/audio/audio_0.mp3" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --data-binary "@/path/to/consultation.mp3"
```

When all audio is uploaded, call [End Session](/ekascribe/api-reference/sessions/end-session). For real-time streaming use [Stream Audio](/ekascribe/api-reference/sessions/stream-audio) instead.


## OpenAPI

````yaml POST /voice/v1/sessions/{session_id}/audio/{file_sequence}
openapi: 3.0.1
info:
  title: EkaScribe Protocol API (MedScribeAlliance v0.1)
  version: '0.1'
  description: >
    Session-based medical voice capture API implementing the MedScribeAlliance
    Protocol v0.1. Discover service capabilities, create a session, stream audio
    chunks, then end the session to trigger asynchronous transcription and
    structured-template extraction.
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
paths:
  /voice/v1/sessions/{session_id}/audio/{file_sequence}:
    post:
      tags:
        - protocol
      summary: Upload Audio
      description: >
        Upload audio as a raw binary body. For `single` uploads (the default
        upload type), send one complete recording (max 10 MB) and the server
        performs Voice Activity Detection (VAD) chunking inline — for larger
        recordings use `chunked` uploads or the SDKs. For `chunked` uploads,
        call this repeatedly with sequentially numbered filenames
        (`audio_0.webm`, `audio_1.webm`, ...); the server stores each chunk by
        its sequence number. The audio content type is detected automatically
        from the file extension; set the `Content-Type` header only to override
        it.
      parameters:
        - name: session_id
          in: path
          required: true
          description: Session ID returned by Create Session
          schema:
            type: string
            example: ses_abc123def456
        - name: file_sequence
          in: path
          required: true
          description: >
            Audio filename with a sequence number and extension:
            `<base>_<sequence>.<ext>`. For `single` uploads just use
            `audio_0.webm`; for `chunked` uploads increment the sequence per
            chunk (`audio_0.webm`, `audio_1.webm`, ...).
          schema:
            type: string
            example: audio_0.webm
        - name: Content-Type
          in: header
          required: false
          description: >
            Audio MIME type. Leave unset — the server detects it automatically
            from the `file_sequence` extension (`.webm`, `.mp3`, `.wav`, `.ogg`,
            `.m4a`, `.mp4`). Generic values like `application/octet-stream` are
            also auto-resolved from the extension.
          schema:
            type: string
            enum:
              - audio/webm;codecs=opus
              - audio/mp3
              - audio/wav
              - audio/ogg
              - audio/m4a
              - audio/mp4
      requestBody:
        required: true
        description: >-
          Raw binary audio data (max 10 MB per chunk, ≤20s duration
          recommended).
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Audio uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
                    example: ses_abc123def456
                  success:
                    type: boolean
                    example: true
                  original_filename:
                    type: string
                    example: audio_0.webm
        '400':
          description: Session ended, processing completed, or invalid audio format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Chunk too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - auth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: invalid_audio_format
            message:
              type: string
              description: Human-readable error message.
              example: Audio format 'audio/mp3' is not supported
            details:
              type: object
              additionalProperties: true
              description: Additional error context.
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````