Zurück

API Dokumentation

REST API für programmatischen Zugriff auf alle LoadSh.it Services

v1.0

Einführung

Die LoadSh.it API gibt programmatischen Zugriff auf Datei-Verarbeitung, Sicherheits-Scans, Transkription und alle KI-Boost-Tools (Bg-Remove, Upscale, Untertitel, Whiteboard→Diagramm, Chat-mit-PDF, Folien-Generator und mehr).

80+ Formate

Video, Audio, Bilder, Dokumente

ClamAV Scan

Enterprise Virenschutz

Whisper AI

Transkription in 99 Sprachen

Boost AI-Tools

30+ GPU-/LLM-Tools, einheitliche Dispatch-API

Authentifizierung

Alle API-Anfragen benötigen einen gültigen API Key im Authorization Header. API Keys können in den Einstellungen erstellt werden.

HTTP Header
Authorization: Bearer lsh_live_xxxxxxxxxxxxxxxxxxxxxxxx
Wichtig: Speichere deinen API Key sicher. Er wird nur einmal bei der Erstellung angezeigt und kann nicht wiederhergestellt werden.

Base URL

https://loadsh.it/api

Alle Endpoints sind relativ zu dieser Base URL.

Rate Limits

Die API hat derzeit keine strikten Rate Limits für authentifizierte Benutzer. Wir behalten uns vor, bei Missbrauch Limits einzuführen.

Requests/Min Max Dateigrösse
Unlimited 5 GB

Endpoints

POST /api/nodrift/upload/presign

Presigned Upload-URL anfordern

Erster Schritt für jede Verarbeitung: holt eine signierte Upload-URL plus den `file_key`, den die anderen Endpoints später referenzieren.

Parameter

Name Typ Beschreibung
filename required string Original-Dateiname inkl. Endung.
size required number Dateigrösse in Bytes.
content_type string MIME-Typ (z.B. video/mp4).

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "upload_url": "https://...",
  "file_key": "inputs/1/abc.mp4"
}
POST /api/convert

Datei konvertieren

Konvertiert eine Datei in ein anderes Format. Zwei Wege: ENTWEDER `jobId` aus dem /api/upload-Multipart-Flow (Frontend), ODER `file_key` aus /api/nodrift/upload/presign (programmatische API-Nutzung — empfohlen). Antwort enthält `job_id` zum Pollen via /api/nodrift/jobs/<id>. Container-Erstellung nicht nötig — nodrift.ch verwaltet GPU-Pool serverless.

Parameter

Name Typ Beschreibung
jobId required string Job-ID aus /api/upload (Frontend) ODER file_key aus /api/nodrift/upload/presign (API).
targetFormat required string Zielformat (z.B. "mp4", "pdf", "png").
processing_mode string "auto" | "force_cpu" | "force_gpu" — bei file_key-Pfad wird routing automatisch.

Beispiele

cURL
BASH
curl -X POST "https://loadsh.it/api/convert" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "[email protected]" \
  -F "target_format=mp4"
JavaScript
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();

Response

JSON
{
  "success": true,
  "job_id": "job_abc123",
  "status": "processing"
}
POST /api/scan

Sicherheits-Scan

Scannt eine Datei auf Viren, Malware und andere Bedrohungen mit ClamAV & YARA Rules.

Parameter

Name Typ Beschreibung
file_key required string Die zu scannende Datei (multipart/form-data)
original_filename string Original-Dateiname für Logs/Verlauf.

Beispiele

cURL
BASH
curl -X POST "https://loadsh.it/api/scan" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "[email protected]"
JavaScript
JAVASCRIPT
const formData = new FormData();
formData.append('file', fileInput.files[0]);

const response = await fetch(
  'https://loadsh.it/api/scan',
  {
    method: 'POST',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' },
    body: formData
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "job_id": "job_xyz789",
  "status": "queued"
}
POST /api/transcript

Audio/Video Transkription

Transkribiert Audio/Video via Whisper über den nodrift /jobs/dispatch-Flow (Spec 2026-05). Erwartet file_key aus dem Presign-Upload. Antwortet mit job_id; Client pollt /api/nodrift/jobs/<id> bis status=completed — dort liegen transcript, language, srt_url und vtt_url. Container-Erstellung nicht mehr nötig.

Parameter

Name Typ Beschreibung
file_key required string R2 file_key aus /api/nodrift/upload/presign.
language required string ISO-639-1-Code (de, en, fr, …). Leer lassen für Auto-Detect.
output_format string "text" (Default), "timestamps", "srt", "vtt".

Beispiele

cURL
BASH
curl -X POST "https://loadsh.it/api/transcript" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "[email protected]" \
  -F "language=de"
JavaScript
JAVASCRIPT
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('language', 'de');

const response = await fetch(
  'https://loadsh.it/api/transcript',
  {
    method: 'POST',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' },
    body: formData
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "job_id": "job_def456",
  "status": "processing"
}
GET /api/nodrift/jobs/:jobId

Job Status abrufen

Prüft den aktuellen Status eines laufenden oder abgeschlossenen Jobs.

Parameter

Name Typ Beschreibung
jobId required string Die Job-ID aus der ursprünglichen Anfrage

Beispiele

cURL
BASH
curl -X GET "https://loadsh.it/api/status/conv_abc123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/status/conv_abc123',
  {
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "status": "completed",
  "progress": 100,
  "download_url": "https://loadsh.it/api/nodrift/download/..."
}
POST /api/nodrift/jobs/dispatch

AI-/Boost-Tools dispatchen

Universeller Dispatch für alle 30+ KI-Boost-Tools (bg-remove, upscale, voice-isolate, document-scan, chat-pdf, slides-generate, video-dub, …). task_type wählt das Tool, ai_options sind tool-spezifisch (siehe nodrift-Capabilities-Endpoint für die Liste).

Parameter

Name Typ Beschreibung
service required string Immer "ai" für Boost-Tools.
task_type required string Tool-Slug, z.B. "bg-remove", "subtitle-generate", "chat-pdf". Liste via /api/nodrift/capabilities.
file_key string R2-File-Key aus dem Presign-Schritt. Bei slides-generate optional (Topic-only).
ai_options object Tool-spezifisches Object. Siehe nodrift-Spec — z.B. { output_bg, edge_feather } für bg-remove, { question, file_key, prior_messages } für chat-pdf.
target_lang string Optional — Übersetzungs-Ziel-Sprache für subtitle-generate (top-level, NICHT in ai_options).

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "job_id": "job_xxxxx",
  "status": "processing",
  "credits_cost": 4,
  "routing": {
    "use_gpu": true,
    "worker": "gpu"
  },
  "gpu_starting": false
}
GET /api/health

Health-Check

Status-Endpoint für Smoke-Tests. Antwortet mit { status: "ok", timestamp }. Kein Auth nötig — auch für externes Uptime-Monitoring brauchbar.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "status": "ok",
  "timestamp": 1735689600000
}
GET /api/nodrift/credits

Credit-Saldo

Liefert das aktuelle nodrift-Credit-Saldo des authentifizierten Accounts. Nützlich um vor einem Dispatch zu prüfen ob genug Credits vorhanden sind.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "credits": 142,
  "currency": "CHF"
}
GET /api/nodrift/jobs

Jobs-Liste

Listet eigene nodrift-Jobs (paginiert via ?limit & ?cursor). Filter: ?status=queued|processing|completed|failed.

Parameter

Name Typ Beschreibung
limit number Page size (default 20, max 100).
cursor string Cursor from previous response.
status string queued | processing | completed | failed

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "jobs": [
    {
      "job_id": "job_abc",
      "status": "completed",
      "task_type": "bg-remove"
    }
  ],
  "next_cursor": null
}
DELETE /api/nodrift/jobs/:jobId

Job abbrechen

Bricht einen laufenden Job ab. DELETE /api/nodrift/jobs/<job_id>. Falls der Job schon abgeschlossen ist: 409.

Parameter

Name Typ Beschreibung
jobId required string Job-ID aus Dispatch-Antwort.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "status": "cancelled"
}
POST /api/import-url

URL-Import

Lädt eine Datei von einer öffentlichen URL (YouTube, Direct-Download) statt eines Multipart-Uploads. Body: { url, target_format? }. Antwort enthält den jobId für /api/status.

Parameter

Name Typ Beschreibung
url required string Quelle (https-URL, YouTube/Vimeo/etc.).
target_format string Optional Zielformat — wenn gesetzt, läuft direkt nach Import die Konvertierung.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "jobId": "job_imp_xyz",
  "status": "queued"
}
POST /api/ai/:taskType

Universal AI-Tools

Einheitlicher Endpoint POST /api/ai/<task_type> für alle ~50 Boost-Tools (bg-remove, upscale, ocr-pro, headshot-generate, slides-generate, chat-pdf, math-solve, voice-clone, video-summarize, …). Body: { file_key, ai_options? } — bei slides-generate stattdessen { topic }, bei chat-pdf { pdf_file_key, question | prior_messages }. Antwort: { job_id, poll_url, gpu_starting, credits_cost }. Liste verfügbarer Tasks via GET /api/ai.

Parameter

Name Typ Beschreibung
:taskType required string Pfad-Parameter — z.B. bg-remove, upscale, ocr-pro, headshot-generate.
file_key string R2-Key aus /api/nodrift/upload/presign. Nicht nötig für slides-generate (nutze topic) oder chat-pdf (nutze pdf_file_key).
ai_options object Task-spezifische Parameter (z.B. scale=2 für upscale, tone=professional für cover-letter).

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "job_id": "job_abc123",
  "status": "queued",
  "gpu_starting": false,
  "credits_cost": 2,
  "poll_url": "https://loadsh.it/api/nodrift/jobs/job_abc123"
}
GET /api/ai

Tool-Discovery

Listet alle verfügbaren Task-Types mit Endpoint-Pfad und Pflicht-Inputs. Nutze /api/nodrift/capabilities für Limits + Credit-Kosten je Task.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "tasks": [
    {
      "task_type": "bg-remove",
      "service": "image-gen",
      "endpoint": "/api/ai/bg-remove",
      "required_input": "file_key"
    },
    {
      "task_type": "slides-generate",
      "service": "llm",
      "endpoint": "/api/ai/slides-generate",
      "required_input": "topic"
    },
    {
      "task_type": "chat-pdf",
      "service": "llm",
      "endpoint": "/api/ai/chat-pdf",
      "required_input": "pdf_file_key+question"
    }
  ]
}
GET /api/nodrift/capabilities

Tool-Capabilities abfragen

Listet alle verfügbaren Tools mit Pricing, Engine, Burst-Tier, max_input_mb und supported_languages. Cached 5 min Edge-seitig. Auth nicht erforderlich.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "tools": {
    "bg-remove": {
      "available": true,
      "credit_cost": 2,
      "category": "gpu",
      "max_input_mb": 25
    },
    "subtitle-generate": {
      "available": true,
      "credit_cost": 3,
      "category": "gpu",
      "burst_tier": "whisper"
    },
    "chat-pdf": {
      "available": true,
      "credit_cost": 1,
      "category": "workers-ai"
    }
  }
}
POST /api/nodrift/gpu/warmup

GPU-Pre-Warm triggern

Optional — kickt den GPU-Burst-Container für eine Service-Kategorie an, BEVOR der eigentliche Job dispatched wird. Spart 30-60s Cold-Start. Body: { service, task_type? }. Service ist einer von "vision" | "ocr" | "llm" | "image-gen" | "audio-gen" | "video" | "transcribe".

Parameter

Name Typ Beschreibung
service required string GPU-Pool-Name (siehe Spec).
task_type string Optional — präzisiert den Pool falls service mehrere abdeckt.

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "triggered": true,
  "status": 202
}
GET /api/user/api-keys

API Keys auflisten

Listet alle API Keys des authentifizierten Benutzers auf.

Beispiele

cURL
BASH
curl -X GET "https://loadsh.it/api/user/api-keys" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys',
  {
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "keys": [
    {
      "id": "key_123",
      "name": "Production",
      "created_at": "2025-01-01",
      "last_used": "2025-01-03"
    }
  ]
}
POST /api/user/api-keys

API Key erstellen

Erstellt einen neuen API Key. Der vollständige Key wird nur einmal angezeigt!

Parameter

Name Typ Beschreibung
name required string Name/Beschreibung des Keys

Beispiele

cURL
BASH
curl -X POST "https://loadsh.it/api/user/api-keys" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "My App"}'
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer lsh_live_xxxx',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ name: 'My App' })
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "key": {
    "id": "key_456",
    "name": "My App",
    "token": "lsh_live_xxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
DELETE /api/user/api-keys/:id

API Key löschen

Löscht einen API Key unwiderruflich.

Parameter

Name Typ Beschreibung
id required string ID des zu löschenden Keys

Beispiele

cURL
BASH
curl -X DELETE "https://loadsh.it/api/user/api-keys/key_123" \
  -H "Authorization: Bearer lsh_live_xxxx"
JavaScript
JAVASCRIPT
const response = await fetch(
  'https://loadsh.it/api/user/api-keys/key_123',
  {
    method: 'DELETE',
    headers: { 'Authorization': 'Bearer lsh_live_xxxx' }
  }
);
const data = await response.json();

Response

JSON
{
  "success": true,
  "message": "Key deleted"
}

Fehlercodes

Code Bedeutung
400 Ungültige Anfrage (fehlende Parameter)
401 Nicht authentifiziert (ungültiger API Key)
403 Zugriff verweigert (Limit erreicht)
404 Job oder Ressource nicht gefunden
413 Datei zu gross
429 Zu viele Anfragen
500 Server-Fehler