Built a Reddit AI Bot like Grok using Devvit — but external APIs are blocked?*
Hey everyone!
I've been working on a Reddit app using Devvit that acts like an AI assistant — similar to how Grok works on X/Twitter. The idea is simple: when someone opens the app on a post, they can chat with an AI and get helpful replies.
I built the full UI using React inside Devvit, and it looks great! The chat interface works perfectly. But the problem is when I try to connect it to an AI API (I tried xAI Grok and Anthropic Claude), the server throws this error:
> `HTTP request to domain: api.x.ai is not allowed`
> `HTTP request to domain: api.anthropic.com is not allowed`
It seems like Devvit blocks all external API calls from the server side. I spent a lot of time on this and couldn't find a workaround.
My questions:
- Is there any way to make external API calls from a Devvit app?
- Does Devvit have any built-in AI support?
- Is there a whitelist of allowed domains?
Would really appreciate any help from the community!