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

SDK

모든 프로그래밍 언어를 위한 공식 SDK

Python, Node.js, Go, Ruby, Java, PHP용 타입 안전 클라이언트입니다. 비동기 작업 폴링, 웹훅 도우미, 자동 재시도 기능을 내장하고 있습니다.

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

모델별 SDK는 동일한 작업 객체, 인증, 오류 처리 및 요금 링크를 공유합니다.

HOW IT WORKS

RunAPI SDK로 AI 모델을 호출하는 방법

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

모든 스택을 위한 설계

웹 애플리케이션

몇 줄의 코드로 앱에 AI 생성을 추가하세요. Webhook 도우미가 비동기 전달을 처리합니다.

백엔드 서비스

생성 요청을 대규모로 처리하세요. 기본 제공 재시도와 속도 제한으로 서비스 안정성을 유지합니다.

데이터 파이프라인

학습 데이터를 생성하고 데이터셋을 보강하거나 ML 파이프라인의 일부로 합성 미디어를 만드세요.

개발자가 RunAPI SDK를 선택하는 이유

OpenAI-Compatible

바로 교체할 수 있습니다. 기존 코드를 유지하고 base URL만 변경하세요.

Full Type Safety

모든 모델, 엔드포인트 및 매개변수에 TypeScript와 Python 타입을 제공합니다.

Async & Streaming

지원되는 모든 언어에서 네이티브 async/await와 SSE 스트리밍을 사용할 수 있습니다.

RunAPI SDK questions

RunAPI는 Python, Node.js, PHP, Java, Ruby, Go용 모델별 SDK를 유지 관리합니다. PHP 패키지는 Packagist에 배포되며 Composer로 설치할 수 있습니다. 각 패키지는 하나의 모델 계열을 대상으로 하며, Elixir, .NET 및 HTTPS 요청을 보낼 수 있는 모든 런타임에서는 REST API를 사용할 수 있습니다.

더 살펴보기

팀과 함께 구축하고 계신가요?

엔터프라이즈 설정, 통합, 기술 문의를 도와드립니다.

문의하기