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

# Quickstart

> Generate your first AI video in 3 minutes

## Get Started

<Steps>
  <Step title="Get your API Key">
    Sign up at [ModelHunter.AI Dashboard](https://modelhunter.ai/register) and create an API key from the **API Keys** page.
  </Step>

  <Step title="Set up your environment">
    Set your API key as an environment variable:

    ```bash theme={null}
    export MODELHUNTER_KEY="mh_live_xxx"
    ```
  </Step>

  <Step title="Generate a video">
    Submit a text-to-video request and poll for the result.

    <CodeGroup>
      ```javascript JavaScript theme={null}
      const API_KEY = process.env.MODELHUNTER_KEY;
      const BASE = 'https://api.modelhunter.ai/api/v1';

      // 1. Submit a generation request
      const response = await fetch(`${BASE}/vidu/text-to-video`, {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          model: 'viduq3-turbo',
          input: {
            prompt: 'A futuristic city at sunset, flying cars, neon lights',
            duration: 4,
            aspect_ratio: '16:9',
            resolution: '1080p',
          },
        }),
      });

      const task = await response.json();
      const taskId = task.data.id;
      console.log('Task ID:', taskId);

      // 2. Poll until complete
      let result;
      while (true) {
        await new Promise(r => setTimeout(r, 3000)); // wait 3s
        const poll = await fetch(`${BASE}/tasks/${taskId}`, {
          headers: { 'Authorization': `Bearer ${API_KEY}` },
        }).then(r => r.json());

        console.log('Status:', poll.data.status);
        if (poll.data.status === 'succeeded') {
          result = poll.data;
          break;
        }
        if (poll.data.status === 'failed') {
          throw new Error(poll.data.error?.message || 'Task failed');
        }
      }

      console.log('Video URL:', result.result[0].url);
      ```

      ```python Python theme={null}
      import requests, time

      API_KEY = 'mh_live_xxx'
      BASE = 'https://api.modelhunter.ai/api/v1'
      headers = {
          'Authorization': f'Bearer {API_KEY}',
          'Content-Type': 'application/json',
      }

      # 1. Submit a generation request
      response = requests.post(
          f'{BASE}/vidu/text-to-video',
          headers=headers,
          json={
              'model': 'viduq3-turbo',
              'input': {
                  'prompt': 'A futuristic city at sunset, flying cars, neon lights',
                  'duration': 4,
                  'aspect_ratio': '16:9',
                  'resolution': '1080p',
              },
          },
      )

      task = response.json()
      task_id = task['data']['id']
      print('Task ID:', task_id)

      # 2. Poll until complete
      while True:
          time.sleep(3)
          poll = requests.get(
              f'{BASE}/tasks/{task_id}',
              headers=headers,
          ).json()

          status = poll['data']['status']
          print('Status:', status)
          if status == 'succeeded':
              print('Video URL:', poll['data']['result'][0]['url'])
              break
          if status == 'failed':
              raise Exception(poll['data'].get('error', {}).get('message', 'Task failed'))
      ```

      ```bash cURL theme={null}
      # 1. Submit a generation request
      curl -X POST https://api.modelhunter.ai/api/v1/vidu/text-to-video \
        -H "Authorization: Bearer mh_live_xxx" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "viduq3-turbo",
          "input": {
            "prompt": "A futuristic city at sunset, flying cars, neon lights",
            "duration": 4,
            "aspect_ratio": "16:9",
            "resolution": "1080p"
          }
        }'
      # Returns: { "data": { "id": "task_abc123", ... } }

      # 2. Poll until complete (replace task_abc123 with your task ID)
      curl https://api.modelhunter.ai/api/v1/tasks/task_abc123 \
        -H "Authorization: Bearer mh_live_xxx"
      # Repeat every few seconds until status is "succeeded" or "failed"
      ```
    </CodeGroup>
  </Step>
</Steps>

## What's Next?

<CardGroup cols={2}>
  <Card title="Async Tasks" icon="clock" href="/core-concepts/async-tasks">
    Understand the task lifecycle and polling patterns
  </Card>

  <Card title="Webhooks" icon="bell" href="/core-concepts/webhooks">
    Get notified when tasks complete instead of polling
  </Card>

  <Card title="Video Models" icon="video" href="/api-reference/veo/text-to-video">
    Explore all video generation models
  </Card>

  <Card title="Image Models" icon="image" href="/api-reference/seedream/text-to-image">
    Generate images with Seedream
  </Card>
</CardGroup>
