Claude visitors: new accounts receive $1.00 in bonus API credit within 30 days. One per person; usage credits only.

SDK

Offizielle SDKs für jede Programmiersprache

Typsichere Clients für Python, Node.js, Go, Ruby, Java und PHP. Integrierte Statusabfragen für asynchrone Aufgaben, Webhook-Hilfen und automatische Wiederholungen.

Python · Node.js · PHP · Java · Ruby · Go · REST-compatible
INSTALL npm install @runapi.ai/kling npm
import { KlingClient } from "@runapi.ai/kling";

const client = new KlingClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.textToVideo.create({
  "model": "kling-v3-turbo-text-to-video",
  "prompt": "A paper kite flying above a quiet coastal town at sunrise",
  "duration_seconds": 5,
  "aspect_ratio": "16:9",
  "output_resolution": "720p"
});

Modellspezifische SDKs verwenden dasselbe Aufgabenobjekt, dieselbe Authentifizierung, Fehlerbehandlung und dieselben Preislinks.

HOW IT WORKS

So rufen Sie ein KI-Modell mit einem RunAPI SDK auf

import { KlingClient } from "@runapi.ai/kling";

const client = new KlingClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.textToVideo.create({
  "model": "kling-v3-turbo-text-to-video",
  "prompt": "A paper kite flying above a quiet coastal town at sunrise",
  "duration_seconds": 5,
  "aspect_ratio": "16:9",
  "output_resolution": "720p"
});
import os
from runapi.kling import KlingClient

client = KlingClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_video.create(
  model="kling-v3-turbo-text-to-video",
  prompt="A paper kite flying above a quiet coastal town at sunrise",
  duration_seconds=5,
  aspect_ratio="16:9",
  output_resolution="720p"
)
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  kling "github.com/runapi-ai/kling-sdk/go/kling"
)

func main() {
  client, err := kling.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.TextToVideo.Create(context.Background(), kling.TextToVideoParams{
    Model: kling.TextToVideoModel("kling-v3-turbo-text-to-video"),
    Prompt: "A paper kite flying above a quiet coastal town at sunrise",
    DurationSeconds: 5,
    AspectRatio: "16:9",
    OutputResolution: kling.KlingTextToVideoOutputResolution("720p"),
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
require "runapi/kling"

client = RunApi::Kling::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.text_to_video.create(
  model: "kling-v3-turbo-text-to-video",
  prompt: "A paper kite flying above a quiet coastal town at sunrise",
  duration_seconds: 5,
  aspect_ratio: "16:9",
  output_resolution: "720p"
)
import ai.runapi.kling.KlingClient;
import ai.runapi.kling.types.TextToVideoParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    KlingClient client = KlingClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.textToVideo().create(
        TextToVideoParams.builder()
        .model("kling-v3-turbo-text-to-video")
        .prompt("A paper kite flying above a quiet coastal town at sunrise")
        .durationSeconds(5)
        .aspectRatio("16:9")
        .outputResolution("720p")
            .build()
    );
  }
}
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Kling\KlingClient;

$client = new KlingClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->textToVideo->create([
  "model" => "kling-v3-turbo-text-to-video",
  "prompt" => "A paper kite flying above a quiet coastal town at sunrise",
  "duration_seconds" => 5,
  "aspect_ratio" => "16:9",
  "output_resolution" => "720p"
]);

Für jeden Stack gebaut

Webanwendungen

Füge deiner Anwendung mit wenigen Codezeilen KI-Generierung hinzu. Webhook-Helfer übernehmen die asynchrone Zustellung.

Backend-Dienste

Verarbeite Generierungsanfragen im großen Maßstab. Integrierte Wiederholungen und Ratenbegrenzung halten deinen Dienst zuverlässig.

Datenpipelines

Erzeuge Trainingsdaten, erweitere Datensätze oder erstelle synthetische Medien als Teil deiner ML-Pipeline.

Warum Entwickler RunAPI SDKs wählen

OpenAI-Compatible

Direkter Ersatz. Ändern Sie die Basis-URL und behalten Sie Ihren bestehenden Code.

Full Type Safety

TypeScript- und Python-Typen für jedes Modell, jeden Endpunkt und jeden Parameter.

Async & Streaming

Native Unterstützung für async/await und SSE-Streaming in allen unterstützten Sprachen.

RunAPI SDK questions

RunAPI pflegt modellspezifische SDKs für Python, Node.js, PHP, Java, Ruby und Go. PHP-Pakete werden auf Packagist veröffentlicht und lassen sich mit Composer installieren. Jedes Paket richtet sich an eine Modellfamilie. Die REST API bleibt für Elixir, .NET und jede Laufzeitumgebung verfügbar, die HTTPS-Anfragen senden kann.

Mehr entdecken

Bauen Sie mit einem Team?

Wir helfen bei Enterprise-Setup, Integrationen und technischen Fragen.

Kontakt aufnehmen