Generate App Then Explain Code
A 3-step recipe with Vercel. We can help you get access.
Recipe · 3 steps
Generate App Then Explain Code
with Vercel
Generate a v0 app, capture its files, then explain the code with the AI Gateway.
- Start a new v0 chat session to generate the application.
- Read the chat back to capture the generated code files.
- Ask an AI Gateway chat model to explain the first generated code file.
What you'll need to have ready
- v0ApiKey: v0 API key (V0_API_KEY) used as a Bearer token for the v0 Platform API.
- gatewayApiKey: AI Gateway API key (AI_GATEWAY_API_KEY) used as a Bearer token for the gateway.
- message: Natural language prompt describing the app to generate.
- chatModel: AI Gateway chat model id in 'provider/model-name' form.
For your developer
Arazzo workflow vercel:generateAppThenExplainCode, 3 operations: createChat → getChat → createChatCompletion. Specs on APIs.io.