RecoupGet a free auditFree audit

API REFERENCE

Create music from video

On this page
POST/api/music/video-to-music

Generate background music from video files. Upload 1–10 video files via multipart/form-data (max 200 MB total). The AI analyzes the video content and generates music that matches the mood, pacing, and style. Optionally provide a text description and style tags to guide the output.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/music/video-to-music' \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'files=@YOUR_FILE_PATH'

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request POST \
  --url 'https://recoup-api.vercel.app/api/music/video-to-music' \
  --header 'Content-Type: multipart/form-data' \
  --data '{
  "files": [
    "string"
  ]
}'

Run this one from the terminal with the curl above.

Request body required

Video files and optional generation parameters

multipart/form-data

filesarray<string>required

Video files to analyze (max 200 MB total)

minItems: 1 · maxItems: 10

Item properties for files

string

descriptionstring

Optional text description to guide the music generation

maxLength: 1000

tagsarray<string>

Optional style tags to influence the output (max 10)

maxItems: 10

Item properties for tags

string

sign_with_c2paboolean

Sign the output with C2PA content credentials

Default: false

output_formatstring

Audio output format (e.g. mp3_44100_192)

Responses

200Background music generated successfully
song-idresponse header

Unique identifier for the generated song

audio/mpeg

string

400Validation failed — invalid or missing request body fields

application/json

errorstringrequired

Error message describing what went wrong.

401Unauthorized — invalid or missing API key

application/json

errorstringrequired

Error message describing what went wrong.

500Internal server error

application/json

errorstringrequired

Error message describing what went wrong.

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "description": "Generate background music from video files. Upload 1–10 video files via multipart/form-data (max 200 MB total). The AI analyzes the video content and generates music that matches the mood, pacing, and style. Optionally provide a text description and style tags to guide the output.",
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "description": "Video files and optional generation parameters",
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "properties": {
            "files": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "binary"
              },
              "minItems": 1,
              "maxItems": 10,
              "description": "Video files to analyze (max 200 MB total)"
            },
            "description": {
              "type": "string",
              "maxLength": 1000,
              "description": "Optional text description to guide the music generation"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "description": "Optional style tags to influence the output (max 10)"
            },
            "sign_with_c2pa": {
              "type": "boolean",
              "default": false,
              "description": "Sign the output with C2PA content credentials"
            },
            "output_format": {
              "type": "string",
              "description": "Audio output format (e.g. mp3_44100_192)"
            }
          },
          "required": [
            "files"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Background music generated successfully",
      "headers": {
        "song-id": {
          "schema": {
            "type": "string"
          },
          "description": "Unique identifier for the generated song"
        }
      },
      "content": {
        "audio/mpeg": {
          "schema": {
            "type": "string",
            "format": "binary"
          }
        }
      }
    },
    "400": {
      "description": "Validation failed — invalid or missing request body fields",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MusicErrorResponse"
          }
        }
      }
    },
    "401": {
      "description": "Unauthorized — invalid or missing API key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MusicErrorResponse"
          }
        }
      }
    },
    "500": {
      "description": "Internal server error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MusicErrorResponse"
          }
        }
      }
    }
  }
}