HappyHorse API-Dokumentation

Vollständige Anleitung zur Integration der HappyHorse 1.0 Video-Generierungs-API in Ihre Anwendungen.

API v1.0 Base URL: https://happyhorse.app

Schnellstart

bash
curl -X POST 'https://happyhorse.app/api/generate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "happyhorse-1.0/video",
    "prompt": "A cinematic shot of mountains at sunrise",
    "mode": "pro",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'

Authentifizierung

Alle API-Anfragen erfordern eine Authentifizierung mit einem Bearer-Token im Authorization-Header.

API-Schlüssel erhalten: Ihren API-Schlüssel finden Sie auf der Seite „API Keys“ in Ihrem Dashboard. → API-Schlüssel erhalten

http
Authorization: Bearer YOUR_API_KEY

Verfügbare Modelle

HappyHorse 1.0

HappyHorse 1.0

Hochwertige KI-Videogenerierung mit HappyHorse

TypBeschreibungDauerCredits
pro (text-to-video)Pro-Qualität Text-zu-Video3-15s54/s (no audio) · 80/s (with audio)
pro (image-to-video)Pro-Qualität Bild-zu-Video3-15s54/s (no audio) · 80/s (with audio)
std (text-to-video)Standard-Qualität Text-zu-Video3-15s40/s (no audio) · 60/s (with audio)
std (image-to-video)Standard-Qualität Bild-zu-Video3-15s40/s (no audio) · 60/s (with audio)

API-Endpunkte

Erstellt eine neue Videogenerierungsaufgabe. Das Feld model muss 'happyhorse-1.0/video' sein.

Anfragetext

Body-ParameterJSON
model:string

Modellname, muss 'happyhorse-1.0/video' sein

prompt:optional string

Textbeschreibung des Videos (max. 2500 Zeichen). Nicht erforderlich, wenn multi_shots true ist.

mode:optional string

Qualitätsmodus: 'pro' oder 'std' (Standard: std) Defaults to std.

duration:optional number

Videodauer in Sekunden (3–15, Standard: 5) Defaults to 5.

aspect_ratio:optional string

Ausgabe-Seitenverhältnis (16:9, 9:16, 1:1) Defaults to 16:9.

image_urls:optional string[]

Array von Bild-URLs für Image-to-Video

sound:optional boolean

Native Audiogenerierung aktivieren (Standard: true) Defaults to true.

cfg_scale:optional number

Prompt-Treue (0-1, Standard: 0.5). Höhere Werte folgen dem Prompt enger. Defaults to 0.5.

multi_shots:optional boolean

Multi-Shot-Modus mit mehreren Prompts Defaults to false.

multi_prompt:optional array

Array von 'prompt, duration'-Objekten für den Multi-Shot-Modus (max. 5 Shots, je max. 500 Zeichen, Dauer 1-12 s)

happyhorse_elements:optional array

Array von Element-Objekten. Im Prompt @ direkt vor den Wert von name schreiben (z. B. name 'element_dog' → @element_dog im Prompt). Jedes Element: name, description, element_input_urls (2-4 Bild-URLs). Max. 3 Elemente pro Aufgabe.

Text zu Video

json
{
  "model": "happyhorse-1.0/video",
  "prompt": "A majestic eagle soaring through clouds at sunset",
  "mode": "pro",
  "duration": 5,
  "aspect_ratio": "16:9",
  "sound": true
}

Bild zu Video

json
{
  "model": "happyhorse-1.0/video",
  "prompt": "The character slowly turns and smiles",
  "mode": "pro",
  "image_urls": ["https://example.com/my-image.jpg"],
  "duration": 5
}

Multi-Shot-Video

json
{
  "model": "happyhorse-1.0/video",
  "mode": "pro",
  "multi_shots": true,
  "multi_prompt": [
    { "prompt": "A woman walks into a coffee shop", "duration": 3 },
    { "prompt": "She orders a latte and sits by the window", "duration": 4 },
    { "prompt": "She looks outside and smiles", "duration": 3 }
  ],
  "aspect_ratio": "16:9"
}

Antworten

Task created successfully

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n92abc123hh10",
    "status": "IN_PROGRESS"
  }
}

Prüft den Status einer Videogenerierung anhand der task_id vom Generate-Endpunkt.

Abfrageparameter

Abfrageparameter
task_id:string

Eindeutige Aufgaben-ID vom Generate-Endpunkt (Präfix n92)

Beispielanfrage

bash
curl -X GET 'https://happyhorse.app/api/status?task_id=n92abc123hh10' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Tipp: Das Feld response enthält ein resultUrls-Array. Nutzen Sie data.response.resultUrls[0] für die Video-URL.

javascript
// Extract video URL from response
const videoUrl = data.response.resultUrls[0];

Antworten

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n92abc123hh10",
    "status": "SUCCESS",
    "consumed_credits": 400,
    "created_at": "2026-04-08T10:30:00Z",
    "type": "text-to-video",
    "request": {
      "model": "happyhorse-1.0/video",
      "prompt": "A majestic eagle soaring through clouds at sunset",
      "mode": "pro",
      "duration": 5,
      "aspect_ratio": "16:9"
    },
    "response": {
      "resultUrls": [
        "https://cdn.example.com/videos/abc123.mp4"
      ]
    },
    "error_message": null
  }
}

API-Playground

Testen Sie die API direkt im Browser. Ersetzen Sie YOUR_API_KEY durch Ihren echten API-Schlüssel.

API-PlaygroundPOST

Fehlercodes

HTTP-StatusCodeBeschreibung
400 Ungültige AnfrageINVALID_PROMPTDer Prompt ist ungültig oder leer
400 Ungültige AnfrageINVALID_DURATIONDauer außerhalb des unterstützten Bereichs (3–15 s)
400 Ungültige AnfrageINVALID_MODELModell muss 'happyhorse-1.0/video' sein
401 Nicht autorisiertINVALID_API_KEYAPI-Schlüssel fehlt oder ist ungültig
402 Zahlung erforderlichINSUFFICIENT_CREDITSNicht genügend Credits für diesen Vorgang
429 Zu viele AnfragenRATE_LIMITEDZu viele Anfragen, bitte langsamer
500 Interner ServerfehlerINTERNAL_ERRORServerfehler, bitte später erneut versuchen