RunAPI SDK.
Typed clients for 130+ AI models.
RunAPI SDKs give JavaScript, Ruby, and Go apps one typed integration layer for 130+ 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
export RUNAPI_API_KEY="runapi_..."
node create-video.mjs
gem install runapi-kling
export RUNAPI_API_KEY="runapi_..."
ruby create_video.rb
go get github.com/runapi-ai/kling-sdk/go
export RUNAPI_API_KEY="runapi_..."
go run ./cmd/create-video
The exported SDK contract lists 133 public model IDs across media and LLM endpoints.
The SDK contract maps 85 request operations so clients can keep endpoint names and model IDs aligned.
JavaScript, Ruby, and Go packages are published for model-specific SDKs, with REST available for any other runtime.
Create, poll, webhook callback, and failure handling stay consistent across model families.
What is the RunAPI SDK?
The RunAPI SDK is a set of model-specific clients for the RunAPI platform. Each package wraps one model family with typed request helpers, shared authentication, task polling, and response decoding. Developers keep the same API key, billing account, task ID, callback pattern, and error surface while switching between video, image, music, audio, and LLM models.
Install the SDK for the model you are using.
RunAPI publishes model SDKs instead of forcing every app to install every model. Start with the package for your model family, then add more packages only when your product needs them.
npm install @runapi.ai/kling
npm install @runapi.ai/suno
npm install @runapi.ai/flux-kontext
gem install runapi-kling
gem install runapi-suno
gem install runapi-flux-kontext
go get github.com/runapi-ai/kling-sdk/go
go get github.com/runapi-ai/suno-sdk/go
go get github.com/runapi-ai/flux-kontext-sdk/go
What the SDK handles for production apps
Typed model requests
Each model SDK exposes request fields that match the RunAPI contract, so application code can use model IDs and endpoint parameters without copying raw API examples into every service.
Async task polling
Long-running media jobs return task IDs. SDK helpers preserve that lifecycle: create a task, poll status, and read the terminal output object when generation completes or fails.
Unified auth and billing
One RUNAPI_API_KEY works across supported model SDKs. Usage is billed through the same account, and failed generation tasks are not charged.
Call a model in 4 steps
Pick a model SDK
Choose the package that matches the model family you want to integrate, such as Kling for video, Suno for music, or Flux Kontext for image workflows.
npm install @runapi.ai/kling
Set your API key
Store the key in RUNAPI_API_KEY. The SDK reads the same key used by the REST API, CLI, MCP server, and agent skills.
export RUNAPI_API_KEY=...
Create the task
Send the typed request through the SDK. Media endpoints return a RunAPI task ID quickly, so your application can continue without blocking a web request.
client.textToVideo.run(...)
Poll or use webhooks
Poll the task from your worker, or configure a callback URL and let RunAPI notify your backend when the generation reaches a terminal state.
task.status == "completed"
Start with a model-specific SDK
| Package | Language | Best for | Docs |
|---|---|---|---|
| @runapi.ai/kling | JavaScript | Kling video generation | View → |
| runapi-kling | Ruby | Kling video generation | View → |
| github.com/runapi-ai/kling-sdk/go | Go | Kling video generation | View → |
| @runapi.ai/suno | JavaScript | Suno music generation | View → |
| @runapi.ai/flux-kontext | JavaScript | Flux Kontext image workflows | View → |
| @runapi.ai/core | JavaScript | Shared SDK runtime helpers | View → |
When to use SDKs, REST, CLI, or skills
SDK
Application backend code
Typed helpers, package-managed upgrades, shared task polling, and model-specific request fields.
REST API
Any language or thin integration
Direct HTTP calls with the same API key, endpoint paths, task IDs, and callback behavior.
CLI
Local scripts and CI jobs
JSON-first terminal commands for automation, smoke tests, and one-off generation tasks.
Agent skills
Claude Code, Codex, Cursor, and agent runtimes
Installable model context so coding agents can find docs, schemas, and setup instructions.
Use the same model catalog across every developer surface
SDK docs
Read model-specific SDK docs and package links in the generated API reference.
View →Model catalog
Compare supported model IDs, endpoint names, pricing links, and capabilities before choosing an SDK.
View →CLI
Use the CLI for automation and quick smoke tests with the same task lifecycle.
View →Agent skills
Install model context into coding agents when you want an AI assistant to wire the SDK into your app.
View →RunAPI SDK questions
Which languages have RunAPI SDKs?
RunAPI publishes model-specific SDKs for JavaScript, Ruby, and Go. Each package targets one model family, while the REST API remains available for Python, PHP, Java, Elixir, .NET, and any runtime that can send HTTPS requests.
Why are RunAPI SDKs model-specific?
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.
How many models does the SDK contract cover?
The current exported contract covers 133 public model IDs and 85 request operations. That contract is generated from the RunAPI catalog and is used to keep SDK examples, CLI metadata, and API documentation aligned.
Do SDK calls use a different API key?
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.
Can I use webhooks with the SDK?
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.
Where should I check pricing before using an SDK?
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.
Build with typed SDKs and one RunAPI key.
Pick a model SDK, create a free API key, and ship the same task lifecycle across video, image, music, audio, and LLM features.