Developer Docs

Von außen kommt nur Client-ID, API-Key und dein Prompt – alles andere übernimmt die Plattform.

1. Authentifizierung

Erstelle im Dashboard unter Settings → API einen Client. Du erhältst clientId und apiKey.

X-Client-Id: oxc_live_7f3a9c21
X-Api-Key: oxk_live_4b91e0...

2. Generierung

curl -X POST https://aicloud.orrix.ch/api/v1/generate \
  -H "X-Client-Id: $CLIENT_ID" \
  -H "X-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1029" \
  -d '{
    "type": "video",
    "model": "grok-video",
    "prompt": "cinematic cyberpunk city at night, neon rain, slow dolly-in",
    "negativePrompt": "blurry, low quality, watermark, text",
    "aspectRatio": "19:9",
    "duration": 10,
    "resolution": "720p",
    "webhookUrl": "https://mein-shop.ch/hooks/ox",
    "metadata": { "orderId": "A-1029" }
  }'

Antwort 202 Accepted:

{
  "jobId": "clx9f2k0b0001",
  "status": "queued",
  "taskType": "VIDEO",
  "model": "grok-video",
  "coins": { "reserved": 48, "balanceAfter": 1952 },
  "requested": { "aspectRatio": "19:9", "duration": 10 },
  "applied":   { "aspectRatio": "16:9", "duration": 10 },
  "warnings": ["Seitenverhältnis 19:9 wird von diesem Modell nicht unterstützt – verwende 16:9."],
  "pollUrl": "/api/v1/jobs/clx9f2k0b0001"
}

3. Job-Status

GET https://aicloud.orrix.ch/api/v1/jobs/{jobId}
→ { status, progress, assets: [{ id, url, thumbUrl, width, height, durationSec }], costCoins }

4. Fehlercodes

400invalid_params
401invalid_client
402insufficient_coins
403scope_or_ip_denied
404model_not_found
409idempotency_conflict
429rate_limited
500provider_error
503queue_full

5. Webhooks

Signatur via X-OX-Signature: t=…,v1=… (HMAC-SHA256). Retry mit Backoff bei 5xx (5 Versuche).

{ "event": "job.succeeded", "jobId": "...", "assets": [...], "costCoins": 48 }