Back

API Documentation

REST API for programmatic access to all LoadSh.it services

v1.0

Introduction

The LoadSh.it API provides programmatic access to file conversion, security scans, transcription and all AI Boost tools (bg-remove, upscale, subtitle generation, whiteboard-to-diagram, chat-with-PDF, slide generator and more).

80+ Formats

Video, audio, images, documents

ClamAV Scan

Enterprise antivirus

Whisper AI

Transcription in 99 languages

Boost AI Tools

30+ GPU/LLM tools, unified dispatch API

Authentication

All API requests require a valid API key in the Authorization Header. API keys can be created in the Settings .

HTTP Header
Authorization: Bearer lsh_live_xxxxxxxxxxxxxxxxxxxxxxxx
Important: Store your API key securely. It is only displayed once at creation and cannot be recovered.

Base URL

https://loadsh.it/api

All endpoints are relative to this base URL.

Rate Limits

The API currently has no strict rate limits for authenticated users. We reserve the right to introduce limits in case of abuse.

Requests/Min Max File Size
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.

Parameters

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

Examples

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

Convert file

Converts a file to another format. Two paths: EITHER `jobId` from the /api/upload multipart flow (frontend), OR `file_key` from /api/nodrift/upload/presign (programmatic API use — recommended). Response contains `job_id` for polling via /api/nodrift/jobs/<id>. No container creation needed — nodrift.ch manages the GPU pool serverlessly.

Parameters

Name Type Description
jobId required string Job ID from /api/upload (frontend) OR file_key from /api/nodrift/upload/presign (API).
targetFormat required string Target format (e.g. "mp4", "pdf", "png").
processing_mode string "auto" | "force_cpu" | "force_gpu" — with file_key path, routing is automatic.

Examples

cURL
BASH
curl -X POST "https://loadsh.it/api/convert" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "file=@video.mov" \
  -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

Security Scan

Scans a file for viruses, malware, and other threats using ClamAV & YARA Rules.

Parameters

Name Type Description
file_key required string The file to scan (multipart/form-data)
original_filename string Original-Dateiname für Logs/Verlauf.

Examples

cURL
BASH
curl -X POST "https://loadsh.it/api/scan" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "file=@download.exe"
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 transcription

Transcribes audio/video via Whisper through the nodrift /jobs/dispatch flow (Spec 2026-05). Expects file_key from the presign upload. Returns job_id; client polls /api/nodrift/jobs/<id> until status=completed — that contains transcript, language, srt_url and vtt_url. No container creation needed anymore.

Parameters

Name Type Description
file_key required string R2 file_key from /api/nodrift/upload/presign.
language required string ISO-639-1 code (de, en, fr, …). Leave empty for auto-detect.
output_format string "text" (default), "timestamps", "srt", "vtt".

Examples

cURL
BASH
curl -X POST "https://loadsh.it/api/transcript" \
  -H "Authorization: Bearer lsh_live_xxxx" \
  -F "file=@interview.mp4" \
  -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

Get Job Status

Checks the current status of a running or completed job.

Parameters

Name Type Description
jobId required string The job ID from the original request

Examples

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

Dispatch AI/Boost tool

Universal dispatch for all 30+ AI Boost tools (bg-remove, upscale, voice-isolate, document-scan, chat-pdf, slides-generate, video-dub, …). task_type picks the tool, ai_options are tool-specific (see /api/nodrift/capabilities for the full list).

Parameters

Name Type Description
service required string Always "ai" for Boost tools.
task_type required string Tool slug, e.g. "bg-remove", "subtitle-generate", "chat-pdf". List via /api/nodrift/capabilities.
file_key string R2 file_key from the presign step. Optional for slides-generate (topic-only).
ai_options object Tool-specific object. See nodrift spec — e.g. { output_bg, edge_feather } for bg-remove, { question, file_key, prior_messages } for chat-pdf.
target_lang string Optional — translation target language for subtitle-generate (top-level, NOT in ai_options).

Examples

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 for smoke tests. Returns { status: "ok", timestamp }. No auth required — also fine for external uptime monitoring.

Examples

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 balance

Returns the authenticated account's current nodrift credit balance. Useful for pre-flight checks before dispatching expensive jobs.

Examples

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 list

Lists your own nodrift jobs (paginated via ?limit & ?cursor). Filter: ?status=queued|processing|completed|failed.

Parameters

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

Examples

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

Cancel job

Aborts a running job. DELETE /api/nodrift/jobs/<job_id>. If the job already finished: 409.

Parameters

Name Type Description
jobId required string Job-ID aus Dispatch-Antwort.

Examples

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

Import from URL

Imports a file from a public URL (YouTube, direct downloads) instead of a multipart upload. Body: { url, target_format? }. Returns a jobId for /api/status.

Parameters

Name Type Description
url required string Source (https URL, YouTube/Vimeo/etc.).
target_format string Optional target format — if set, conversion runs straight after import.

Examples

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

Unified endpoint POST /api/ai/<task_type> for all ~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? } — for slides-generate use { topic }, for chat-pdf { pdf_file_key, question | prior_messages }. Response: { job_id, poll_url, gpu_starting, credits_cost }. List available tasks via GET /api/ai.

Parameters

Name Type Description
:taskType required string Path parameter — e.g. bg-remove, upscale, ocr-pro, headshot-generate.
file_key string R2 key from /api/nodrift/upload/presign. Not needed for slides-generate (use topic) or chat-pdf (use pdf_file_key).
ai_options object Task-specific parameters (e.g. scale=2 for upscale, tone=professional for cover-letter).

Examples

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

Lists all available task types with endpoint path and required inputs. Use /api/nodrift/capabilities for limits + credit costs per task.

Examples

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

Query tool capabilities

Lists all available tools with pricing, engine, burst tier, max_input_mb and supported_languages. Cached 5 min at the edge. No auth required.

Examples

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

Trigger GPU pre-warm

Optional — kicks the GPU burst container for a service category BEFORE the actual job is dispatched. Saves 30-60s cold-start. Body: { service, task_type? }. Service is one of "vision" | "ocr" | "llm" | "image-gen" | "audio-gen" | "video" | "transcribe".

Parameters

Name Type Description
service required string GPU pool name (see spec).
task_type string Optional — refines the pool if service covers multiple.

Examples

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

List API Keys

Lists all API keys of the authenticated user.

Examples

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

Create API Key

Creates a new API key. The full key is only shown once!

Parameters

Name Type Description
name required string Name/description of the key

Examples

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

Delete API Key

Permanently deletes an API key.

Parameters

Name Type Description
id required string ID of the key to delete

Examples

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"
}

Error Codes

Code Meaning
400 Invalid request (missing parameters)
401 Not authenticated (invalid API key)
403 Access denied (limit reached)
404 Job or resource not found
413 File too large
429 Too many requests
500 Server error