I wanted a small AI feature on my portfolio site that could answer visitor questions about my background and projects, without wiring up a direct OpenAI or Anthropic API key and dealing with per-provider billing. OpenRouter turned out to be the easiest way to get there.
Why OpenRouter
OpenRouter sits in front of dozens of model providers behind a single OpenAI-compatible API. Instead of juggling separate SDKs and API keys for each provider, I get one endpoint, one API key, and a model string I can swap whenever I want. For a low-traffic portfolio chatbot, that flexibility mattered more than squeezing out the absolute best model quality.
Picking a cheap model
Since this bot only needs to answer scoped questions about my experience and projects (not open-ended reasoning), I didn't need a frontier model. I went with budget-tier options like Gemini Flash and DeepSeek Chat, which OpenRouter exposes with the same request format as everything else. The cost difference versus a premium model is significant when you're paying per token for something running in the background of a portfolio site.
The setup
The chatbot lives behind the portfolio's Next.js frontend, with a lightweight backend service handling the actual OpenRouter calls. The flow is simple:
- Frontend sends the visitor's question to a backend endpoint
- Backend builds a prompt with context about my background/projects and forwards it to OpenRouter, targeting a cheap model
- OpenRouter routes the request to the underlying provider and returns a standard chat completion response
- Backend relays the answer back to the frontend chat widget
Because OpenRouter mirrors the OpenAI chat completions schema, switching models later (or falling back to a different one if one provider has issues) is just a config change, not a rewrite.
Things worth knowing
- Rate limits and quotas are per-model and vary by provider, so it's worth checking OpenRouter's model page before committing to one for anything beyond casual use.
- Prompt scoping matters — since I'm using a cheap model, I keep the system prompt tight and the context limited to what's relevant, rather than dumping my entire resume into every request.
- Cost stays predictable since OpenRouter shows per-request pricing per model, so I can estimate monthly cost before switching models.
Current status: it works, but the RAG side isn't done
The chatbot is live and responding, and it can retain some memory across a conversation, but the retrieval-augmented generation piece is still incomplete. It's nowhere near as sharp as memory in something like ChatGPT or Claude — those systems have much more mature context management and retrieval behind them, whereas mine is still a fairly basic implementation. Right now it can hold onto recent conversation context, but pulling in the right background info from a larger knowledge base reliably is the part I still need to build out properly.
Overall, OpenRouter made it trivial to bolt AI onto a side project without committing to a single vendor or overpaying for a task that a budget model handles just fine. The RAG and memory layer is the next thing to get right.