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

# Create Export Stems

> Export the dialogue, background or foreground audio of a run on its own.

A finished dub is a mix. This pulls one layer out of it: `audio_to_export` selects `dialogue`, `background` or `foreground`, and `type` chooses the container to write.

Pass `language` for a dubbed edition's stem, or omit it for the source audio. Useful when the mix has to be rebuilt in an external DAW, or the music and effects bed is wanted without speech.

Track progress by polling [`/export-stems/{task_id}`](get-export-stems-status) with the `task_id` returned in the response.


## OpenAPI

````yaml post /export-stems
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /export-stems:
    post:
      tags:
        - Export Stems
      summary: Create Export Bg Fg Alt Format
      operationId: create_export_bg_fg_alt_format_export_stems_post
      parameters:
        - name: traceparent
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Traceparent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExportBgFgAltFormatRequestPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrchestratorPipelineCallResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateExportBgFgAltFormatRequestPayload:
      properties:
        run_id:
          type: integer
          exclusiveMinimum: 0
          title: Run Id
          description: The run whose stems are being exported.
        language:
          anyOf:
            - $ref: '#/components/schemas/Languages'
            - type: 'null'
          description: Language edition to export. Omit for the source-language stems.
        audio_to_export:
          $ref: '#/components/schemas/AudioToExport'
          description: 'Which stem to export: dialogue, background or foreground.'
        type:
          $ref: '#/components/schemas/AudioOutputType'
          description: Audio container to export into.
      type: object
      required:
        - run_id
        - audio_to_export
        - type
      title: CreateExportBgFgAltFormatRequestPayload
    OrchestratorPipelineCallResult:
      properties:
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
      type: object
      required:
        - task_id
      title: OrchestratorPipelineCallResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Languages:
      type: integer
      title: Language ID
      description: >-
        Numeric language ID. Use [`GET
        /source-languages`](/api-reference/endpoint/get-source-languages) for
        valid `source_language` values and [`GET
        /target-languages`](/api-reference/endpoint/get-target-languages) for
        valid output `language` values. For example, `1` is English (US) and
        `54` is Spanish (Spain).
    AudioToExport:
      type: string
      enum:
        - dialogue
        - background
        - foreground
      title: AudioToExport
    AudioOutputType:
      type: string
      enum:
        - flac
        - wav
        - mp3
        - aac
        - m4a
      title: AudioOutputType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.