Skip to content

Support useChat Without an API Route (Client-side usage) #5140

Closed
@The-Best-Codes

Description

@The-Best-Codes

Feature Description

Right now, the Vercel AI SDK's useChat hook is good for managing chat state, but it requires an API route (e.g., app/api/chat/route.ts). So even in simple projects or static sites, a backend is necessary just to proxy requests.
I would like to be able to use the useChat hook right on the client with a user-provided API key, with no need for an API route.

Use Cases

I can think of a lot of use cases:

  • Static site generators (Next.js static export, Astro, etc.)
  • No-API web-to-desktop tools, e.g., Tauri
  • Browser extensions
  • Vite projects

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions