Skip to content
Back to skills

2240 Basic Text To Video C0899802

ASecurity

```python import os import requests import time

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentpythongoapi

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2240-basic-text-to-video_c0899802 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2240 Basic Text To Video C0899802?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2240 Basic Text To Video C0899802
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2240-basic-text-to-video-c0899802/badge)](https://www.skillsdirectory.com/skills/tools-only-2240-basic-text-to-video-c0899802)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Basic Text-To-Video

## Basic Text-to-Video

```python
import os
import requests
import time

def text_to_video(
    prompt: str,
    duration: int = 5,
    aspect_ratio: str = "16:9",
    model: str = "kling-v1.5"
) -> dict:
    """Generate video from text prompt."""

    headers = {
        "Authorization": f"Bearer {os.environ['KLINGAI_API_KEY']}",
        "Content-Type": "application/json"
    }

    # Submit generation request
    response = requests.post(
        "https://api.klingai.com/v1/videos/text2video",
        headers=headers,
        json={
            "model": model,
            "prompt": prompt,
            "duration": duration,
            "aspect_ratio": aspect_ratio
        }
    )
    response.raise_for_status()
    job_id = response.json()["job_id"]

    # Wait for completion
    while True:
        status_response = requests.get(
            f"https://api.klingai.com/v1/videos/{job_id}",
            headers=headers
        )
        result = status_response.json()

        if result["status"] == "completed":
            return result
        elif result["status"] == "failed":
            raise Exception(f"Generation failed: {result.get('error')}")

        time.sleep(5)

# Usage
result = text_to_video(
    prompt="A majestic eagle soaring over snow-capped mountains at golden hour",
    duration=10,
    aspect_ratio="16:9"
)
print(f"Video URL: {result['video_url']}")
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.