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

# Quickstart

> Generate your first video in under 5 minutes

This walks through the shortest path from an API key to a rendered video: find a template, check what it needs, generate, poll for the result, download it.

<Steps>
  <Step title="Get an API key">
    Create a key from the dashboard's [API Keys page](https://app.truefan.ai/dashboard/api-keys). Copy the raw key immediately — it's shown once.

    ```bash theme={null}
    export TRUEFAN_API_KEY="tf_live_..."
    ```
  </Step>

  <Step title="List your templates">
    Find the `template_id` of a template you've already built in the editor.

    ```bash theme={null}
    curl "https://dev-backend-ai.truefans.in/api/external/v1/templates/" \
      -H "Authorization: Bearer $TRUEFAN_API_KEY"
    ```

    ```json Response (abridged) theme={null}
    {
      "templates": [
        {
          "template_id": "7a4facd6-136f-4d8a-8db6-0eb3b3e7086f",
          "name": "Customer shoutout",
          "aspect_ratio": "16:9",
          "estimated_credits": "0.68"
        }
      ],
      "pagination": { "page": 1, "page_size": 30, "total": 1, "total_pages": 1 }
    }
    ```
  </Step>

  <Step title="Check what the template needs">
    Every template has a different set of variables — this is computed live, so it's always accurate.

    ```bash theme={null}
    curl "https://dev-backend-ai.truefans.in/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/schema/" \
      -H "Authorization: Bearer $TRUEFAN_API_KEY"
    ```

    ```json Response theme={null}
    {
      "template_id": "7a4facd6-136f-4d8a-8db6-0eb3b3e7086f",
      "name": "Customer shoutout",
      "variables": [
        { "name": "customer_name", "example_value": "Anmol" },
        { "name": "score", "example_value": "95" }
      ],
      "bulk_generate": {
        "method": "POST",
        "path": "/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/bulk-generate/",
        "body": { "rows": [{ "customer_name": "Anmol", "score": "95" }], "batch_name": "string (optional)" }
      }
    }
    ```
  </Step>

  <Step title="Generate a video">
    Send one row in `rows` for a single video:

    ```bash theme={null}
    curl -X POST "https://dev-backend-ai.truefans.in/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/bulk-generate/" \
      -H "Authorization: Bearer $TRUEFAN_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"rows": [{"customer_name": "Anmol", "score": "95"}]}'
    ```

    ```json Response theme={null}
    {
      "bulk_job_id": "8c1f2e3a-...",
      "status": "pending",
      "row_count": 1,
      "estimated_credits": "0.68"
    }
    ```

    Generation happens asynchronously — this response confirms the job was accepted, not that the video is ready.
  </Step>

  <Step title="Poll for the result">
    ```bash theme={null}
    curl "https://dev-backend-ai.truefans.in/api/external/v1/bulk-jobs/8c1f2e3a-.../status/" \
      -H "Authorization: Bearer $TRUEFAN_API_KEY"
    ```

    ```json Response (once complete) theme={null}
    {
      "bulk_job_id": "8c1f2e3a-...",
      "status": "done",
      "summary": { "total": 1, "success": 1, "failed": 0, "pending": 0 },
      "csv_ready": true
    }
    ```

    Instead of polling, you can [configure a webhook](/docs/guides/webhooks) to be notified the moment the job completes.
  </Step>

  <Step title="Download the result">
    Once `csv_ready` is `true`, download the finished video's URL:

    ```bash theme={null}
    curl "https://dev-backend-ai.truefans.in/api/external/v1/bulk-jobs/8c1f2e3a-.../export.csv" \
      -H "Authorization: Bearer $TRUEFAN_API_KEY" \
      -O -J
    ```

    ```csv results.csv theme={null}
    external_id,generation_id,customer_name,score,result_video_url
    ,f339beb9-305d-4a01-89ef-669b7ec70de3,Anmol,95,https://assets-studio.truefans.in/editor/.../output.mp4
    ```
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Generate many at once" icon="layer-group" href="/docs/guides/bulk-generate-videos">
    Pass a longer list of `rows` to render many personalized videos in one call
  </Card>

  <Card title="Skip polling" icon="webhook" href="/docs/guides/webhooks">
    Get an HTTP callback the moment a video finishes
  </Card>
</CardGroup>
