feat: add Sora async task API (videos/images)

Add async task management for Sora video/image generation with two
forwarding modes: OAuth (SDK) and API Key (HTTP upstream). Includes
background worker for status polling and 3-layer storage degradation
(S3 > local disk > upstream URL passthrough).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erioandClaude Opus 4.6 committed 2026-03-07 19:19:11 +08:00
1 parent 4fb58c66c4
commit 8c412b32d1
11 files changed
+1348 -2

No files matched your search

+10
View File
@@ -143,6 +143,16 @@ func RegisterGatewayRoutes(
{
soraV1.POST("/chat/completions", h.SoraGateway.ChatCompletions)
soraV1.GET("/models", h.Gateway.Models)
// Sora Videos/Images async task API
if h.SoraVideos != nil {
soraV1.POST("/videos", h.SoraVideos.CreateVideo)
soraV1.GET("/videos/:id", h.SoraVideos.GetVideo)
soraV1.POST("/videos/:id/remix", h.SoraVideos.RemixVideo)
soraV1.GET("/videos/:id/content", h.SoraVideos.GetVideoContent)
soraV1.POST("/images/generations", h.SoraVideos.CreateImage)
soraV1.POST("/images/edits", h.SoraVideos.EditImage)
}
}
// Sora 媒体代理(可选 API Key 验证)