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

# Get Session Transcript

> Retrieve conversation transcript from completed ambient session

Use this endpoint to get the full <Tooltip tip="The text version of recorded audio from clinical conversations, generated by automatic speech recognition." cta="View in Glossary" href="/Glossary/t">transcript</Tooltip> for a specified <Tooltip tip="A single, time-bound instance of an ambient recording for a specific patient encounter that captures clinical conversations." cta="View in Glossary" href="/Glossary/a">ambient session</Tooltip> after it has completed.

<Note>
  **Updated:**

  The response will now include the new `lang_id` field within the payload. The `lang_id` field indicates the language in which the transcript was sent.
</Note>

For a full list of language codes and their corresponding languages, refer to the [Language code reference](/api-reference/capabilities/multilingual#language-code-reference) section.

## Code examples

<Tabs>
  <Tab title="Python">
    ```python theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    import requests

    ambient_session_id = "123dfg-456dfg-789dfg-012dfg"
    url = f"https://sdp.suki-stage.com/api/v1/ambient/session/{ambient_session_id}/transcript"

    headers = {
        "sdp_suki_token": "<sdp_suki_token>",
        "sdp_provider_id": "<sdp_provider_id>"
    }

    response = requests.get(url, headers=headers)

    if response.status_code == 200:
        transcript_data = response.json()
        print("Transcript:")
        for transcript in transcript_data.get("final_transcript", []):
            print(f"Transcript ID: {transcript.get('transcript_id')}")
            print(f"Recording ID: {transcript.get('recording_id')}")
            print(f"Language: {transcript.get('lang_id')}")
            print(f"Transcript: {transcript.get('transcript')}")
            print(f"Start Time: {transcript.get('start_time')}")
            print(f"End Time: {transcript.get('end_time')}")
            
            # Start offset (relative to beginning of audio)
            start_offset = transcript.get('start_offset', {})
            if start_offset:
                print(f"Start Offset: {start_offset.get('hours')}h {start_offset.get('minutes')}m {start_offset.get('seconds')}s")
            
            # End offset (relative to beginning of audio)
            end_offset = transcript.get('end_offset', {})
            if end_offset:
                print(f"End Offset: {end_offset.get('hours')}h {end_offset.get('minutes')}m {end_offset.get('seconds')}s")
            
            print("---")
    else:
        print(f"Failed to get transcript: {response.status_code}")
        print(response.json())
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    const ambientSessionId = '123dfg-456dfg-789dfg-012dfg';
    const response = await fetch(
      `https://sdp.suki-stage.com/api/v1/ambient/session/${ambientSessionId}/transcript`,
      {
        headers: {
          'sdp_suki_token': '<sdp_suki_token>',
        'sdp_provider_id': '<sdp_provider_id>'
        }
      }
    );

    if (response.ok) {
      const transcriptData = await response.json();
      console.log('Transcript:');
      transcriptData.final_transcript?.forEach((transcript: any) => {
        console.log(`Transcript ID: ${transcript.transcript_id}`);
        console.log(`Recording ID: ${transcript.recording_id}`);
        console.log(`Language: ${transcript.lang_id}`);
        console.log(`Transcript: ${transcript.transcript}`);
        console.log(`Start Time: ${transcript.start_time}`);
        console.log(`End Time: ${transcript.end_time}`);
        
        // Start offset (relative to beginning of audio)
        if (transcript.start_offset) {
          const { hours, minutes, seconds } = transcript.start_offset;
          console.log(`Start Offset: ${hours}h ${minutes}m ${seconds}s`);
        }
        
        // End offset (relative to beginning of audio)
        if (transcript.end_offset) {
          const { hours, minutes, seconds } = transcript.end_offset;
          console.log(`End Offset: ${hours}h ${minutes}m ${seconds}s`);
        }
        
        console.log('---');
      });
    } else {
      const error = await response.json();
      console.error(`Failed to get transcript: ${response.status}`, error);
    }
    ```
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /api/v1/ambient/session/{ambient_session_id}/transcript
openapi: 3.0.1
info:
  title: Suki Developer Platform
  description: >-
    REST and WebSocket APIs for the Suki Developer Platform. Authenticate with
    Login or Register to obtain a Suki access token, then integrate ambient
    clinical documentation, form filling, transcription, and reference metadata
    endpoints.
  contact: {}
  version: '1.0'
servers:
  - url: https://sdp.suki.ai
    description: >-
      Production base URL for Suki Developer Platform REST APIs. WebSocket
      endpoints use the same host with `wss://`.
security:
  - SukiTokenAuth: []
paths:
  /api/v1/ambient/session/{ambient_session_id}/transcript:
    get:
      tags:
        - /api/v1/ambient/session
      summary: Get ambient session transcript
      description: >-
        Returns completed transcripts for the ambient session after speech
        recognition finishes.
      parameters:
        - name: ambient_session_id
          in: path
          description: >-
            UUID for the ambient session. Use the `ambient_session_id` returned
            from Create Ambient Session, or the UUID you supplied in that
            request.
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/ProviderIdHeader'
      responses:
        '200':
          description: Request succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.CompletedTranscriptResponse'
              example:
                final_transcript:
                  - end_offset:
                      hours: 0
                      minutes: 6
                      nanos: 80000000
                      seconds: 42
                    end_time: '2024-12-04T09:40:48.792948332Z'
                    lang_id: en
                    recording_id: c9d59aa8-cd48-4f5a-be81-5d0c9d2a5885
                    start_offset:
                      hours: 0
                      minutes: 6
                      nanos: 80000000
                      seconds: 42
                    start_time: '2024-12-04T09:40:42.393948332Z'
                    transcript: The patient has shown an allergy to pollen
                    transcript_id: 01JE8GP4RTHH0KDEGRSTRVPMGH
        '400':
          description: Bad request. The request body or parameters failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.BadRequestError'
        '401':
          description: Unauthorized. The Suki access token is missing, expired, or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.AuthenticationError'
        '404':
          description: Not found. The session, encounter, or resource ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.NotFoundError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.InternalServerError'
      security:
        - SukiTokenAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/transcript \
              --header 'sdp_suki_token: <sdp_suki_token>' \
              --header 'sdp_provider_id: <sdp_provider_id>'
components:
  parameters:
    ProviderIdHeader:
      name: sdp_provider_id
      in: header
      description: >-
        **Optional** - Stable identifier for the active provider. Omit for
        standard partners whose `partner_token` identifies the user.
        **Required** for Bearer partners and Single Auth Token authentication
        where multiple providers share one `partner_token`. Use the same
        `provider_id` you sent on Login or Register.
      required: false
      schema:
        type: string
        example: provider-123
  schemas:
    controllers.CompletedTranscriptResponse:
      type: object
      properties:
        final_transcript:
          type: array
          description: Collection of transcripts for the ambient session
          items:
            $ref: '#/components/schemas/controllers.CompletedTranscript'
      description: Response body for the /session/{ambient_session_id}/transcript endpoint
    controllers.BadRequestError:
      type: object
      properties:
        code:
          type: integer
          example: 400
          description: HTTP status code for the error.
        message:
          type: string
          example: invalid request
          description: Human-readable description of the validation or request error.
      description: Error response when the request fails validation.
    controllers.AuthenticationError:
      type: object
      properties:
        code:
          type: integer
          example: 401
          description: HTTP status code for the error.
        message:
          type: string
          example: invalid token
          description: Human-readable description of the authentication failure.
      description: Error response when authentication fails.
    controllers.NotFoundError:
      type: object
      properties:
        code:
          type: integer
          example: 404
          description: HTTP status code for the error.
        message:
          type: string
          example: not found
          description: Human-readable description of the missing resource.
      description: Error response when the requested resource was not found.
    controllers.InternalServerError:
      type: object
      properties:
        code:
          type: integer
          example: 500
          description: HTTP status code for the error.
        message:
          type: string
          example: internal server error
          description: Human-readable description of the server error.
      description: Error response when the server encounters an unexpected error.
    controllers.CompletedTranscript:
      type: object
      properties:
        end_offset:
          type: object
          description: >-
            Ending time of each transcript segment relative to the beginning of
            the audio or context in which it appears.
          allOf:
            - $ref: '#/components/schemas/controllers.Offset'
        end_time:
          type: string
          description: End Time of the transcript.
          example: '2024-12-04T09:40:48.792948332Z'
        lang_id:
          type: string
          description: Language identifier for the transcript content
          example: en
        recording_id:
          type: string
          description: Recording ID associated with the transcript.
          example: c9d59aa8-cd48-4f5a-be81-5d0c9d2a5885
        start_offset:
          type: object
          description: >-
            Starting time of each transcript segment relative to the beginning
            of the audio or context in which it appears.
          allOf:
            - $ref: '#/components/schemas/controllers.Offset'
        start_time:
          type: string
          description: Start Time of the transcript.
          example: '2024-12-04T09:40:42.393948332Z'
        transcript:
          type: string
          description: Transcript for an audio chunk.
          example: The patient has shown an allergy to pollen
        transcript_id:
          type: string
          description: Sortable ULID for each transcript.
          example: 01JE8GP4RTHH0KDEGRSTRVPMGH
      description: Transcript for an audio chunk
    controllers.Offset:
      type: object
      properties:
        hours:
          type: integer
          example: 0
        minutes:
          type: integer
          example: 6
        nanos:
          type: integer
          example: 80000000
        seconds:
          type: integer
          example: 42
  securitySchemes:
    SukiTokenAuth:
      type: apiKey
      in: header
      name: sdp_suki_token
      description: >-
        Suki access token for the authenticated provider. Obtain this by calling
        Login or Register with a valid `partner_token`. Pass the `suki_token`
        value from the JSON response as the `sdp_suki_token` header on REST
        requests and non-browser WebSocket upgrades. Browser WebSocket clients
        pass the token in `Sec-WebSocket-Protocol` instead. Tokens expire after
        one hour; call Login again to refresh.

````