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

# Isolate a Runway voice

> Separate speech from background audio with the Runway API.

Use `POST /runwayml/v1/voice_isolation` to separate speech from background audio.
Use the model ID `eleven_voice_isolation`.
Send your CometAPI API key with Bearer authentication and a JSON request body.

## Provide source audio

The request requires `model` and `audioUri`. Set `audioUri` to an accessible
HTTPS URL of the recording that contains the speech to isolate.
Replace the example audio URL with your source file.

## Retrieve the result

Save the returned `id`, then use [Get a Runway task](./runway-to-get-task-details)
to retrieve task status. When `status` is `SUCCEEDED`, read the audio URLs in
`output`. If the task fails, inspect `failure` and `failureCode`.


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-isolate-voice.openapi.json POST /runwayml/v1/voice_isolation
openapi: 3.1.0
info:
  title: Isolate a Runway voice API
  version: 1.0.0
  description: Separate speech from background audio with the Runway API.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/voice_isolation:
    post:
      summary: Isolate a Runway voice
      description: >-
        Separate speech from background audio with the Runway API. Save the
        returned id and retrieve the task to obtain its output.
      operationId: runway_voice_isolation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: eleven_voice_isolation
              type: object
              properties:
                model:
                  type: string
                  const: eleven_voice_isolation
                  enum:
                    - eleven_voice_isolation
                  description: Model ID for this request.
                audioUri:
                  description: Audio input as an accessible HTTPS URL or base64 data URI.
                  anyOf:
                    - description: Accessible HTTPS URL of the audio file.
                      type: string
                      minLength: 13
                      maxLength: 2048
                      pattern: ^https:\/\/.*
                    - description: Base64 audio data URI, up to 5 MB.
                      type: string
                      minLength: 13
                      maxLength: 5242880
                      pattern: ^data:audio\/.*
              required:
                - audioUri
                - model
              additionalProperties: false
              description: Request settings for eleven_voice_isolation.
              default:
                model: eleven_voice_isolation
                audioUri: https://your-audio-host/source-speech.mp3
            examples:
              eleven_voice_isolation:
                summary: eleven_voice_isolation
                value:
                  model: eleven_voice_isolation
                  audioUri: https://your-audio-host/source-speech.mp3
      responses:
        '200':
          description: Task created. Save the returned id to retrieve task status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Task ID for GET /runwayml/v1/tasks/{id}.
                  status:
                    type: string
                    description: Task state, when returned.
                  createdAt:
                    type: string
                    description: Task submission timestamp, when returned.
                    format: date-time
                  output:
                    type: array
                    description: Result URLs, when returned.
                    items:
                      type: string
                      format: uri
                  failure:
                    type: string
                    description: Failure explanation, when returned.
                  failureCode:
                    type: string
                    description: Machine-readable failure code, when returned.
                  estimatedCost:
                    type: object
                    description: Task estimate metadata, when returned.
                    properties:
                      credits:
                        type: integer
                        description: Credit value reported with the task.
                    required:
                      - credits
                    additionalProperties: false
                  cost:
                    type: object
                    description: Task cost metadata, when returned.
                    properties:
                      credits:
                        type: integer
                        description: Credit value reported with the task.
                    required:
                      - credits
                    additionalProperties: false
                required:
                  - id
                additionalProperties: false
              example:
                id: 123e4567-e89b-42d3-a456-426614174000
        '400':
          description: Invalid request or unavailable task ID.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: Task request error.
                    properties:
                      code:
                        type:
                          - string
                          - integer
                        description: Machine-readable task error code.
                      message:
                        type: string
                        description: Error explanation.
                      data:
                        description: Additional error details, when returned.
                    required:
                      - code
                      - message
                    additionalProperties: true
                  - type: object
                    description: Request authentication or validation error.
                    properties:
                      error:
                        type: object
                        description: Error details.
                        properties:
                          message:
                            type: string
                            description: Error explanation.
                          type:
                            type: string
                            description: Error category.
                          code:
                            type:
                              - string
                              - integer
                              - 'null'
                            description: Error code, when returned.
                        required:
                          - message
                        additionalProperties: true
                    required:
                      - error
                    additionalProperties: true
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                description: Request authentication or validation error.
                properties:
                  error:
                    type: object
                    description: Error details.
                    properties:
                      message:
                        type: string
                        description: Error explanation.
                      type:
                        type: string
                        description: Error category.
                      code:
                        type:
                          - string
                          - integer
                          - 'null'
                        description: Error code, when returned.
                    required:
                      - message
                    additionalProperties: true
                required:
                  - error
                additionalProperties: true
      x-codeSamples:
        - lang: Shell
          label: eleven_voice_isolation
          source: |
            curl https://api.cometapi.com/runwayml/v1/voice_isolation \
              --request POST \
              --header "Authorization: Bearer $COMETAPI_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "model": "eleven_voice_isolation",
              "audioUri": "https://your-audio-host/source-speech.mp3"
            }'
        - lang: Python
          label: eleven_voice_isolation
          source: |
            import os
            import requests

            payload = {   'model': 'eleven_voice_isolation',
                'audioUri': 'https://your-audio-host/source-speech.mp3'}

            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/voice_isolation",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json=payload,
            )
            response.raise_for_status()
            print(response.json()["id"])
        - lang: JavaScript
          label: eleven_voice_isolation
          source: |
            const payload = {
              "model": "eleven_voice_isolation",
              "audioUri": "https://your-audio-host/source-speech.mp3"
            };

            const response = await fetch(
              "https://api.cometapi.com/runwayml/v1/voice_isolation",
              {
                method: "POST",
                headers: {
                  Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                  "Content-Type": "application/json",
                },
                body: JSON.stringify(payload),
              },
            );
            if (!response.ok) throw new Error(await response.text());
            const task = await response.json();
            console.log(task.id);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use your CometAPI API key.

````