cd /news/large-language-models/ask-hn-why-don-t-llm-apis-have-a-fir… · home topics large-language-models article
[ARTICLE · art-120834] src=news.ycombinator.com ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Ask HN: Why don't LLM APIs have a first-class test mode?

A Hacker News user argues that OpenAI, Anthropic, and other LLM providers should offer official API-compatible test endpoints that don't invoke models or consume billable tokens, similar to Stripe's test mode. The user notes that companies must build and maintain custom mocking services to stress-test their own infrastructure without incurring token costs, and suggests features like deterministic responses, configurable latency, and error simulation. The post asks how other teams handle this challenge, citing homegrown mocks, generic HTTP mocking, or record/replay as current approaches.

read2 min views1 publishedSep 3, 2026

Context: At work, we’re getting ready to stress-test a chatbot for scalability.

One fairly obvious issue came up: if our load tests exercise the real OpenAI/Claude APIs, a scalability test can quickly turn into a token-spending test.

Fair enough. We shouldn’t burn real inference just to test whether our own gateways, queues, WebSockets, streaming paths, retries, etc. can handle load.

The proposed solution was to mock all communication between our backend and the LLM provider.

Also reasonable.

What surprised me was the next step: we have to build and maintain that mocking service ourselves.

We can certainly do that. But should every company integrating with LLM APIs have to reinvent this?

Stripe solved a similar developer-experience problem years ago. They provide test mode, test data, test helpers, and even stripe-mock. It isn’t intended to perfectly reproduce Stripe’s backend behavior, but that’s okay. For many tests, you just need something API-compatible and predictable.

I’d love to see OpenAI, Anthropic, and other LLM providers offer something similar: an official API-compatible test endpoint that doesn’t invoke a model or consume billable tokens.

Ideally it could support things like:

  • deterministic canned responses * streaming responses * configurable latency / time-to-first-token * configurable token counts * tool-call responses * 429s, 5xx errors and timeouts * malformed/interrupted streams * rate-limit simulation The goal wouldn’t be to benchmark the LLM provider. You’d still need the real API for that. The goal would be to stress-test everything around the model without paying for thousands or millions of unnecessary inference calls.

What’s slightly ironic is that both OpenAI and Anthropic appear to use OpenAPI-based mock servers in their own SDK test suites. But, as far as I can tell, neither exposes that concept as a first-class public service for customers.

Am I missing something?

For teams running LLM applications at scale, how are you handling this today — homegrown mock server, generic HTTP mocking, record/replay, or just putting a budget cap on real API load tests?

Comments URL: [https://news.ycombinator.com/item?id=49556909](https://news.ycombinator.com/item?id=49556909)

Points: 1

── more in #large-language-models 4 stories · sorted by recency
── more on @openai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/ask-hn-why-don-t-llm…] indexed:0 read:2min 2026-09-03 ·