Hi — I'm Miguel's assistant. Ask me about his experience, the stack behind this portfolio, or whether he can build the thing you have in mind.
Endpoint live
Meet Codehakai — the assistant baked into this site.
Most portfolios tell you what someone can build. This one lets you talk to something they built. Ask about my work, my stack, or what it would take to ship your project.
POST /api/codehakai/chat
online
01 Under the hood
No framework magic — just a well-behaved endpoint.
Codehakai is deliberately small. It's here to show how I'd wire an AI feature into a production app: validated input, a real rate limit, and secrets that stay server-side.
One Express route
A single POST handler validates the message, rejects anything over 1,200 characters, and returns structured JSON for every outcome — success, limit, and failure.
Per-visitor daily cap
Each visitor gets 5 prompts a day, tracked in memory by IP and user agent and reset at UTC midnight. The response carries the remaining count.
Server-side model call
The server calls the OpenAI Responses API with a scoped instruction. The API key lives in an environment variable and never reaches the browser.
Nothing is stored
Messages exist in this page and the request that carries them. There's no database, no transcript log, and no analytics attached to what you type.
Want an assistant like this trained on your own docs, products, or bookings?
Let's scope it