Studio
创作工具与生成流程。
Base URL https://api.sniphunter.com
请求与响应中的 $ref 在 OpenAPI 的 components 中定义。
7 个接口
Studio
GET/api/v1/studio/jobs/{job_id}Get Job
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "job_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "Job Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StudioJobResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}GET/api/v1/studio/projectsList Projects
列出当前用户的 Studio 项目
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 50,
"title": "Limit"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response List Projects Api V1 Studio Projects Get"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}POST/api/v1/studio/projects/quick-renderQuick Render
{
"security": [
{
"HTTPBearer": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StudioQuickRenderRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuickRenderResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}GET/api/v1/studio/projects/{project_id}Get Project
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "project_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "Project Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StudioProjectResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}POST/api/v1/studio/projects/{project_id}/runRun Project
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "project_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "Project Id"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StudioRunRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuickRenderResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}PUT/api/v1/studio/projects/{project_id}/shots/{shot_id}Patch Shot
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "project_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "Project Id"
}
},
{
"name": "shot_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Shot Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ShotPatch"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Patch Shot Api V1 Studio Projects Project Id Shots Shot Id Put"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}POST/api/v1/studio/projects/{project_id}/visual-assetsUpsert Visual Asset
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "project_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "Project Id"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VisualAssetUpsert"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Upsert Visual Asset Api V1 Studio Projects Project Id Visual Assets Post"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}数据模型
展开 components
{
"schemas": {
"Brief": {
"properties": {
"topic": {
"type": "string",
"title": "Topic",
"default": ""
},
"audience": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Audience"
},
"platform": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Platform",
"default": "generic"
},
"duration_sec_target": {
"type": "integer",
"title": "Duration Sec Target",
"default": 45
},
"tone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tone"
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
},
"source_type": {
"type": "string",
"title": "Source Type",
"default": "script"
},
"source_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Url"
},
"raw_input": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Raw Input"
},
"style_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Style Hint"
}
},
"type": "object",
"title": "Brief"
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"PostSettings": {
"properties": {
"subtitle_enabled": {
"type": "boolean",
"title": "Subtitle Enabled",
"default": true
},
"subtitle_style_id": {
"type": "string",
"title": "Subtitle Style Id",
"default": "default"
},
"burn_in": {
"type": "boolean",
"title": "Burn In",
"default": true
},
"bgm_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Bgm Url"
},
"bgm_volume": {
"type": "number",
"title": "Bgm Volume",
"default": 0.12
},
"width": {
"type": "integer",
"title": "Width",
"default": 1080
},
"height": {
"type": "integer",
"title": "Height",
"default": 1920
},
"fps": {
"type": "integer",
"title": "Fps",
"default": 30
}
},
"type": "object",
"title": "PostSettings"
},
"QuickRenderResponse": {
"properties": {
"project_id": {
"type": "integer",
"title": "Project Id"
},
"job_id": {
"type": "integer",
"title": "Job Id"
},
"status": {
"type": "string",
"title": "Status",
"default": "pending"
},
"estimated_credits": {
"type": "integer",
"title": "Estimated Credits",
"default": 15
},
"kind": {
"type": "string",
"title": "Kind",
"default": "workflow"
},
"message": {
"type": "string",
"title": "Message",
"default": "Studio 成片任务已提交"
},
"ui_hints": {
"additionalProperties": true,
"type": "object",
"title": "Ui Hints"
}
},
"type": "object",
"required": [
"project_id",
"job_id"
],
"title": "QuickRenderResponse"
},
"RenderMode": {
"type": "string",
"enum": [
"still",
"kenburns",
"i2v",
"clip"
],
"title": "RenderMode"
},
"RenderPolicy": {
"type": "string",
"enum": [
"kenburns",
"hybrid",
"i2v"
],
"title": "RenderPolicy"
},
"ScriptDoc": {
"properties": {
"full_voiceover_text": {
"type": "string",
"title": "Full Voiceover Text",
"default": ""
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title"
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
}
},
"type": "object",
"title": "ScriptDoc"
},
"Shot": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"order": {
"type": "integer",
"title": "Order",
"default": 0
},
"script_text": {
"type": "string",
"title": "Script Text",
"default": ""
},
"visual_prompt": {
"type": "string",
"title": "Visual Prompt",
"default": ""
},
"visual_asset_ids": {
"items": {
"type": "string"
},
"type": "array",
"title": "Visual Asset Ids"
},
"render_mode": {
"$ref": "#/components/schemas/RenderMode",
"default": "kenburns"
},
"still_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Still Url"
},
"motion_prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Motion Prompt"
},
"clip_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Clip Url"
},
"camera": {
"type": "string",
"title": "Camera",
"default": "push_in"
},
"transition": {
"type": "string",
"title": "Transition",
"default": "fade"
},
"start_ms": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Start Ms"
},
"end_ms": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "End Ms"
},
"status": {
"type": "string",
"title": "Status",
"default": "pending"
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"id"
],
"title": "Shot"
},
"ShotPatch": {
"properties": {
"script_text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Script Text"
},
"visual_prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Visual Prompt"
},
"render_mode": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Render Mode"
},
"visual_asset_ids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Visual Asset Ids"
},
"still_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Still Url"
}
},
"type": "object",
"title": "ShotPatch"
},
"StudioJobResponse": {
"properties": {
"job_id": {
"type": "integer",
"title": "Job Id"
},
"project_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Project Id"
},
"status": {
"type": "string",
"title": "Status"
},
"progress": {
"type": "number",
"title": "Progress",
"default": 0
},
"current_node": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Current Node"
},
"current_step": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Current Step"
},
"output_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Url"
},
"payload": {
"anyOf": [
{
"$ref": "#/components/schemas/StudioProjectPayload-Output"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
},
"kind": {
"type": "string",
"title": "Kind",
"default": "workflow"
},
"ui_hints": {
"additionalProperties": true,
"type": "object",
"title": "Ui Hints"
},
"still_urls": {
"items": {
"type": "string"
},
"type": "array",
"title": "Still Urls"
}
},
"type": "object",
"required": [
"job_id",
"status"
],
"title": "StudioJobResponse"
},
"StudioProjectPayload-Output": {
"properties": {
"schema_version": {
"type": "integer",
"title": "Schema Version",
"default": 1
},
"title": {
"type": "string",
"title": "Title",
"default": "未命名成片"
},
"stage": {
"$ref": "#/components/schemas/StudioStage",
"default": "brief"
},
"status": {
"type": "string",
"title": "Status",
"default": "draft"
},
"render_policy": {
"$ref": "#/components/schemas/RenderPolicy",
"default": "kenburns"
},
"aspect_ratio": {
"type": "string",
"title": "Aspect Ratio",
"default": "9:16"
},
"brief": {
"$ref": "#/components/schemas/Brief"
},
"script": {
"$ref": "#/components/schemas/ScriptDoc"
},
"visual_assets": {
"items": {
"$ref": "#/components/schemas/VisualAsset"
},
"type": "array",
"title": "Visual Assets"
},
"shots": {
"items": {
"$ref": "#/components/schemas/Shot"
},
"type": "array",
"title": "Shots"
},
"voice": {
"$ref": "#/components/schemas/VoiceTrack"
},
"post": {
"$ref": "#/components/schemas/PostSettings"
},
"subtitle_cues": {
"items": {
"$ref": "#/components/schemas/SubtitleCue"
},
"type": "array",
"title": "Subtitle Cues"
},
"timeline": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Timeline"
},
"output_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Url"
},
"cover_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Cover Url"
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
},
"extracted": {
"additionalProperties": true,
"type": "object",
"title": "Extracted"
}
},
"type": "object",
"title": "StudioProjectPayload"
},
"StudioProjectResponse": {
"properties": {
"project_id": {
"type": "integer",
"title": "Project Id"
},
"title": {
"type": "string",
"title": "Title"
},
"status": {
"type": "string",
"title": "Status"
},
"stage": {
"type": "string",
"title": "Stage"
},
"payload": {
"$ref": "#/components/schemas/StudioProjectPayload-Output"
},
"estimated_credits": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Estimated Credits"
}
},
"type": "object",
"required": [
"project_id",
"title",
"status",
"stage",
"payload"
],
"title": "StudioProjectResponse"
},
"StudioQuickRenderRequest": {
"properties": {
"script": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Script"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Url"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title"
},
"render_policy": {
"$ref": "#/components/schemas/RenderPolicy",
"default": "kenburns"
},
"voice_mode": {
"$ref": "#/components/schemas/VoiceMode",
"default": "tts"
},
"style_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Style Hint"
},
"aspect_ratio": {
"type": "string",
"title": "Aspect Ratio",
"default": "9:16"
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
},
"project_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Project Id"
}
},
"type": "object",
"title": "StudioQuickRenderRequest"
},
"StudioRunRequest": {
"properties": {
"from_stage": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "From Stage"
},
"to_stage": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "To Stage"
},
"shot_ids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Shot Ids"
}
},
"type": "object",
"title": "StudioRunRequest"
},
"StudioStage": {
"type": "string",
"enum": [
"brief",
"script",
"assets",
"board",
"post",
"done",
"failed"
],
"title": "StudioStage"
},
"SubtitleCue": {
"properties": {
"start_ms": {
"type": "integer",
"title": "Start Ms",
"default": 0
},
"end_ms": {
"type": "integer",
"title": "End Ms",
"default": 0
},
"text": {
"type": "string",
"title": "Text",
"default": ""
}
},
"type": "object",
"title": "SubtitleCue"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"VisualAsset": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"type": {
"$ref": "#/components/schemas/VisualAssetType",
"default": "character"
},
"name": {
"type": "string",
"title": "Name",
"default": ""
},
"visual_prompt": {
"type": "string",
"title": "Visual Prompt",
"default": ""
},
"ref_image_urls": {
"items": {
"type": "string"
},
"type": "array",
"title": "Ref Image Urls"
},
"voice_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Voice Id"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
},
"extra": {
"additionalProperties": true,
"type": "object",
"title": "Extra"
}
},
"type": "object",
"required": [
"id"
],
"title": "VisualAsset"
},
"VisualAssetType": {
"type": "string",
"enum": [
"character",
"location",
"product",
"prop",
"style"
],
"title": "VisualAssetType"
},
"VisualAssetUpsert": {
"properties": {
"asset": {
"$ref": "#/components/schemas/VisualAsset"
}
},
"type": "object",
"required": [
"asset"
],
"title": "VisualAssetUpsert"
},
"VoiceMode": {
"type": "string",
"enum": [
"tts",
"original"
],
"title": "VoiceMode"
},
"VoiceTrack": {
"properties": {
"mode": {
"$ref": "#/components/schemas/VoiceMode",
"default": "tts"
},
"audio_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Audio Url"
},
"full_text": {
"type": "string",
"title": "Full Text",
"default": ""
},
"tts_voice_id": {
"type": "string",
"title": "Tts Voice Id",
"default": "zh-CN-XiaoxiaoNeural"
},
"language": {
"type": "string",
"title": "Language",
"default": "zh"
}
},
"type": "object",
"title": "VoiceTrack"
}
},
"securitySchemes": {
"HTTPBearer": {
"type": "http",
"scheme": "bearer"
}
}
}