Skip to content

The API, in the language you already write

Two official packages, TypeScript and Python, wrapping the same key authenticated API. Auth, retries, typed errors and the polling loop are the client's problem, not yours.

@raid_ai/sdk

npm
npm install @raid_ai/sdk
Runs on
Node 18 and up, and the browser
Ships as
ESM and CommonJS, with types
Client
RaidClient

raidxai

PyPI
pip install raidxai
Runs on
Python 3.10 and up
Ships as
Sync and async clients on httpx, Pydantic models
Client
RaidClient and AsyncRaidClient
The source for both packages is public at Raid-AI-Corporation/raid-ai-sdks on GitHub.

Six things you do not write

Bearer auth

Give the client a key and a base URL once. Every call carries the header.

Retry with backoff

Rate limits, server errors and dropped connections are retried with exponential backoff. Other client errors fail fast.

Typed errors

An API error arrives as a typed exception carrying the status and the server's message, not as a string to parse.

Submit and wait

Video is a job. The client submits it and polls until the job finishes, with the interval and timeout in your hands.

Types from the spec

Request and response types are generated from the OpenAPI spec, so the client and the API cannot disagree about a field.

Limits you can read

Cost per frame, the longest video allowed and today's usage are account settings. Read them from the client rather than hard coding them.

The polling loop, gone

A video is a job: submitted, then polled until it finishes. The client does the polling and hands you the finished job, with the verdict on it. Set the interval and the timeout if the defaults do not suit; leave them if they do.

Submit a video and wait

TypeScript
import { readFileSync } from "node:fs";
import { RaidClient } from "@raid_ai/sdk";

const raid = new RaidClient({
  apiKey: process.env.RAID_API_KEY!,
  baseUrl: "https://api.raidxai.com",
});

const job = await raid.video.submitAndWait(
  { data: readFileSync("clip.mp4"), fileName: "clip.mp4" },
  { intervalMs: 3000, timeoutMs: 300_000 },
);

console.log(job.status, job.result?.verdict);

The same call

Python
import os
from raidxai import FileInput, RaidClient

raid = RaidClient(
    api_key=os.environ["RAID_API_KEY"],
    base_url="https://api.raidxai.com",
)

job = raid.video.submit_and_wait(
    FileInput.from_path("clip.mp4"),
    interval_seconds=3,
    timeout_seconds=300,
)

print(job.status, job.result.verdict if job.result else None)

Hold the client, not the plumbing.

Install the package, set a key, make the first call. If something in the client gets in your way, tell us and we will fix the client.