Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Methods:
  • client.CreateVideo(...)
  • client.ListVideos(...)
  • client.GetVideo(...)
  • client.RetrieveVideoContent(...)
  • client.GetVideoDownloadURL(...)
  • client.CancelVideo(...)
  • client.DeleteVideo(...)
  • client.ListVideoModels(...)
  • client.GetAsyncJobWebSocketURL(...)
  • client.GetVideoWebSocketURL(...)
  • client.AsyncJobs.WebSocketURL(...)
import (
  "context"
  "fmt"
  aistats "github.com/AI-Stats/AI-Stats/packages/sdk/sdk-go"
)

client := aistats.New(apiKey, "https://api.phaseo.app/v1")

job, err := client.CreateVideo(context.Background(), map[string]interface{}{
  "model": "openai/sora-2",
  "prompt": "A cinematic sunrise over a mountain lake",
})
if err != nil {
  panic(err)
}

fmt.Println(job)

jobs, err := client.ListVideos(context.Background(), map[string]string{
  "status": "queued,completed",
  "limit": "2",
})
if err != nil {
  panic(err)
}

websocketURL, err := client.GetVideoWebSocketURL(
  fmt.Sprint(job["id"]),
  &aistats.AsyncJobWebSocketOptions{IntervalMS: 1500},
)
if err != nil {
  panic(err)
}

fmt.Println(jobs)
fmt.Println(websocketURL)
The create response is an async job record. Poll status before attempting content or signed download retrieval. Use client.GetVideoWebSocketURL(...) when you want to subscribe to the documented /v1/async/video/{id}/ws lifecycle stream instead of polling only. Use client.AsyncJobs.WebSocketURL("video", videoID, options) when you want the generic async-jobs resource helper. Use client.GetAsyncJobWebSocketURL("video", videoID, options) when you want the same generic helper without going through the resource object. CancelVideo(...) is exposed, but the public video cancel route currently returns a structured 501 not_implemented_yet error while provider-level cancellation is standardized.
Last modified on May 6, 2026