Skip to main content

Endpoint

POST https://routerbase.kuaibaike.com/api/v1/run/{model_id}
Replace {model_id} with any model ID from the Models page — video, image, or chat. The request format is the same for all models.

Request Headers

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

Root Parameters

prompt
string
Text prompt describing the desired output. Required for most models.
generation_type
string
Hint for the generation type. One of video, image, chat. Usually inferred automatically from the model.
callback_url
string
A URL that RouterBase will POST the completed result to. Optional — use this or poll for the result.
video_params
object
Video-specific parameters. See Video Parameters.
image_params
object
Image-specific parameters. See Image Parameters.
llm_params
object
LLM / chat parameters. See LLM Parameters.

Video Parameters

Passed inside video_params:
aspect_ratio
string
Output aspect ratio. Options: 16:9, 9:16, 1:1, 4:3, 3:4. Default: 16:9.
duration
number
Video length in seconds. Options: 5 or 10. Check the specific model page for supported values.
resolution
string
Output resolution. Options: 720p, 1080p.
image_urls
string[]
Reference image URLs for image-to-video generation.
video_urls
string[]
Reference video URLs for video-to-video generation.
enable_translation
boolean
Auto-translate the prompt to English before sending to the model. Default: false.
watermark
string
Optional watermark text to overlay on the output.
multi_shots
boolean
Generate multiple video shots. Default: false.

Image Parameters

Passed inside image_params:
aspect_ratio
string
Output aspect ratio. Default: 1:1.
width
number
Output width in pixels.
height
number
Output height in pixels.
negative_prompt
string
Description of what to exclude from the image.
seed
number
Random seed for reproducible results.
image_urls
string[]
Reference image URLs for image-to-image generation.

LLM Parameters

Passed inside llm_params:
temperature
number
Sampling temperature (0–2). Higher values = more creative output.
max_tokens
number
Maximum output tokens.
top_p
number
Nucleus sampling parameter (0–1).

Response

{
  "code": 200,
  "message": "Task submitted successfully",
  "task_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "status": "waiting"
}
task_id
string
Use this ID to poll for the result. See Task Status.
status
string
Initial status, always waiting at submission time.

Examples

Video Generation

curl -X POST https://routerbase.kuaibaike.com/api/v1/run/video_generate.kling_2_6 \
  -H "Authorization: Bearer sk-t0-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A surfer riding a massive wave at golden hour",
    "video_params": {
      "aspect_ratio": "16:9",
      "duration": 5
    }
  }'

Image Generation

curl -X POST https://routerbase.kuaibaike.com/api/v1/run/image_generate.imagen_4 \
  -H "Authorization: Bearer sk-t0-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A photorealistic cat sitting on a windowsill, soft morning light",
    "image_params": {
      "aspect_ratio": "1:1"
    }
  }'

Chat / LLM

curl -X POST https://routerbase.kuaibaike.com/api/v1/run/solve_problem.kie_reasoning \
  -H "Authorization: Bearer sk-t0-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Explain the difference between TCP and UDP in simple terms."
  }'