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

SDK

Officiële SDK’s voor elke programmeertaal

Typeveilige clients voor Python, Node.js, Go, Ruby, Java en PHP. Met ingebouwde polling van asynchrone taken, webhookhelpers en automatische nieuwe pogingen.

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

Modelspecifieke SDK’s delen hetzelfde taakobject, dezelfde authenticatie, foutafhandeling en prijslinks.

HOW IT WORKS

Een AI-model aanroepen met een RunAPI SDK

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"
]);

Gebouwd voor elke stack

Webapplicaties

Voeg AI-generatie toe aan je app met een paar regels code. Webhook-helpers regelen asynchrone levering.

Backendservices

Verwerk generatieverzoeken op schaal. Ingebouwde retries en snelheidslimieten houden je service betrouwbaar.

Datapipelines

Genereer trainingsdata, verrijk datasets of maak synthetische media als onderdeel van je ML-pipeline.

Waarom ontwikkelaars kiezen voor RunAPI-SDK’s

OpenAI-Compatible

Direct vervangbaar. Wijzig de basis-URL en behoud uw bestaande code.

Full Type Safety

TypeScript- en Python-typen voor elk model, endpoint en parameter.

Async & Streaming

Native async/await en SSE-streaming in alle ondersteunde talen.

RunAPI SDK questions

RunAPI onderhoudt modelspecifieke SDK’s voor Python, Node.js, PHP, Java, Ruby en Go. PHP-pakketten worden gepubliceerd op Packagist en kunnen worden geïnstalleerd met Composer. Elk pakket richt zich op één modelfamilie, terwijl de REST-API beschikbaar blijft voor Elixir, .NET en elke runtime die HTTPS-verzoeken kan versturen.

Meer ontdekken

Bouw je met een team?

We helpen je met enterprise-inrichting, integraties en technische vragen.

Neem contact op