Random cat GIF API for Discord. Every request returns a fresh, random cat GIF with no-cache headers so your Discord webhook always gets a different cat.
https://catapi.vercel.app/
https://catapi.vercel.app/catapi
https://catapi.vercel.app/api/catapi
Returns a image/gif response — drop the URL directly into a Discord webhook or an <img> tag.
Unlike the link above (which Discord can cache as a stale embed), a slash
command uploads a fresh file attachment every time — nothing for Discord to
cache, so /cat always gives a new gif.
- Deploy this project to Vercel first (so you have a live URL).
- Go to the Discord Developer Portal → create (or open) an application.
- On the General Information page, copy the Application ID and Public Key.
- Set these as environment variables on your Vercel project:
DISCORD_PUBLIC_KEY— from step 3DISCORD_APPLICATION_ID— from step 3
- Set the Interactions Endpoint URL (also on General Information) to:
Discord pings this immediately on save to verify it — it'll only succeed once the env vars above are deployed.
https://<your-vercel-domain>/api/interactions - Go to the Bot tab, create a bot, and copy its token.
- Register the
/catcommand once, locally:DISCORD_APPLICATION_ID=xxx DISCORD_BOT_TOKEN=xxx node register-commands.js - Install the app (works in DMs by default, or add
?type=serverfor a server):https://catapi-lac.vercel.app/catbot - Type
/catin any DM with the bot or in any server it's in.
api/catapi.js # Serverless function
vercel.json # Rewrite rules
package.json # Dependencies