cd /news/ai-agents/how-to-make-a-better-api-for-claude-… · home topics ai-agents article
[ARTICLE · art-25443] src=dev.to pub= topic=ai-agents verified=true sentiment=· neutral

How to make a better API for claude/codex?

A developer built an API for sales research that finds LinkedIn profiles with a 75% success rate and returns decision-maker information, but is struggling with AI agents like Claude losing context of the API key, endpoints, and documentation mid-conversation. The developer hypothesizes that poor documentation structure or schema may be causing the issue, and is seeking solutions for agent-friendly API design.

read1 min publishedJun 12, 2026

So I built a few API calls for sales research purposes, mainly to help people gather better information about their prospects and leads.

The API can currently find LinkedIn profiles with around a 75% success rate, and it can also return decision-makers together with their LinkedIn profiles.

Where I’m struggling now is making the API more useful and reliable for AI agents. It’s not bad at the moment, but I’ve received feedback that Claude often “loses memory” of the API key, available endpoints, or what the API is supposed to do, even when the API key and documentation were provided in the conversation.

My current hypothesis is that this may be strongly connected to a poor documentation structure or schema. Maybe the docs are not clear enough for an agent to understand when and how to use each endpoint consistently.

Has anyone had a similar experience with Claude or other AI agents losing context, even when the API key and documentation were already shared?

I’d be very curious to learn how you solved it — especially around documentation structure, OpenAPI schemas, endpoint naming, examples, or agent-friendly API design.

── more in #ai-agents 4 stories · sorted by recency
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/how-to-make-a-better…] indexed:0 read:1min 2026-06-12 ·