> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidjutsu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

> TypeScript SDK for the VidJutsu video intelligence API

The VidJutsu SDK is a typed TypeScript client auto-generated from the [OpenAPI spec](https://raw.githubusercontent.com/tfcbot/vidjutsu-openapi/main/openapi/spec.json). Every method is fully typed — request bodies, response shapes, and query parameters.

## Install

```bash theme={null}
npm install vidjutsu
```

## Quick start

```typescript theme={null}
import { createClient } from "vidjutsu";

const vj = createClient();

// Watch a video
const { data } = await vj.watchMedia({
  mediaUrl: "https://cdn.example.com/video.mp4",
  prompt: "Is the hook strong enough for fitness TikTok?",
});
console.log(data.response);

// Extract frames and audio
const { data: extract } = await vj.extractMedia({
  mediaUrl: "https://cdn.example.com/video.mp4",
  frames: "auto",
  audio: true,
});

// Transcribe speech
const { data: transcript } = await vj.transcribeMedia({
  mediaUrl: "https://cdn.example.com/video.mp4",
});
console.log(transcript.transcript);

// Scan a caption against Instagram's policies
const { data: compliance } = await vj.checkCompliancePrompt({
  text: "Get rich in 30 days guaranteed",
  platform: "instagram",
});
```

## Methods

Each intelligence call counts against the endpoint's daily rate-limit bucket. Storage methods are unmetered. See [Pricing & Rate Limits](/credits-and-billing) for limits.

| Method                                                                                               | Description                                   |
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [`watchMedia`](/sdk/watch)                                                                           | AI watches a video/image, answers your prompt |
| [`extractMedia`](/sdk/extract)                                                                       | Extract frames, audio, and metadata           |
| [`transcribeMedia`](/sdk/transcribe)                                                                 | Speech-to-text with word-level timing         |
| [`checkSpec`](/sdk/check)                                                                            | Validate a VidLang spec against rules         |
| `checkComplianceVideo`                                                                               | Scan a video against platform TOS             |
| `checkCompliancePrompt`                                                                              | Scan text against platform TOS                |
| [`createOverlay`](/sdk/overlay)                                                                      | Burn text overlay onto video                  |
| [`uploadFile`](/sdk/upload) / `uploadFromUrl`                                                        | Upload to CDN                                 |
| [`createAccount`](/sdk/accounts) / `listOrGetAccounts` / `updateAccount` / `deleteAccount`           | Manage accounts                               |
| [`createPost`](/sdk/posts) / `listOrGetPosts` / `updatePost` / `deletePost`                          | Manage posts                                  |
| [`createAsset`](/sdk/assets) / `listOrGetAssets` / `updateAsset` / `deleteAsset`                     | Manage assets                                 |
| [`createReference`](/sdk/references) / `listOrGetReferences` / `updateReference` / `deleteReference` | Manage references                             |
| `getUsage`                                                                                           | Remaining daily capacity per endpoint         |

## Authentication

The client resolves your API key in order:

1. **Explicit** — `createClient({ apiKey: "vj_live_..." })`
2. **Environment variable** — `VIDJUTSU_API_KEY`
3. **Config file** — `~/.vidjutsu/config.json` (shared with the [CLI](/cli/auth))

```typescript theme={null}
// Reads from env var or config file automatically
const vj = createClient();

// Or pass explicitly
const vj = createClient({ apiKey: "vj_live_..." });

// Custom base URL (for staging, self-hosted, etc.)
const vj = createClient({ baseUrl: "https://staging.api.vidjutsu.ai" });
```

## Raw client

For endpoints not covered by convenience methods, or for advanced usage, access the raw `openapi-fetch` client:

```typescript theme={null}
const { data, error } = await vj.api.GET("/v1/usage");
const { data, error } = await vj.api.POST("/v1/watch", {
  body: { mediaUrl: "...", prompt: "..." },
});
```

## Source

* [npm](https://www.npmjs.com/package/vidjutsu)
* [GitHub](https://github.com/tfcbot/vidjutsu-sdk)
