Work / Demo

Claude features in an existing Express API

Three Claude-powered endpoints added to an example shop API, with schema-checked JSON output and streaming.

Role
Design and development
Stack
Node.jsTypeScriptExpressClaudeOpenAIzodVitest

Situation

Many teams already run a Node.js API and want AI features without rewriting it. This demo starts from a small online-shop API and adds AI next to the existing routes.

What I built

  • Product descriptions: structured product fields in, a fixed JSON shape out
  • Ticket triage: category, priority, sentiment and a draft reply for a person to check
  • Summaries: a single response or a stream, and the AI request stops when the client disconnects
  • Every AI response is checked against a schema before it is returned
  • Timeouts and retry counts live in config, so cost and latency stay predictable
  • The provider sits behind one interface, so Claude and OpenAI can be swapped

Result

38 tests run without an API key, and a demo script calls every endpoint in turn. The screenshots come from mock mode, and they are labeled that way.

Request and response for the product description endpoint
Product fields go in, and a validated JSON object with title, description, bullets and SEO keywords comes out.
Support tickets classified by category, priority and sentiment
Ticket triage returns a category, priority, sentiment and a draft reply for an agent to review.
A summary streamed as Server-Sent Events
Summaries come back in one response or as a stream of Server-Sent Events.

All work