Skip to content

feat(openai): add transcription, image generation, and fix video sizes#40

Draft
caffeinum wants to merge 1 commit intomainfrom
fix/openai
Draft

feat(openai): add transcription, image generation, and fix video sizes#40
caffeinum wants to merge 1 commit intomainfrom
fix/openai

Conversation

@caffeinum
Copy link
Copy Markdown
Contributor

Summary

  • Add OpenAI Whisper transcription support (whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe)
  • Add OpenAI image generation (gpt-image-1, gpt-image-1-mini, gpt-image-1.5, dall-e-2, dall-e-3)
  • Fix Sora video size mappings - add 1024x1792, 1792x1024 for 9:21/21:9 aspect ratios
  • Add example files for new features

New Features

Transcription

import { experimental_transcribe as transcribe } from "ai";
import { openai } from "vargai/ai";

const result = await transcribe({
  model: openai.transcriptionModel("whisper-1"),
  audio: audioBuffer,
});

Image Generation

import { generateImage } from "ai";
import { openai } from "vargai/ai";

const { images } = await generateImage({
  model: openai.imageModel("gpt-image-1"),
  prompt: "a futuristic city at sunset",
});

// or with dall-e-3
const { images } = await generateImage({
  model: openai.imageModel("dall-e-3"),
  prompt: "a whimsical treehouse",
  providerOptions: {
    openai: { quality: "hd", style: "vivid" },
  },
});

Video (existing, with fixed sizes)

import { generateVideo, openai } from "vargai/ai";

const { video } = await generateVideo({
  model: openai.videoModel("sora-2"),
  prompt: "a cat walking on a beach",
  aspectRatio: "21:9", // now supported
});

Testing

  • TypeScript compiles without errors
  • LSP diagnostics clean

- add OpenAI Whisper transcription support (whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe)
- add OpenAI image generation (gpt-image-1, gpt-image-1-mini, gpt-image-1.5, dall-e-2, dall-e-3)
- fix Sora video size mappings - add 1024x1792, 1792x1024 for 9:21/21:9 aspect ratios
- add example files for new features
@caffeinum caffeinum marked this pull request as draft January 22, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant