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

# Transform audio

> POST /v1/audio/transformations

Voice changing, stem separation, extracting the audio from a video — the transformations that take audio in and give audio back, as opposed to [speech synthesis](/api-reference/audio/speech) or [transcription](/api-reference/audio/transcriptions).


## OpenAPI

````yaml openapi.json POST /v1/audio/transformations
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/audio/transformations:
    post:
      tags:
        - Audio
      summary: >-
        Transform audio (voice-changer, stem separation, video→audio extraction,
        …)
      operationId: createAudioTransformation
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
              properties:
                model:
                  type: string
                  description: Model ID to use for the transformation
                audio_url:
                  type: string
                  description: >-
                    Source audio URL — required for audio-input models
                    (voice-changer, demucs)
                video_url:
                  type: string
                  description: >-
                    Source video URL — required for video-input models
                    (video→audio extraction)
                response_format:
                  type: string
                  description: >-
                    Requested output audio format (model-dependent; applied
                    best-effort)
      responses:
        '200':
          description: >-
            Transformed audio result. `url` is the aggregator's own hosted
            output URL, or a private-storage signed URL (7-day expiry) when the
            provider only returns inline bytes.
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                    example: 1713204900
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          example: https://fal.media/files/.../output.mp3
                        b64_audio:
                          type: string
                          description: >-
                            Base64-encoded audio bytes. Present only when GCS
                            upload fails or on providers that return inline
                            bytes exclusively.
                        content_type:
                          type: string
                          example: audio/mpeg
                        duration_seconds:
                          type: number
                          example: 12.5
                  credits_used:
                    type: integer
                    example: 40
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    ErrorResponseDto:
      type: object
      properties:
        error:
          description: >-
            The error envelope. Every non-2xx response from this API has this
            shape, so a client can parse failures without branching on the
            endpoint.
          allOf:
            - $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: string
          example: model_not_found
          nullable: true
          description: >-
            Stable machine-readable error code. Branch on this rather than on
            `message`, which is prose and may be reworded.
        param:
          type: string
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error. `null` when
            the error is not attributable to one field.
        job_id:
          type: string
          example: job_1hR9xTPZqK4mVLc2nJ7fY5wB
          description: >-
            Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present
            on the few errors that carry one. When it is here, this is not a
            failure to retry — retrying pays twice. Collect the result from `GET
            /v1/images/jobs/{job_id}`, which serves every durable media job
            regardless of modality.


            Two situations produce it. A media generation that outruns the
            gateway's wait answers `504` with `code: "job_timeout"` and keeps
            working. And `POST /v1/audio/speech` answers **500** with `code:
            "artifact_unreadable"` when the speech was generated and settled but
            could not be read back from storage — the audio exists and is paid
            for; only this response failed.


            Declared here rather than per-endpoint because the rule is about the
            FIELD, not the status: if this is present, there is a paid-for
            result to collect. It was undeclared until now, so a client
            generated from this document could not see the one field that
            recovers money already spent.
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````