Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST: /api/chat doesn't reply. #907

Open
luckiman opened this issue Apr 4, 2025 · 5 comments
Open

POST: /api/chat doesn't reply. #907

luckiman opened this issue Apr 4, 2025 · 5 comments

Comments

@luckiman
Copy link

luckiman commented Apr 4, 2025

Image
I forked project in local and set all environment variables. but it occurs error while sending message. What's wrong?

@generativelabs
Copy link

I ran into the same thing. The app/(chat)/api/chat/route.ts is eating the meaningful error, if you add:

  } catch (error) {
    console.error("[DEBUG] API error:", error);
    return new Response('An error occurred while processing your request!', {
      status: 404,
    });

you'll see what the problem is. For me, it was I didn't have XAI_API_KEY defined. The latest versions use xAI as you can see in providers.ts

@luckiman
Copy link
Author

luckiman commented Apr 5, 2025

I got a xAI api key and set it in local.env. how to validate that api key?

@generativelabs
Copy link

generativelabs commented Apr 5, 2025

how to validate that api key?

Set a breakpoint on that exception or add debug message shown above to validate / rule out an invalid key.

@cssagogo
Copy link

cssagogo commented Apr 5, 2025

Running into the same issue.

@luckiman
Copy link
Author

luckiman commented Apr 6, 2025

Image

I checked the point occuring issue. It caused at generateTitleFromUserMessage in /api/chat/route.ts.
how to solve the "server is not available"?
Can't I use free xAi free api key?

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

No branches or pull requests

3 participants