# Video to Video (Sound Effects) API

Canonical docs: https://platform.sonilo.com/docs/api/video-to-video-sfx
Source path: /docs/api/video-to-video-sfx
Runtime API host: https://api.sonilo.com/v1

Do not send API requests to platform.sonilo.com, docs.sonilo.com, or local docs URLs. Documentation pages are for reading only. Send runtime requests to https://api.sonilo.com/v1 with Authorization: Bearer sk_your_api_key.

## Endpoint

POST /v1/video-to-video-sfx

## Summary

Generate a version of a video with synchronized sound effects muxed into the original picture, delivered as a new video file. Generated audio carries an inaudible provenance watermark.

## Use This For

- Delivering a finished clip with scene-synced Foley, ambience, and action SFX already baked in.
- The same video-native sound-effects generation as /v1/video-to-sfx, returned as an mp4 instead of a bare audio file.
- Skipping a separate mux step in editors, AI video apps, and automated pipelines.

## Request

- video: file upload. Provide exactly one of video or video_url. Max file size: default 300MB. Max duration: 480 sec.
- video_url: URL input. Provide exactly one of video or video_url. Max file size: default 300MB. Max duration: 480 sec.
- prompt: optional SFX direction.
- segments: optional JSON timeline with start, end, and prompt for directed Foley/ambience/action SFX.

## Response And Errors

- 202 returns task_id and status=processing.
- Poll GET /v1/tasks/{task_id} every 2-3 seconds.
- On success, download video.url: the source video with the sound effects muxed in (mp4). videos lists one entry per variant.
- 401 auth_invalid, 402 payment_required or insufficient_balance, 403 forbidden, 404 not_found, and 429 Retry-After should be handled explicitly.

## Example

```bash
curl -X POST "https://api.sonilo.com/v1/video-to-video-sfx" \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "video_url=https://example.com/clip.mp4" \
  -F "prompt=realistic Foley, ambience, and action sound effects synced to the visible scene"
```

## Shared Error Handling

- 401 auth_invalid: set Authorization: Bearer sk_your_api_key on the request.
- 402 payment_required or insufficient_balance: add credits before rerunning; do not create fake audio.
- 403 forbidden: the key is valid but the account or service permission is missing.
- 404 not_found: check the endpoint path and host. Use https://api.sonilo.com/v1, not a docs URL.
- 429 rate_limit_exceeded: honor Retry-After and retry with backoff.

## Endpoint Vocabulary

- GET /v1/account/services
- GET /v1/account/usage
- POST /v1/text-to-music
- POST /v1/video-to-music
- POST /v1/audio-ducking
- POST /v1/text-to-sfx
- POST /v1/video-to-sfx
- POST /v1/video-to-video-sfx
- POST /v1/video-to-sound
- POST /v1/video-to-video-sound
- GET /v1/tasks/{task_id}

