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

SDK

Her programlama dili için resmî SDK’lar

Python, Node.js, Go, Ruby, Java ve PHP için tür güvenli istemciler. Yerleşik asenkron görev sorgulama, webhook yardımcıları ve otomatik yeniden denemeler.

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

Modele özgü SDK’lar aynı görev nesnesini, kimlik doğrulamasını, hata yönetimini ve fiyatlandırma bağlantılarını paylaşır.

HOW IT WORKS

RunAPI SDK ile yapay zekâ modeli nasıl çağrılır

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

Her stack için tasarlandı

Web uygulamaları

Birkaç satır kodla uygulamanıza yapay zeka üretimi ekleyin. Webhook yardımcıları asenkron teslimatı yönetir.

Backend hizmetleri

Üretim isteklerini ölçekli şekilde işleyin. Yerleşik yeniden denemeler ve hız sınırlama hizmetinizi güvenilir tutar.

Veri işlem hatları

Eğitim verileri üretin, veri kümelerini zenginleştirin veya ML işlem hattınızın parçası olarak sentetik medya oluşturun.

Geliştiriciler neden RunAPI SDK’larını seçiyor?

OpenAI-Compatible

Doğrudan geçiş yapın. Temel URL’yi değiştirin, mevcut kodunuzu koruyun.

Full Type Safety

Her model, uç nokta ve parametre için TypeScript ve Python türleri.

Async & Streaming

Desteklenen tüm dillerde yerel async/await ve SSE akışı.

RunAPI SDK questions

RunAPI; Python, Node.js, PHP, Java, Ruby ve Go için modele özel SDK’ların bakımını yapar. PHP paketleri Packagist üzerinde yayımlanır ve Composer ile yüklenebilir. Her paket bir model ailesini hedefler; REST API ise Elixir, .NET ve HTTPS istekleri gönderebilen tüm çalışma ortamları için kullanılabilir.

Daha fazlasını keşfedin

Bir ekiple mi geliştiriyorsunuz?

Kurumsal kurulum, entegrasyonlar ve teknik sorular konusunda yardımcı oluruz.

İletişime geçin