TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const job = await client.videos.generate({
model: "veo-3.1-fast",
prompt: "A slow aerial pass over a neon city in the rain",
});
console.log(job.id);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
job = client.videos.generate(
model="veo-3.1-fast",
prompt="A slow aerial pass over a neon city in the rain",
)
print(job["id"])curl --request POST \
--url https://www.ninjachat.ai/api/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"object": "video",
"status": "queued",
"model": "<string>",
"cost_usd": 1,
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Media & search
Create a video job
Submit an async video job. Poll GET /videos/, or register a signed webhook (POST /webhooks or https://www.ninjachat.ai/developers/webhooks) for video.completed / video.failed.
POST
/
videos
TypeScript SDK
import { NinjaChat } from "@ninjachat/sdk";
const client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });
const job = await client.videos.generate({
model: "veo-3.1-fast",
prompt: "A slow aerial pass over a neon city in the rain",
});
console.log(job.id);import os
from ninjachat import NinjaChat
client = NinjaChat(api_key=os.environ["NINJACHAT_API_KEY"])
job = client.videos.generate(
model="veo-3.1-fast",
prompt="A slow aerial pass over a neon city in the rain",
)
print(job["id"])curl --request POST \
--url https://www.ninjachat.ai/api/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"object": "video",
"status": "queued",
"model": "<string>",
"cost_usd": 1,
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Use an API key created in the NinjaChat developer console.
Headers
Safely retry the same logical write without duplicate billing or execution.
Required string length:
1 - 255Body
application/json
Required string length:
1 - 4000Available options:
nova-reel, runway-gen4.5, seedance-2, seedance-2.0-fast, seedance-2-mini, seedance-2.0, seedance-1.5-pro, seedance-lite, seedance-pro, grok-imagine-video, grok-imagine-video-1.5, kling-2.5-turbo, kling-3-pro, wan-2.7, wan-2.7-i2v, wan-2.7-r2v, wan-2.6, wan-2.6-i2v, wan-2.2-t2v-a14b, fast-wan-2.2, fast-wan-qad, pruna-p-video, pixverse-6, pixverse-6-i2v, cosmos-3-nano, cosmos-3-super, vidu-q3, veo-3.1, veo-3.1-fast, kling-video, google-veo-2, google-veo-3-fast Required range:
4 <= x <= 15Available options:
16:9, 9:16 Maximum array length:
4