Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/orlando-japan/claude-code-setting/api-design-principlesnpx skills add orlando-japan/claude-code-setting --skill api-design-principlesgit clone --depth 1 https://github.com/orlando-japan/claude-code-settingWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/orlando-japan/claude-code-setting/api-design-principles)<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/api-design-principles"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/api-design-principles.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.00850 |
| Opus 5 | $0.00018 | $0.00425 |
| Sonnet 5 | $0.00007 | $0.00170 |
| Haiku 4.5 | $0.00004 | $0.00085 |
Grade A, and why
api-design-principles scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API design principles
APIs are contracts. Contracts are expensive to change. Design them once, carefully.
The core principles
Consistency beats cleverness
If every other endpoint is POST /resource, don't invent PUT /resource/create because it feels more REST-ful. Future callers learn one pattern; every deviation costs them.
Make the easy path the correct path
If the right behavior requires a flag, users won't find it. Defaults must be correct. Dangerous behaviors must be opt-in and verbose.
Names tell the whole story
GET /users/:id— obvious.POST /users/:id/orders— obvious.POST /users/:id/block— obvious.POST /do-thing— never.POST /api/v2/users/:id?action=block— no, make it an endpoint.
Verbs in paths are fine when REST's resource model doesn't fit. Don't contort.
Errors are part of the API
- Structured.
{ "error": { "code": "not_found", "message": "User 42 does not exist" } }. - Stable codes. Callers will branch on
code. Don't rename it. - No stack traces in production responses.
- HTTP status matches semantics. 400 ≠ 404 ≠ 422. Don't return 200 with an error body.
Idempotency
Mutations that might be retried (creates especially) should accept an idempotency key and dedupe server-side. Otherwise, retries create duplicates and you'll find out on an incident.
Pagination
- Every list endpoint gets pagination from day one. Adding it later breaks callers.
- Cursor-based beats offset-based for large datasets (stable under writes).
- Max page size enforced server-side.
?limit=1000000must be clamped or rejected.
Versioning
- Major version in the URL (
/v1/,/v2/) for external APIs. Clean, visible, routable. - No implicit breaking changes. Adding a field to responses = safe. Removing or renaming = breaking → new version.
- Deprecation has a date. "Deprecated in v1" with no sunset date stays forever.
Backwards compatibility
For public APIs, assume someone will call you wrong. Be liberal in what you accept, strict in what you return.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 86 lines · 36 tokens per session scan A a7f1f50c6762
api-design-principles is a skill published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 850 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
horse-database-pooling
Guide for setting up thread-safe database connection pooling (FireDAC / UniDAC) in multithreaded Horse applications.
horse-mvc-architecture
Guide for structuring corporate Horse applications using Clean MVC (Model-View-Controller) principles and decoupling HTTP layers from business logic.
horse-request-response
Guide to interacting with THorseRequest (body, query, params, headers) and THorseResponse (Send, Status, ContentType).