Who will call your API decides how much of it you need
Public, partner and internal APIs need very different amounts of security, documentation and limits. Scoping to the real audience is where most of the cost difference sits.
Who calls it What it needs Where over- or under-building shows
Only your own web or mobile app Clear endpoints, login, a permission check on every request, and tests. Versioning can stay light because you ship both sides. Mobile breaks that rule. Old app versions stay on phones for months, so the API has to keep answering them.
A handful of partners or suppliers Separate API keys or OAuth clients per partner, logs of who called what, written docs and a test environment they can try things in. Partners build against whatever you send on day one. Changing it later becomes a project on their side, not just yours.
Any developer who signs up (a public API) Self-serve keys, rate limits that answer with HTTP 429 and a retry time, a published changelog, versioning, and docs good enough that nobody has to email you. Building all of this for an internal tool wastes months. Skipping it on a public API means support tickets forever.
Other systems receiving events from yours (webhooks) Signed payloads, retries with backoff, and a way for receivers to replay what they missed. Receivers will get duplicates. Send an event ID with each one so they can ignore repeats.