api-endpoints

api-endpoints is a skill for Claude Code, Codex from latitude-dev/latitude-llm. It costs 78 tokens per session (6,133 once invoked), scanned A, original, MIT.

Guidance for adding an API operation from one shared definition so it can be exposed through HTTP, documentation, developer libraries, command-line tools, and agent tools.

In plain words
What is it for?
Use it when adding or changing API operations, deciding where shared logic belongs, or checking why generated API descriptions and SDKs are out of date.
Why use it?
It keeps the different API surfaces synchronized and encourages reuse of existing application logic instead of duplicating it.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/latitude-dev/latitude-llm/api-endpoints
Any agent
npx skills add latitude-dev/latitude-llm --skill api-endpoints
Clone the repo
git clone --depth 1 https://github.com/latitude-dev/latitude-llm

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for api-endpoints

README.md
[![agentmods](https://agentmods.dev/badge/skills/latitude-dev/latitude-llm/api-endpoints.svg)](https://agentmods.dev/skills/latitude-dev/latitude-llm/api-endpoints)
Your own site
<a href="https://agentmods.dev/skills/latitude-dev/latitude-llm/api-endpoints"><img src="https://agentmods.dev/badge/skills/latitude-dev/latitude-llm/api-endpoints.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,133 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.06133
Opus 5 $0.00039 $0.03067
Sonnet 5 $0.00016 $0.01227
Haiku 4.5 $0.00008 $0.00613

Measured 4d ago against content hash 8b752eac4f81, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-endpoints scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| HTTP route (Hono) | `route.method` + `route.path` + `execute`/`handler` | curl, internal services — mounted by `apps/api` |
.agents/skills/api-endpoints/SKILL.md · 318 lines

How it starts

The opening of the file, as written. The whole thing — 318 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding API operations

When to use: Adding a new operation to the public API, changing an existing one, or wondering why mcp.json / openapi.json / the SDK aren't in sync.

Before you start — reuse the UI's logic via the domain layer

When you add a new operation, check whether the same action or read is already available in the web UI. The goal isn't full surface parity, it's not duplicating logic that the web already implements.

For each new operation, open apps/web/src/domains/<entity>/<entity>.functions.ts. Three cases:

  • The web's server fn already calls a domain use-case (imports *UseCase from @domain/*): reuse that use-case in the operation. Don't reimplement the logic.
  • The web's server fn has the logic inline (raw repository calls, validation, side effects in the server fn body itself): extract it into a new domain use-case first, then have both the web server fn AND your operation call it. The domain use-case becomes the shared seam.
  • The web's server fn delegates to a third-party API like getBetterAuth().api.*: the API process can't reach the same in-process instance. Write a domain use-case that replicates that behavior (carefully — read the third-party source so your use-case matches its rules), then point both the web and the operation at the use-case. Adds parity tests so the migration doesn't silently drift.

The domain use-case is the shared seam between web and API. Duplicating logic in both surfaces creates drift — one gets a bug fix the other doesn't.

If the entity doesn't have a .functions.ts because the UI doesn't expose this action yet, you're designing fresh. That's fine; just don't lose the option to share later — put the business logic in a @domain/* use-case from the start rather than inline in the operation.

What you're really doing

Every operation in packages/operations is one declaration that fans out into every generated surface:

Surface Generated from Consumed by
HTTP route (Hono) route.method + route.path + execute/handler curl, internal services — mounted by apps/api
OpenAPI operation route.name (→ operationId), route.description, request/response schemas apps/api/openapi.json — the source Fern reads for the SDKs + CLI
MCP tool route.name, route.description, flattened input + 2xx-JSON output schema apps/api/mcp.json, runtime /v1/mcp transport
TS + Python SDK methods Fern reads openapi.json; group/sdkMethod name the method end-user TypeScript (@latitude-data/sdk) and Python (latitude-sdk) code
latitude CLI command Fern reads openapi.json shell users + AI agents (latitude <resource> <verb>, --help, --schema)
In-process agent tool defineToolset({ groups }) selection over execute-form operations internal AI agents (e.g. the signal-creation agent) — no HTTP, no tokens

Read the full file on GitHub · 318 lines

Changes

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.

  1. 4d ago First seen · 318 lines · 78 tokens per session scan A 8b752eac4f81

Subscribe to this mod's changes

api-endpoints is a skill published in the GitHub repository latitude-dev/latitude-llm (4,619 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 6,133 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.