تطبيقات الويب
أضف توليد الذكاء الاصطناعي إلى تطبيقك ببضعة أسطر من التعليمات البرمجية. تتولى أدوات webhook التسليم غير المتزامن.
RunAPI SDKs give Python, Node.js, PHP, Java, Ruby, and Go apps one typed integration layer for 240+ AI models across video, image, music, audio, and LLM workflows. Install a model SDK, set RUNAPI_API_KEY, create a task, then poll or receive a webhook with the same task lifecycle used by the REST API.
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"
});
pip install runapi-kling
PyPI
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"
)
go get github.com/runapi-ai/kling-sdk/go@latest
Go modules
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
}
gem install runapi-kling
RubyGems
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"
)
implementation("ai.runapi:runapi-kling")
Maven
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()
);
}
}
composer require runapi-ai/kling
Packagist
<?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"
]);
Model-specific SDKs share the same task object, auth, error handling, and pricing links.
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"
)
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"
});
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
}
أضف توليد الذكاء الاصطناعي إلى تطبيقك ببضعة أسطر من التعليمات البرمجية. تتولى أدوات webhook التسليم غير المتزامن.
عالج طلبات التوليد على نطاق واسع. تحافظ عمليات إعادة المحاولة وتحديد المعدل المدمجة على موثوقية خدمتك.
ولّد بيانات التدريب أو عزز مجموعات البيانات أو أنشئ وسائط اصطناعية كجزء من مسار تعلم الآلة.
Drop-in replacement. Change the base URL, keep your existing code.
TypeScript and Python types for every model, endpoint, and parameter.
Native async/await and SSE streaming in all supported languages.
RunAPI publishes model-specific SDKs for Python, Node.js, PHP, Java, Ruby, and Go. Each package targets one model family, while the REST API remains available for Elixir, .NET, and any runtime that can send HTTPS requests.
Model-specific packages keep application dependencies small and make request fields easier to understand. A video app can install Kling or Seedance, a music app can install Suno, and a multimodal backend can add packages as new workflows ship.
The current exported contract covers 232 public model IDs and 128 request operations. That contract is generated from the RunAPI catalog and is used to keep SDK examples, CLI metadata, and API documentation aligned.
No. SDK calls use the same RunAPI API key as REST, CLI, MCP, and agent skills. Store it in RUNAPI_API_KEY or pass it through your deployment secret manager instead of hardcoding it in source code.
Yes. SDK-created tasks use the same task lifecycle as REST requests. You can poll task status from a worker, or configure callback handling so RunAPI sends your backend the terminal task payload.
Use the model catalog and pricing page before integrating a model. SDK docs link back to model pages so developers can check the current billing unit, endpoint shape, and supported model IDs without copying price values into code.
نساعدكم في إعدادات المؤسسات والتكاملات والأسئلة التقنية.