# Trezalabs YouTube Clip Generator

> Trezalabs YouTube Clip Generator is a paid API for AI agents from www.trezalabs.com, paid per call via x402, $0.12/call, status unknown (last checked 2026-10-01).

Extracts and returns the most shareable 30–60 second captioned vertical clip from a YouTube video, cut on the speaker with aspect ratio options and a suggested title and caption.

## Facts

- Endpoint: POST https://www.trezalabs.com/api/x402/clip?utm_source=zero.xyz
- Price: $0.12/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/trezalabs-youtube-clip-generator-80fd35f6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cMBANdwicd8yGjS68daPI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability trezalabs-youtube-clip-generator-80fd35f6 -d '<json body>'
```

Example prompt: Can you clip this YouTube video for me — https://www.youtube.com/watch?v=dQw4w9WgXcQ — and pull out the best 30 to 60 second moment, captioned and formatted as a 9:16 vertical with a title and caption I can post with it?

## When to prefer this

Choose this endpoint when you need an automated, pay-per-use pipeline to extract and caption a viral-ready short clip from a YouTube video without requiring an account or API key. It is ideal for agents handling content repurposing workflows, podcast clipping, or social media publishing pipelines where the source material is a YouTube URL and the output needs to be immediately postable with captions and copy.

## Known failure modes

- Invalid or inaccessible YouTube URL returns an error
- Video longer than 2 hours is rejected as out of supported range
- Async mode returns 202 with a statusUrl; agent must poll for completion
- Payment failure or insufficient USDC balance prevents processing
- No clearly identifiable speaker or highlight moment may result in a lower-quality clip
- Private or age-restricted YouTube videos may fail to process

## How this service works

Clip a YouTube video: send a link, get its most shareable 30 to 60 second moment back as a captioned clip, cut on the speaker in 9:16 (or 4:5, 1:1, 16:9), with a title and caption to post it with. Priced by the source's length, from $0.04 (about $0.45 for an hour), up to 2 hours. No account or API key: the payment is the only credential.

## Output

A captioned video clip (30–60 seconds) featuring the most shareable moment from the source YouTube video, cut on the speaker in the requested aspect ratio (default 9:16), along with a suggested title and post caption ready for publishing on social platforms.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "A YouTube video link (watch page, Short, or youtu.be)."
      },
      "async": {
       "type": "boolean",
       "default": false,
       "description": "true: answer 202 with a statusUrl at once."
      },
      "aspectRatio": {
       "enum": [
        "9:16",
        "4:5",
        "1:1",
        "16:9"
       ],
       "type": "string",
       "default": "9:16"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
  "video": "https://www.trezalabs.com/api/media/generated/x402_captions/1a2b3c4d.mp4?s=...&c=...",
  "status": "success",
  "outputs": {
   "moment": "{\"start\":\"00:12:03,120\",\"end\":\"00:12:51,400\",\"publish\":\"...\"}"
  },
  "paidUsd": 0.12,
  "statusUrl": "https://www.trezalabs.com/api/x402/clip?runId=...&token=...",
  "aspectRatio": "9:16",
  "transaction": "0x...",
  "sourceMinutes": 12
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/trezalabs-youtube-clip-generator-80fd35f6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.trezalabs.com](https://www.zero.xyz/host/www.trezalabs.com/llms.txt)
