← 返回
内容创作 Key 中文

Storyclaw X2c Publish

X2C Distribution and Wallet API — publish video to X2C platform, manage assets (balance, claim X2C, swap to USDC, withdraw, transactions).
X2C分发与钱包API——发布视频至X2C平台,管理资产(余额、领取X2C、兑换USDC、提现、交易)。
patches429
内容创作 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 533
下载
💾 3
安装
1
版本
#latest

概述

X2C Publish - Distribution & Wallet API

Publish video content to the X2C platform and manage digital assets.

Critical Rules

  • Complete ALL workflow steps in order — never skip steps
  • Always add timeout to curl commands: -m 60
  • NEVER retry failed requests — report error and ask user
  • Check project status before publishing to avoid duplicates
  • Cover URL must be an image (jpg/png/webp), never a video URL

Multi-User Support

Store API key in credentials/{USER_ID}.json:

{
  "x2cApiKey": "x2c_sk_xxx"
}

Set USER_ID env var when calling. OpenClaw passes it automatically from chat context.

Or set X2C_API_KEY env var, or configure via skills."x2c-publish".env.X2C_API_KEY in ~/.openclaw/openclaw.json.

Distribution Workflow

1. distribution/categories → Get categories
2. distribution/upload-url → Get S3 presigned upload URLs
3. Upload files to S3 via HTTP PUT
4. distribution/publish → Submit with public_url from Step 3
5. distribution/query → Check review status
6. distribution/add-episodes → Add more episodes
7. distribution/list → List all projects

Two ways to provide videos:

  1. S3 Upload — use upload-url workflow for local files
  2. External URL — use existing video URLs directly in publish

API Endpoint

All requests go to the X2C Open API. The base URL is configured via X2C_API_BASE_URL env var or defaults to the production endpoint.

Headers:

  • Content-Type: application/json
  • X-API-Key:

Get Categories

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "distribution/categories", "lang": "zh-CN"}'

Get Upload URLs

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{
    "action": "distribution/upload-url",
    "files": [
      {"file_type": "cover", "file_name": "cover.jpg", "content_type": "image/jpeg"},
      {"file_type": "video", "file_name": "ep1.mp4", "content_type": "video/mp4"}
    ]
  }'

Response includes upload_url, upload_headers, and public_url.

Upload to S3

Use the upload_url and upload_headers from the previous response:

curl -X PUT "<upload_url>" \
  -H "Content-Type: image/jpeg" \
  <additional headers from upload_headers> \
  --data-binary @cover.jpg

Publish Project

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{
    "action": "distribution/publish",
    "title": "My Drama",
    "description": "A story about...",
    "category_id": "uuid",
    "cover_url": "https://...",
    "video_urls": ["https://..."],
    "enable_prediction": false
  }'
ParamRequiredDescription
-----------------------------------------------------
titleYesProject name (max 100 chars)
descriptionYesSynopsis (max 2000 chars)
category_idYesCategory UUID
cover_urlYesCover image URL
video_urlsYesArray of video URLs (1-10)
enable_predictionNoEnable prediction market

Query Status

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "distribution/query", "project_id": "uuid"}'

Status values: draft, pending_review, approved, rejected

Add Episodes

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{
    "action": "distribution/add-episodes",
    "project_id": "uuid",
    "video_urls": ["https://..."]
  }'

List Projects

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "distribution/list", "page": 1, "page_size": 20, "status": "approved"}'

Wallet API (Asset Management)

Get Balance

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "wallet/balance"}'

Returns: credits, x2c_wallet_balance, x2c_pending_claim, x2c_pending_release, usdc_balance, wallet_address.

Claim X2C

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "wallet/claim-x2c", "amount": 50.0}'

Swap X2C to USDC

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "wallet/swap-x2c", "amount": 100.0}'

Withdraw USDC

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "wallet/withdraw-usdc", "amount": 10.0, "to_address": "SolanaAddress..."}'

Transaction History

curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "wallet/transactions", "page": 1, "page_size": 20, "type": "all"}'

Types: earnings (mining, distribution, referral, etc.), purchases (consume, swap, withdrawal, etc.), or all.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-30 06:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,481
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,772
data-analysis

Market Monitor

patches429
通过交易所 API(如 Binance、OKX)监控加密货币及金融市场,追踪价格、分析趋势并生成市场报告。
★ 0 📥 1,289