Skip to content

[bot] OpenAI Videos API (Sora video generation) not instrumented #182

@braintrust-bot

Description

@braintrust-bot

Summary

The OpenAI Ruby SDK exposes a stable videos resource for Sora video generation (client.videos.create, edit, extend_, remix). None of these generative execution methods are instrumented by the Braintrust Ruby SDK. This is the same class of gap as the already-filed Images API issue (#147), but for video generation.

What is missing

The official openai gem provides OpenAI::Resources::Videos with four generative execution methods:

  • client.videos.create(prompt:, model:, seconds:, size:, ...) — Initiates a video generation job from a text prompt. Uses Sora-2 or Sora-2-pro models. Returns OpenAI::Models::Video with a job ID and status.
  • client.videos.edit(video_id:, prompt:, ...) — Edits an existing video using a text prompt.
  • client.videos.extend_(video_id:, ...) — Extends a completed video with additional generated segments.
  • client.videos.remix(video_id:, prompt:, ...) — Remixes a completed video using a new prompt.

None of these are patched. The existing openai patcher (lib/braintrust/contrib/openai/patcher.rb) registers ChatPatcher, ResponsesPatcher, and ModerationsPatcher only.

What a span should capture

Video generation spans (client.videos.create) should capture:

  • Input: the text prompt
  • Metadata: model (sora-2, sora-2-pro), seconds (clip duration), size (resolution), provider (openai), endpoint (/v1/videos/generations)
  • Output: the returned Video object's id and status
  • Metrics: latency of the create call

Video editing spans (edit, remix) follow the same pattern with an additional video_id input.

Note: The Videos API is async/job-based — create returns immediately with a job ID; video generation completes asynchronously. Instrumentation of create captures the initiation; retrieve polls are CRUD and out of scope.

Braintrust docs status

not_found — The Braintrust OpenAI integration docs at https://www.braintrust.dev/docs/integrations/ai-providers/openai and https://www.braintrust.dev/docs/guides/tracing do not mention video generation or the Sora API. All documented examples cover chat completions and audio.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher; no VideosPatcher
  • lib/braintrust/contrib/openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb, common.rb; no videos.rb
  • Grep for video, sora, Videos across lib/braintrust/ returns zero matches
  • Issue [BOT ISSUE] OpenAI Images API not instrumented (openai + ruby-openai gems) #147 (OpenAI Images API not instrumented) demonstrates the equivalent existing gap for images — the same pattern applies here for video generation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions