{
  "openapi": "3.1.0",
  "info": {
    "title": "AudioShake API",
    "version": "1.0.0",
    "description": "API for AI-powered audio source separation, stem extraction, and transcription.",
    "license": {
      "name": "Proprietary",
      "url": "https://www.audioshake.ai/terms"
    },
    "contact": {
      "name": "AudioShake",
      "url": "https://audioshake.ai"
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      }
    },
    "schemas": {
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier of the Task",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "description": "Timestamp of when the Task was created",
            "type": "string"
          },
          "completedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "description": "Timestamp of when the Task was completed",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clientId": {
            "description": "Unique identifier of the client",
            "type": "string"
          },
          "cost": {
            "description": "Processing cost in credits",
            "type": "number"
          },
          "assetId": {
            "description": "Asset ID of an input media file. Mutually exclusive with url",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "description": "URL of an input media file. Mutually exclusive with assetId",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
            "type": "string"
          },
          "targets": {
            "description": "Processing targets and their current status",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Unique identifier of the target",
                  "type": "string"
                },
                "model": {
                  "description": "Model to run. See the Models page for available options.",
                  "type": "string"
                },
                "status": {
                  "description": "Status of the target: 'processing' – actively running; 'completed' – results ready in output; 'error' – see error field for details",
                  "enum": [
                    "processing",
                    "completed",
                    "error"
                  ],
                  "type": "string"
                },
                "formats": {
                  "type": "array",
                  "items": {
                    "description": "Output file formats (e.g. \"wav\", \"mp3\", \"json\")",
                    "type": "string"
                  }
                },
                "output": {
                  "description": "Downloadable output files for this target. Populated when status is \"completed\".",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "description": "Filename of the output asset",
                        "type": "string"
                      },
                      "format": {
                        "description": "Format of the output file",
                        "type": "string"
                      },
                      "link": {
                        "description": "Presigned download URL. Expires after one hour — re-fetch the Task for a fresh link.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "format",
                      "link"
                    ]
                  }
                },
                "cost": {
                  "description": "Processing cost in credits",
                  "type": "number"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "description": "Error code",
                          "type": "number"
                        },
                        "message": {
                          "description": "Error message",
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "duration": {
                  "description": "Processed audio duration in seconds",
                  "type": "number"
                },
                "residual": {
                  "description": "Include residual with results",
                  "type": "boolean"
                },
                "language": {
                  "description": "ISO 639-1 two-letter language code. Improves model accuracy and timing alignment for transcription and alignment models. If omitted, the model will attempt to auto-detect.",
                  "type": "string"
                },
                "transcriptUrl": {
                  "description": "URL to transcript file for alignment",
                  "type": "string"
                },
                "transcriptAssetId": {
                  "description": "Asset ID of a transcript for alignment",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "model",
                "status",
                "formats",
                "output"
              ]
            }
          }
        },
        "required": [
          "id",
          "createdAt",
          "clientId",
          "targets"
        ]
      },
      "Target": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier of the target",
            "type": "string"
          },
          "model": {
            "description": "Model to run. See the Models page for available options.",
            "type": "string"
          },
          "status": {
            "description": "Status of the target: 'processing' – actively running; 'completed' – results ready in output; 'error' – see error field for details",
            "enum": [
              "processing",
              "completed",
              "error"
            ],
            "type": "string"
          },
          "formats": {
            "type": "array",
            "items": {
              "description": "Output file formats (e.g. \"wav\", \"mp3\", \"json\")",
              "type": "string"
            }
          },
          "output": {
            "description": "Downloadable output files for this target. Populated when status is \"completed\".",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Filename of the output asset",
                  "type": "string"
                },
                "format": {
                  "description": "Format of the output file",
                  "type": "string"
                },
                "link": {
                  "description": "Presigned download URL. Expires after one hour — re-fetch the Task for a fresh link.",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "format",
                "link"
              ]
            }
          },
          "cost": {
            "description": "Processing cost in credits",
            "type": "number"
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "description": "Error code",
                    "type": "number"
                  },
                  "message": {
                    "description": "Error message",
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "duration": {
            "description": "Processed audio duration in seconds",
            "type": "number"
          },
          "residual": {
            "description": "Include residual with results",
            "type": "boolean"
          },
          "language": {
            "description": "ISO 639-1 two-letter language code. Improves model accuracy and timing alignment for transcription and alignment models. If omitted, the model will attempt to auto-detect.",
            "type": "string"
          },
          "transcriptUrl": {
            "description": "URL to transcript file for alignment",
            "type": "string"
          },
          "transcriptAssetId": {
            "description": "Asset ID of a transcript for alignment",
            "type": "string"
          }
        },
        "required": [
          "id",
          "model",
          "status",
          "formats",
          "output"
        ]
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique identifier of the Asset. Use this id in the assetId field when creating a Task.",
            "type": "string"
          },
          "format": {
            "description": "Format of the Asset",
            "type": "string"
          },
          "name": {
            "description": "Name of the Asset",
            "type": "string"
          }
        },
        "required": [
          "id",
          "format"
        ]
      }
    }
  },
  "paths": {
    "/assets": {
      "post": {
        "operationId": "createAsset",
        "summary": "Upload File",
        "tags": [
          "assets"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The uploaded file data. Supported audio formats only. (e.g. wav, aiff, flac, mp3)"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "Unique identifier of the Asset. Use this id as assetId when creating a Task.",
                      "type": "string"
                    },
                    "format": {
                      "description": "Format of the output file",
                      "type": "string"
                    },
                    "name": {
                      "description": "Name of the Asset",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listAssets",
        "summary": "List All Assets",
        "tags": [
          "assets"
        ],
        "parameters": [
          {
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "number"
            },
            "in": "query",
            "name": "skip",
            "required": false,
            "description": "Number of records to skip for pagination"
          },
          {
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "type": "number"
            },
            "in": "query",
            "name": "take",
            "required": false,
            "description": "Maximum number of records to return per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "Unique identifier of the Asset. Use this id as assetId when creating a Task.",
                        "type": "string"
                      },
                      "format": {
                        "description": "Format of the output file",
                        "type": "string"
                      },
                      "name": {
                        "description": "Name of the Asset",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/assets/{id}": {
      "get": {
        "operationId": "getAsset",
        "summary": "Get Asset by ID",
        "tags": [
          "assets"
        ],
        "parameters": [
          {
            "schema": {
              "minLength": 3,
              "maxLength": 60,
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Unique identifier of the Asset"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "Unique identifier of the Asset. Use this id in the assetId field when creating a Task.",
                      "type": "string"
                    },
                    "format": {
                      "description": "Format of the Asset",
                      "type": "string"
                    },
                    "name": {
                      "description": "Name of the Asset",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tasks": {
      "post": {
        "operationId": "createTask",
        "summary": "Create Task",
        "tags": [
          "tasks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "type": "object",
                    "properties": {
                      "assetId": {
                        "description": "Asset ID of an input media file",
                        "type": "string"
                      },
                      "storageIntegrationId": {
                        "description": "ID of a configured storage integration. Required when using an S3 input url or a custom writeDestination. See Custom S3 Write Destination.",
                        "type": "string"
                      },
                      "writeDestination": {
                        "description": "Optional. S3 URI prefix to write outputs under (e.g. \"s3://my-bucket/outputs\"). Requires storageIntegrationId. The source 'url' must also have an S3 URI prefix (s3://...). The bucket must be covered by a configured storage integration. Outputs are written under <writeDestination>/<taskId>/*. Use output[].link for exact object locations. See Custom S3 Write Destination.",
                        "format": "uri",
                        "type": "string"
                      },
                      "webhookUrl": {
                        "description": "Optional. Webhook URL to notify when this Task completes. Overrides the global webhook URL configured in the dashboard for this Task only. See Using Webhooks.",
                        "format": "uri",
                        "type": "string"
                      },
                      "metadata": {
                        "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
                        "maxLength": 4096,
                        "type": "string"
                      },
                      "targets": {
                        "description": "One or more model targets to process",
                        "minItems": 1,
                        "maxItems": 20,
                        "uniqueItems": true,
                        "type": "array",
                        "items": {
                          "description": "A target specifying a model and desired output formats.",
                          "additionalProperties": false,
                          "type": "object",
                          "properties": {
                            "model": {
                              "description": "Model to run. See the Models page for available options.",
                              "minLength": 2,
                              "maxLength": 255,
                              "type": "string"
                            },
                            "formats": {
                              "description": "Output file formats: \"wav\", \"mp3\" for audio models, \"json\" for transcription and detection models.",
                              "uniqueItems": true,
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "residual": {
                              "description": "Optional. Return the residual (everything not in the target stem).",
                              "type": "boolean"
                            },
                            "language": {
                              "description": "Optional. ISO 639-1 language code (e.g. \"en\"). Only applies to transcription and alignment models. Auto-detected if omitted.",
                              "minLength": 2,
                              "maxLength": 2,
                              "type": "string"
                            },
                            "transcriptAssetId": {
                              "description": "Optional. Asset ID of an existing transcript to align against. Only used with the alignment model. Mutually exclusive with transcriptUrl.",
                              "minLength": 2,
                              "type": "string"
                            },
                            "transcriptUrl": {
                              "description": "Optional. HTTPS URL of an existing transcript to align against. Only used with the alignment model. Mutually exclusive with transcriptAssetId.",
                              "format": "uri",
                              "minLength": 2,
                              "type": "string"
                            }
                          },
                          "required": [
                            "model",
                            "formats"
                          ]
                        }
                      }
                    },
                    "required": [
                      "assetId",
                      "targets"
                    ],
                    "example": {
                      "assetId": "your_asset_id",
                      "targets": [
                        { "model": "vocals", "formats": ["wav"] },
                        { "model": "instrumental", "formats": ["wav"] }
                      ]
                    }
                  },
                  {
                    "additionalProperties": false,
                    "type": "object",
                    "properties": {
                      "url": {
                        "description": "Public HTTPS URL or S3 URI (s3://bucket/key) of an input media file. S3 URIs require storageIntegrationId.",
                        "format": "uri",
                        "type": "string"
                      },
                      "storageIntegrationId": {
                        "description": "ID of a configured storage integration. Required when url is an S3 URI (s3://...) or when writing outputs to a custom writeDestination. See Custom S3 Write Destination.",
                        "type": "string"
                      },
                      "writeDestination": {
                        "description": "Optional. S3 URI prefix to write outputs under (e.g. \"s3://my-bucket/outputs\"). Requires storageIntegrationId. The source 'url' must also have an S3 URI prefix (s3://...). The bucket must be covered by a configured storage integration. Outputs are written under <writeDestination>/<taskId>/*. Use output[].link for exact object locations. See Custom S3 Write Destination.",
                        "format": "uri",
                        "type": "string"
                      },
                      "webhookUrl": {
                        "description": "Optional. Webhook URL to notify when this Task completes. Overrides the global webhook URL configured in the dashboard for this Task only. See Using Webhooks.",
                        "format": "uri",
                        "type": "string"
                      },
                      "metadata": {
                        "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
                        "maxLength": 4096,
                        "type": "string"
                      },
                      "targets": {
                        "description": "One or more model targets to process",
                        "minItems": 1,
                        "maxItems": 20,
                        "uniqueItems": true,
                        "type": "array",
                        "items": {
                          "description": "A target specifying a model and desired output formats.",
                          "additionalProperties": false,
                          "type": "object",
                          "properties": {
                            "model": {
                              "description": "Model to run. See the Models page for available options.",
                              "minLength": 2,
                              "maxLength": 255,
                              "type": "string"
                            },
                            "formats": {
                              "description": "Output file formats: \"wav\", \"mp3\" for audio models, \"json\" for transcription and detection models.",
                              "uniqueItems": true,
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "residual": {
                              "description": "Optional. Return the residual (everything not in the target stem).",
                              "type": "boolean"
                            },
                            "language": {
                              "description": "Optional. ISO 639-1 language code (e.g. \"en\"). Only applies to transcription and alignment models. Auto-detected if omitted.",
                              "minLength": 2,
                              "maxLength": 2,
                              "type": "string"
                            },
                            "transcriptAssetId": {
                              "description": "Optional. Asset ID of an existing transcript to align against. Only used with the alignment model. Mutually exclusive with transcriptUrl.",
                              "minLength": 2,
                              "type": "string"
                            },
                            "transcriptUrl": {
                              "description": "Optional. HTTPS URL of an existing transcript to align against. Only used with the alignment model. Mutually exclusive with transcriptAssetId.",
                              "format": "uri",
                              "minLength": 2,
                              "type": "string"
                            }
                          },
                          "required": [
                            "model",
                            "formats"
                          ]
                        }
                      }
                    },
                    "required": [
                      "url",
                      "targets"
                    ],
                    "example": {
                      "url": "https://example.com/song.wav",
                      "targets": [
                        { "model": "vocals", "formats": ["wav"] },
                        { "model": "instrumental", "formats": ["wav"] }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "Unique identifier of the Task",
                      "type": "string"
                    },
                    "createdAt": {
                      "format": "date-time",
                      "description": "Timestamp of when the Task was created",
                      "type": "string"
                    },
                    "completedAt": {
                      "anyOf": [
                        {
                          "format": "date-time",
                          "description": "Timestamp of when the Task was completed",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clientId": {
                      "description": "Unique identifier of the client",
                      "type": "string"
                    },
                    "cost": {
                      "description": "Processing cost in credits",
                      "type": "number"
                    },
                    "assetId": {
                      "description": "Asset ID of an input media file. Mutually exclusive with url",
                      "type": "string"
                    },
                    "url": {
                      "anyOf": [
                        {
                          "description": "URL of an input media file (HTTPS or s3://). Mutually exclusive with assetId",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "storageIntegrationId": {
                      "anyOf": [
                        {
                          "description": "ID of the storage integration used to read the S3 input and write outputs. Only present when a storage integration was provided.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "writeDestination": {
                      "anyOf": [
                        {
                          "description": "S3 URI prefix outputs were written under. The source 'url' must also have an S3 URI prefix (s3://...). Outputs are written under <writeDestination>/<taskId>/*. Use output[].link for exact object locations. Only present when a custom write destination was provided.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metadata": {
                      "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
                      "type": "string"
                    },
                    "targets": {
                      "description": "Processing targets and their current status",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "Unique identifier of the target",
                            "type": "string"
                          },
                          "model": {
                            "description": "Model to run. See the Models page for available options.",
                            "type": "string"
                          },
                          "status": {
                            "description": "Status of the target: 'processing' – actively running; 'completed' – results ready in output; 'error' – see error field for details",
                            "enum": [
                              "processing",
                              "completed",
                              "error"
                            ],
                            "type": "string"
                          },
                          "formats": {
                            "type": "array",
                            "items": {
                              "description": "Output file formats (e.g. \"wav\", \"mp3\", \"json\")",
                              "type": "string"
                            }
                          },
                          "output": {
                            "description": "Downloadable output files for this target. Populated when status is \"completed\".",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "description": "Filename of the output asset",
                                  "type": "string"
                                },
                                "format": {
                                  "description": "Format of the output file",
                                  "type": "string"
                                },
                                "link": {
                                  "description": "Presigned download URL. Expires after one hour — re-fetch the Task for a fresh link.",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "format",
                                "link"
                              ]
                            }
                          },
                          "cost": {
                            "description": "Processing cost in credits",
                            "type": "number"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "description": "Error code",
                                    "type": "number"
                                  },
                                  "message": {
                                    "description": "Error message",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "duration": {
                            "description": "Processed audio duration in seconds",
                            "type": "number"
                          },
                          "residual": {
                            "description": "Include residual with results",
                            "type": "boolean"
                          },
                          "language": {
                            "description": "ISO 639-1 two-letter language code. Improves model accuracy and timing alignment for transcription and alignment models. If omitted, the model will attempt to auto-detect.",
                            "type": "string"
                          },
                          "transcriptUrl": {
                            "description": "URL to transcript file for alignment",
                            "type": "string"
                          },
                          "transcriptAssetId": {
                            "description": "Asset ID of a transcript for alignment",
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "model",
                          "status",
                          "formats",
                          "output"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listTasks",
        "summary": "List All Tasks",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "number"
            },
            "in": "query",
            "name": "skip",
            "required": false,
            "description": "Number of records to skip for pagination"
          },
          {
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 10,
              "type": "number"
            },
            "in": "query",
            "name": "take",
            "required": false,
            "description": "Maximum number of records to return per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "Unique identifier of the Task",
                        "type": "string"
                      },
                      "createdAt": {
                        "format": "date-time",
                        "description": "Timestamp of when the Task was created",
                        "type": "string"
                      },
                      "completedAt": {
                        "anyOf": [
                          {
                            "format": "date-time",
                            "description": "Timestamp of when the Task was completed",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "clientId": {
                        "description": "Unique identifier of the client",
                        "type": "string"
                      },
                      "cost": {
                        "description": "Processing cost in credits",
                        "type": "number"
                      },
                      "assetId": {
                        "description": "Asset ID of an input media file. Mutually exclusive with url",
                        "type": "string"
                      },
                      "url": {
                        "anyOf": [
                          {
                            "description": "URL of an input media file. Mutually exclusive with assetId",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "metadata": {
                        "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
                        "type": "string"
                      },
                      "targets": {
                        "description": "Processing targets and their current status",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Unique identifier of the target",
                              "type": "string"
                            },
                            "model": {
                              "description": "Model to run. See the Models page for available options.",
                              "type": "string"
                            },
                            "status": {
                              "description": "Status of the target: 'processing' – actively running; 'completed' – results ready in output; 'error' – see error field for details",
                              "enum": [
                                "processing",
                                "completed",
                                "error"
                              ],
                              "type": "string"
                            },
                            "formats": {
                              "type": "array",
                              "items": {
                                "description": "Output file formats (e.g. \"wav\", \"mp3\", \"json\")",
                                "type": "string"
                              }
                            },
                            "output": {
                              "description": "Downloadable output files for this target. Populated when status is \"completed\".",
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "description": "Filename of the output asset",
                                    "type": "string"
                                  },
                                  "format": {
                                    "description": "Format of the output file",
                                    "type": "string"
                                  },
                                  "link": {
                                    "description": "Presigned download URL. Expires after one hour — re-fetch the Task for a fresh link.",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "format",
                                  "link"
                                ]
                              }
                            },
                            "cost": {
                              "description": "Processing cost in credits",
                              "type": "number"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "description": "Error code",
                                      "type": "number"
                                    },
                                    "message": {
                                      "description": "Error message",
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "duration": {
                              "description": "Processed audio duration in seconds",
                              "type": "number"
                            },
                            "residual": {
                              "description": "Include residual with results",
                              "type": "boolean"
                            },
                            "language": {
                              "description": "ISO 639-1 two-letter language code. Improves model accuracy and timing alignment for transcription and alignment models. If omitted, the model will attempt to auto-detect.",
                              "type": "string"
                            },
                            "transcriptUrl": {
                              "description": "URL to transcript file for alignment",
                              "type": "string"
                            },
                            "transcriptAssetId": {
                              "description": "Asset ID of a transcript for alignment",
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "model",
                            "status",
                            "formats",
                            "output"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}": {
      "get": {
        "operationId": "getTask",
        "summary": "Get Task by ID",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Unique identifier of the Task"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "Unique identifier of the Task",
                      "type": "string"
                    },
                    "createdAt": {
                      "format": "date-time",
                      "description": "Timestamp of when the Task was created",
                      "type": "string"
                    },
                    "completedAt": {
                      "anyOf": [
                        {
                          "format": "date-time",
                          "description": "Timestamp of when the Task was completed",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clientId": {
                      "description": "Unique identifier of the client",
                      "type": "string"
                    },
                    "cost": {
                      "description": "Processing cost in credits",
                      "type": "number"
                    },
                    "assetId": {
                      "description": "Asset ID of an input media file. Mutually exclusive with url",
                      "type": "string"
                    },
                    "url": {
                      "anyOf": [
                        {
                          "description": "URL of an input media file (HTTPS or s3://). Mutually exclusive with assetId",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "storageIntegrationId": {
                      "anyOf": [
                        {
                          "description": "ID of the storage integration used to read the S3 input and write outputs. Only present when a storage integration was provided.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "writeDestination": {
                      "anyOf": [
                        {
                          "description": "S3 URI prefix outputs were written under. The source 'url' must also have an S3 URI prefix (s3://...). Outputs are written under <writeDestination>/<taskId>/*. Use output[].link for exact object locations. Only present when a custom write destination was provided.",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metadata": {
                      "description": "Client-provided metadata. Stored and returned as-is in responses and webhooks.",
                      "type": "string"
                    },
                    "targets": {
                      "description": "Processing targets and their current status",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "Unique identifier of the target",
                            "type": "string"
                          },
                          "model": {
                            "description": "Model to run. See the Models page for available options.",
                            "type": "string"
                          },
                          "status": {
                            "description": "Status of the target: 'processing' – actively running; 'completed' – results ready in output; 'error' – see error field for details",
                            "enum": [
                              "processing",
                              "completed",
                              "error"
                            ],
                            "type": "string"
                          },
                          "formats": {
                            "type": "array",
                            "items": {
                              "description": "Output file formats (e.g. \"wav\", \"mp3\", \"json\")",
                              "type": "string"
                            }
                          },
                          "output": {
                            "description": "Downloadable output files for this target. Populated when status is \"completed\".",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "description": "Filename of the output asset",
                                  "type": "string"
                                },
                                "format": {
                                  "description": "Format of the output file",
                                  "type": "string"
                                },
                                "link": {
                                  "description": "Presigned download URL. Expires after one hour — re-fetch the Task for a fresh link.",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "format",
                                "link"
                              ]
                            }
                          },
                          "cost": {
                            "description": "Processing cost in credits",
                            "type": "number"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "description": "Error code",
                                    "type": "number"
                                  },
                                  "message": {
                                    "description": "Error message",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "duration": {
                            "description": "Processed audio duration in seconds",
                            "type": "number"
                          },
                          "residual": {
                            "description": "Include residual with results",
                            "type": "boolean"
                          },
                          "language": {
                            "description": "ISO 639-1 two-letter language code. Improves model accuracy and timing alignment for transcription and alignment models. If omitted, the model will attempt to auto-detect.",
                            "type": "string"
                          },
                          "transcriptUrl": {
                            "description": "URL to transcript file for alignment",
                            "type": "string"
                          },
                          "transcriptAssetId": {
                            "description": "Asset ID of a transcript for alignment",
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "model",
                          "status",
                          "formats",
                          "output"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tasks/statistics": {
      "get": {
        "operationId": "getTaskStatistics",
        "summary": "Get Task Statistics",
        "tags": [
          "tasks"
        ],
        "parameters": [
          {
            "schema": {
              "enum": [
                "usage",
                "distribution"
              ],
              "default": "usage",
              "type": "string"
            },
            "in": "query",
            "name": "name",
            "required": true,
            "description": "Type of statistics to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Usage",
                      "description": "Monthly usage breakdown. Returned when name=usage.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "description": "Month in YYYY-MM format",
                            "type": "string"
                          },
                          "totalTargets": {
                            "description": "Total number of targets processed",
                            "type": "number"
                          },
                          "totalMinutes": {
                            "description": "Total minutes of audio processed",
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "title": "Distribution",
                      "description": "Model usage distribution. Returned when name=distribution.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "model": {
                            "description": "Model name",
                            "type": "string"
                          },
                          "count": {
                            "description": "Number of times the model was used",
                            "type": "number"
                          },
                          "percentage": {
                            "description": "Percentage of total usage",
                            "type": "string"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.audioshake.ai"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "assets",
      "description": "Audio and media file assets managed by AudioShake"
    },
    {
      "name": "tasks",
      "description": "Stem separation, source separation, and transcription alignment tasks"
    }
  ]
}