Quickstart
Get your first AI generation running in under 5 minutes.
Step 1: Get an API Key
Create a RunAPI account and generate a key from the dashboard. Keys are scoped per project, so you can rotate or revoke one without touching the rest of your setup.
Step 2: Install the SDK
Pick the client for your language. Every SDK ships full type definitions and built-in task polling.
SHELL
pip install runapi
npm install runapi
go get github.com/runapi/runapi-go
Step 3: Create Your First Task
Media generation is asynchronous. Submitting a task returns immediately; task.wait() blocks until the output is ready.
$ pip install runapi
from runapi import RunAPI
client = RunAPI()
task = client.generate(
model="kling-v2.1",
prompt="A cat walking on a beach",
duration=5
)
result = task.wait()
print(result.output_url)
Step 4: Check the Result
The completed task carries the output URL, duration, and the exact cost deducted from your balance.
JSON
{
"task_id": "tsk_8f21c4ba",
"status": "completed",
"output": {
"url": "https://cdn.runapi.ai/v/tsk_8f21c4ba.mp4",
"duration": 5
},
"cost": { "amount": 0.21, "currency": "USD" }
}