# Kuaishou Kling AI Tool

A unified HTTP API wrapper for Kuaishou Kling AI services, supporting AI video generation, AI image generation, and AI lip sync.

## Features

- **AI Image Generation**: Generate 1-4 images from text prompts
- **AI Video Generation**: Create videos from text or images with optional audio
- **AI Lip Sync**: Add lip sync effects to videos using text or audio

## API Endpoints

### POST /generate
Create a generation task.

**Request Body:**
```json
{
  "biz_type": "aiImage|aiVideo|aiLipSync",
  "prompt": "your prompt here",
  "aspect_ratio": "16:9",
  "image_count": 4,
  "cookie": "optional authentication cookie"
}
```

**Response:**
```json
{
  "task_id": "task_123",
  "status": "process|finished|failed",
  "result": {
    "images": ["url1", "url2"],
    "videos": ["url1"]
  }
}
```

### GET /status/{task_id}
Query task status.

**Query Parameters:**
- `biz_type`: Business type (aiImage, aiVideo, aiLipSync)
- `cookie`: Optional authentication cookie

## Installation

```bash
cd tools/local/kuaishou_kling
uv sync
```

## Running

```bash
uv run python main.py [port]
```

Default port: 8000

## Testing

```bash
uv run python tests/test_core.py
```

## Tool Registration

This tool has been registered to the tool registry with:
- **Tool ID**: kuaishou_kling
- **Category**: ai_generation
- **Runtime**: local (uv environment)
- **Port**: 8000
