# Quickstart

> Get up and running with the WayinVideo API in minutes.

## Quickstart

Follow these steps to start using the WayinVideo API in minutes.

## 1. Obtain Your API Key

1. Log in to your [WayinVideo API Dashboard](https://wayin.ai/wayinvideo/api-dashboard)
2. Click **Create API Key** to generate a new key
3. Copy and securely store your API key

> **Important:** Keep your API key secret. Don't expose it in client-side code or public repositories.

## 2. Submit a Clipping Task

Send a video URL to submit an AI clipping task:

```bash
curl -X POST https://wayinvideo-api.wayin.ai/api/v2/clips \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "video_url": "https://www.youtube.com/watch?v=example",
    "enable_export": false
  }'
```

Response:

```json
{
  "data": {
    "id": "proj_abc123",
    "name": "sample project name",
    "status": "CREATED"
  }
}
```

## 3. Poll for Results

Poll the task status until it reaches `SUCCEEDED`. We recommend polling every **30 seconds**.

```bash
curl -X GET https://wayinvideo-api.wayin.ai/api/v2/clips/results/proj_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"
```

When complete, the response includes your clips:

```json
{
  "data": {
    "id": "proj_abc123",
    "name": "sample project name",
    "status": "SUCCEEDED",
    "clips": [
      {
        "idx": 0,
        "title": "sample title",
        "begin_ms": "15000",
        "end_ms": "75000",
        "thumbnail": "https://cdn.example.com/thumb/clip_001.jpg",
        "tags": ["insight", "understanding"],
        "desc": "sample description"
      }
    ]
  }
}
```

> **Note:** When submitting a Clipping task, you can set `enable_export = true` so that the service renders and exports the video and returns export links. Because rendering and export require additional processing time, completion will take longer than when export is disabled.

## 4. Export and Publish Clips

After clips are generated, you can render them as video files or publish them directly to connected social media accounts:

- [Clips Export API](https://wayin.ai/api-docs/clips-export/) — Render or re-export clips with custom resolution, captions, AI Reframe, AI Hook, and other export settings.
- [Social Media Publishing API](https://wayin.ai/api-docs/social-media-publishing/) — Connect social media accounts and publish clips generated by AI Clipping or Find Moments.

## Next Steps

- [AI Clipping](https://wayin.ai/api-docs/ai-clipping/) — Get viral clips from long videos
- [Find Moments](https://wayin.ai/api-docs/find-moments/) — Find moments in videos using natural-language queries
- [Video Summarization](https://wayin.ai/api-docs/video-summarization/) — Get overviews and timeline highlights from videos
- [Video Notes](https://wayin.ai/api-docs/video-notes/) — Generate structured AI notes in Markdown and plain-text formats
- [Video Transcription](https://wayin.ai/api-docs/video-transcription/) — Extract word-level transcripts with speaker diarization
- [AI for Stream Videos](https://wayin.ai/solutions/stream) — Explore Live Stream Understanding and Clipping for real-time stream video workflows.
