Build me a chat app and allow me to put in API key, Deepseek fetch("https://openrouter.ai/api/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <OPENROUTER_API_KEY>", "HTTP-Referer": "<YOUR_SITE_URL>", // Optional. Site URL for rankings on openrouter.ai. "X-Title": "<YOUR_SITE_NAME>", // Optional. Site title for rankings on openrouter.ai. "Content-Type": "application/json" }, body: JSON.stringify({ "model": "deepseek/deepseek-r1-0528:free", "messages": [ { "role": "user", "content": "What is the meaning of life?" } ] }) });
I'll build you a chat app that integrates with OpenRouter.ai using the DeepSeek model. This will include an API key input field and use the exact endpoint you specified.
I've created a complete chat application that integrates with OpenRouter.ai using the DeepSeek model. Here's what the app includes:
The app uses the exact OpenRouter.ai endpoint you specified with the deepseek/deepseek-r1-0528:free
model and includes proper headers for site attribution. The streaming implementation ensures you see responses as they're generated, providing a smooth chat experience.