/api/convert Convertir un fichier
Convertit un fichier vers un autre format. Prend en charge vidéo, audio, images et documents.
Paramètres
| Nom | Type | Description |
|---|---|---|
file required | File | Le fichier à convertir (multipart/form-data) |
target_format required | string | Format cible (ex. : "mp4", "pdf", "png") |
processing_mode | string | "auto" | "force_cpu" | "force_gpu" |
Exemples
cURL
curl -X POST "https://loadsh.it/api/convert" \
-H "Authorization: Bearer lsh_live_xxxx" \
-F "[email protected]" \
-F "target_format=mp4" JavaScript
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('target_format', 'mp4');
const response = await fetch(
'https://loadsh.it/api/convert',
{
method: 'POST',
headers: { 'Authorization': 'Bearer lsh_live_xxxx' },
body: formData
}
);
const data = await response.json(); Réponse
{
"success": true,
"job_id": "conv_abc123",
"status": "processing"
}