lukasa1993/tanstack-skills-extracted/tanstack-ai-core-media-generation
Claude Code and agent skill by lukasa1993/tanstack-skills-extracted
- community
Checking that the SKILL.md file is still in the repository.
Image, audio, video, speech (TTS), and transcription generation using activity-specific adapters: generateImage() with openaiImage/geminiImage/byteplusImage, generateAudio() with geminiAudio/falAudio, generateVideo() with async polling (openaiVideo/geminiVideo/grokVideo/falVideo/byteplusVideo/openRouterVideo, per-model typed durations), generateSpeech() with openaiSpeech/byteplusSpeech/elevenlabsSpeech, generateTranscription() with openaiTranscription/byteplusTranscription, generateVoice() with…
Install
npx vskill@latest install lukasa1993/tanstack-skills-extracted/tanstack-ai-core-media-generationSKILL.md
Media Generation
Dependency note: This skill builds on ai-core. Read it first for critical rules.
All media activities (image, speech, transcription, video) follow the same server/client architecture: a generate*() function on the server, an SSE transport via toServerSentEventsResponse(), and a framework hook on the client.
Setup -- Image Generation End-to-End
Server (API route or TanStack Start server function)
Client (React)
TanStack Start: Server Function Streaming (recommended)
When using TanStack Start, return toServerSentEventsResponse() from a server function. The client fetcher receives a Response and the hook parses it as SSE automatically:
Core Patterns
1. Image Generation
Supported adapters: openaiImage (gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1, gpt-image-1-mini), geminiImage (gemini-nano-banana-2.1, gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-3-pro-image) and byteplusImage (Seedream — seedream-4-0-250828, seedream-4-5-251128, the 5.0 family).
Use the GA Gemini image ids. Usegemini-3.1-flash-image,gemini-3-pro-image, orgemini-3.1-flash-lite-image. The-previewidsandgemini-2.5-flash-imageare shut down and not in the type union.
Seedream quirks:watermarkdefaults to `true` (passmodelOptions: { watermark: false }for a clean image),sizeis a token('1K'|'2K'|'4K') or explicit'2048x2048'pixels but never amix, andnumberOfImagesis an upper bound — Seedream has non, so itmaps onto group-image mode and the model may return fewer. ReadsARK_API_KEY.
Gemini image models (gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-nano-banana-2.1, gemini-3-pro-image) use the Interactions API. result.id is the interaction id. Omit modelOptions.store to keep the API default (true). store: false cannot be chained. Gemini keeps a stored interaction for 1 day on the free tier and 55 days on a paid tier. Set thinkingConfig.thinkingLevel to 'minimal', 'low', 'medium', or 'high'. thinkingConfig.thinkingBudget throws.
Result shape: ImageGenerationResult with images array where each entry has b64Json?, url?, and revisedPrompt?. OpenAI gpt-image models return b64Json. Seedream image URLs expire after 24 hours, so download or display them immediately.
Image-conditioned generation: multimodal prompt parts
Both generateImage() and generateVideo() accept the prompt either as a plain string or as an ordered array of content parts (TextPart / ImagePart / VideoPart / AudioPart — the same shapes used elsewhere in TanStack AI). Part order is meaningful: natively multimodal providers (Gemini, OpenRouter) receive parts in order; named-field providers (OpenAI, fal, xAI) extract media parts and flatten the text. Prompt text is always sent verbatim — to reference inputs from the prompt, write the provider's own syntax (fal @Image1, OpenAI "image 1" prose); the SDK never injects or rewrites markers. Each media part may carry an optional metadata.role hint that adapters use to route the part to the provider-specific field. The accepted part types are narrowed per model at compile time via the adapter's input-modality map.
Reference images / start frames that are reused (or arrive as inline base64 on memory-constrained runtimes) can instead be uploaded once via the provider's Files adapter and referenced with source: fileSourceFromHandle(handle) — supported for Gemini image generation (geminiFiles()) and fal image/video inputs (falFiles()). Endpoints that require raw bytes (OpenAI images/edits, Sora input_reference, Gemini Veo) reject file sources with a clear error. See ../tanstack-ai-core-adapter-configuration/SKILL.md §7.
URL inputs that require an upload throw by default. Most adapters pass a type: 'url' source straight through to the provider. Three paths can't — OpenAI images.edit(), OpenAI Sora input_reference, and Gemini Veo — because the provider only accepts uploaded bytes (Veo also takes a gs:// reference). For those, an HTTP(S) URL would have to be downloaded and buffered in memory, which can OOM constrained runtimes, so they throw on an HTTP(S) URL image input by default. Pass a data: URI (or gs:// for Veo), or opt in with allowUrlFetch: true on the adapter config (createOpenaiImage(model, apiKey, { allowUrlFetch: true }), and likewise on createOpenaiVideo / createGeminiVideo). data: URIs never need the flag.
Role hints (metadata.role):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tanstack-ai-core-media-generation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lukasa1993/tanstack-skills-extracted/tanstack-ai-core-media-generation)