API startup built endpoints to match URLs that AI models hallucinated for their service
Erasetext, an image-processing API service, discovered that AI coding assistants were generating incorrect API endpoints, field names, and response formats that did not match their actual documentation. Instead of simply correcting individual users, the team decided to make the hallucinated URLs functional by mapping paths like /api/mcp/erase and /mcp/erase to the same upstream handler as the real /v1/erase endpoint. They also added header aliasing so that Bearer token authorization would automatically convert to the API key format the service actually requires, and adjusted response formatting on these alias routes to return JSON with an output_url field as the AI-generated code expected. The changes were deployed via a Cloudflare Worker router with minimal code and no impact on existing documented behavior. The team framed the approach as treating broken generated code as traffic data, arguing that a widely hallucinated URL is effectively a de facto standard worth owning before others do.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in