API Reference

OpenClip exposes a REST API for programmatic access. All endpoints require authentication via API key.

Base URL

http://localhost:8000/api/v1

Authentication

Include your API key in the request header:

Authorization: Bearer OPENCLIP_API_KEY

Endpoints

POST /videos

Create a new video from text prompt.

POST /api/v1/videos
Authorization: Bearer OPENCLIP_API_KEY
Content-Type: application/json

{
  "prompt": "Buat video tentang 5 tips Python untuk pemula",
  "platform": "youtube",
  "duration": 30,
  "style": "educational"
}

GET /videos/{id}

Get video status and metadata.

GET /api/v1/videos/abc123
Authorization: Bearer OPENCLIP_API_KEY

GET /videos

List all videos for the authenticated user.

GET /api/v1/videos?limit=20&offset=0
Authorization: Bearer OPENCLIP_API_KEY

POST /videos/{id}/publish

Publish video to connected platform.

POST /api/v1/videos/abc123/publish
Authorization: Bearer OPENCLIP_API_KEY
Content-Type: application/json

{
  "platform": "youtube",
  "title": "5 Tips Python untuk Pemula",
  "description": "Belajar Python dari nol..."
}

DELETE /videos/{id}

Delete a video.

DELETE /api/v1/videos/abc123
Authorization: Bearer OPENCLIP_API_KEY

Response Format

All responses return JSON.

{
  "success": true,
  "data": { ... },
  "message": "Video created successfully"
}

Error Codes

  • 400 — Bad request (missing fields, invalid data)
  • 401 — Unauthorized (invalid API key)
  • 404 — Not found (video or resource does not exist)
  • 429 — Rate limit exceeded
  • 500 — Server error