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

# Convert a file

> Convert or resize one file. Free of credits. Send bytes, a URL, or a previous job id.

`POST /api/v1/convert`

Convert or resize one file. Conversion does not spend credits. It still needs a [paid-plan key](/api/authentication).

Send the bytes, a URL, or a `job_id` from an earlier call. The call waits until the job finishes unless you send `wait=false`.

Image default is `webp`. Video default is `mp4`. Anything else is `400 unsupported_format`.

```bash theme={"theme":{"light":"github-dark","dark":"github-dark"}}
curl -X POST https://mediamonster.app/api/v1/convert \
  -H "Authorization: Bearer mm_live_…" \
  -F "file=@launch-teaser.png" \
  -F "format=webp" \
  -F "width=1280"
```

```json theme={"theme":{"light":"github-dark","dark":"github-dark"}}
{
  "id": "3f1c…",
  "status": "complete",
  "outputs": [
    {
      "name": "launch-teaser.webp",
      "mime": "image/webp",
      "size_bytes": 84213,
      "width": 1280,
      "height": 720,
      "url": "https://…signed…"
    }
  ]
}
```

| Field     | Type    | What it does                                                |
| --------- | ------- | ----------------------------------------------------------- |
| `file`    | file    | Multipart field name `file`                                 |
| `url`     | string  | A public URL instead of `file`                              |
| `job_id`  | string  | Reuse a file the API has already stored                     |
| `format`  | string  | Image: `png`, `jpeg`, `webp`. Video: `mp4`, `webm`          |
| `width`   | number  | Target width in pixels                                      |
| `height`  | number  | Target height in pixels                                     |
| `aspect`  | string  | Aspect ratio. Default `original`                            |
| `quality` | number  | Encode quality. Default `85`                                |
| `wait`    | boolean | Default `true`. Set `false` to poll `GET /api/v1/jobs/{id}` |

<Note>
  Output URLs are signed and expire after **ten minutes**. Read the job again for fresh ones.
</Note>

Audio is not converted here. Use audio [skills](/skills/overview).
