Passer au contenu principal

Démarrage rapide HTTP brut

Utilisez ce guide lorsque vous souhaitez des exemples HTTP directs. Si vous développez en Node.js ou Bun, commencez plutôt par le Démarrage rapide du SDK Node.js.

1. Créer une cible de téléversement

curl -X POST https://api.youka.io/fr/api/v1/uploads \
  -H "Authorization: Bearer yk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "song.mp3",
    "contentType": "audio/mpeg",
    "contentLength": 12345678
  }'
Téléversez les octets du fichier vers l’uploadUrl retournée.

2. Créer un projet

curl -X POST https://api.youka.io/fr/api/v1/projects \
  -H "Authorization: Bearer yk_..." \
  -H "Idempotency-Key: create-project-song-1" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Artist - Song",
    "inputFileId": "file_123",
    "lyricsSource": {
      "type": "align",
      "lyrics": "First line\nSecond line\n...",
      "syncModel": "musicai-alignment",
      "language": "en"
    },
    "splitModel": "mdx23c"
  }'

3. Interroger la tâche

curl https://api.youka.io/fr/api/v1/tasks/task_123 \
  -H "Authorization: Bearer yk_..."
Lorsque la tâche est terminale, son output contient les ID de résultats clés pour l’opération.

4. Lire l’état du projet

curl https://api.youka.io/fr/api/v1/projects/proj_123 \
  -H "Authorization: Bearer yk_..."
Cela renvoie l’état du projet à long terme, notamment les stems, les alignements, les exports et les paramètres de projet actifs.

5. Créer un export

curl -X POST https://api.youka.io/fr/api/v1/projects/proj_123/exports \
  -H "Authorization: Bearer yk_..." \
  -H "Idempotency-Key: export-song-1" \
  -H "Content-Type: application/json" \
  -d '{
    "resolution": "1080p",
    "quality": "high"
  }'
Ensuite, interrogez la tâche renvoyée ou lisez directement l’export :
curl https://api.youka.io/fr/api/v1/exports/export_123 \
  -H "Authorization: Bearer yk_..."