Skip to content

Preserve keyed URLs across the API reference - #54

Closed
alpacai[bot] wants to merge 6 commits into
mainfrom
alpaca/align-keyed-api-docs-1795532840
Closed

alpacai[bot] wants to merge 6 commits into
mainfrom
alpaca/align-keyed-api-docs-1795532840

Conversation

@alpacai

@alpacai alpacai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

Stacked on #53 to address its review findings. Eight duplicate OpenAPI keys caused JSON consumers to drop the keyed URL callouts. The patch also aligns the Yield compatibility URLs and describes the API plan's higher rate limits.

Changes

  • Merge each of the eight duplicated operation descriptions in defillama-openapi-free.json.
  • Use the versioned Yield compatibility URLs in the mapping tables in llms.txt and llms-pro.txt.
  • Update the shared example in scripts/generate-llms.ts, llms.txt, llms-pro.txt, and llms-free.txt.
  • Describe the API plan's higher limits in examples/web/src/components/ApiKeyInput.vue.

Verification

  • node scripts/check-spec-responses.ts defillama-openapi-free.json passed for 29 routes and skipped two deprecated routes.
  • A duplicate-key and route check failed on the reviewed head and passed on the patch. All 31 keyed URLs agree with the mapping tables and Pro spec, and all original operation descriptions are preserved.
  • node scripts/generate-llms.ts reproduced llms-free.txt byte for byte and both mapping tables matched. git diff --check passed.
  • The Cloudflare preview rendered the higher-limit copy and both parts of the TVL operation description. The free OpenAPI file and all three text docs served by the preview matched the draft commit byte for byte.

treeoflife2 and others added 6 commits November 24, 2026 16:41
Code written from llms-free.txt called the free hosts even when the user
said they had an API key, so paying users hit the free rate limit.

- Add a "Have an API key?" section at the top of llms.txt, llms-free.txt
  and llms-pro.txt: every request goes to pro-api.llama.fi, free hosts never
  read a key, a 429 there means the wrong host, and the $49 Pro plan has no key.
- List the keyed pro-api URL under every free endpoint in llms-free.txt.
- Say the same on the static homepage and in the free spec description.
- Note that header and query keys get "API Key is wrong" from pro-api.
- Rename the docs page key box to "API Key (API plan)".
- Map free yields paths to /yields/v1/ so they keep a pro twin.
run.mjs has headless coding sessions write integrations from the docs with
a real key. grade.mjs runs each shipped script behind a logging proxy and
records which llama.fi hosts it contacts.
The docs page without a key shows free operations on their free hosts and
no keyed alternative, so readers with a key copy the free URL. Each free
operation now names its pro-api.llama.fi twin.
The key rule no longer says which subscription includes a key. It only
says that a user with a key, whatever they call their plan, uses
pro-api.llama.fi. The eval scripts move out of this repo.
The three files repeated the same key rules in three sections. They now
share one section with a right and wrong example. It also says fallback
lookups go to pro-api, and links llms.txt and llms-pro.txt by absolute
URL so a saved copy can still reach them.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 97b6e14
Status: ✅  Deploy successful!
Preview URL: https://9130c715.api-docs-59g.pages.dev
Branch Preview URL: https://alpaca-align-keyed-api-docs.api-docs-59g.pages.dev

View logs

@treeoflife2

Copy link
Copy Markdown
Member

Cherry-picked into the #53 branch as 936be99 (same change), so this can be closed.

Base automatically changed from claude/fix-agents-use-pro-api to main November 24, 2026 19:08
@treeoflife2
treeoflife2 deleted the alpaca/align-keyed-api-docs-1795532840 branch November 24, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant