Repository navigation
Preserve keyed URLs across the API reference - #54
Closed
alpacai[bot] wants to merge 6 commits into
Closed
alpacai[bot] wants to merge 6 commits into
alpacai[bot] wants to merge 6 commits into
Conversation
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.
Deploying api-docs with
|
| 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 |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
defillama-openapi-free.json.llms.txtandllms-pro.txt.scripts/generate-llms.ts,llms.txt,llms-pro.txt, andllms-free.txt.examples/web/src/components/ApiKeyInput.vue.Verification
node scripts/check-spec-responses.ts defillama-openapi-free.jsonpassed for 29 routes and skipped two deprecated routes.node scripts/generate-llms.tsreproducedllms-free.txtbyte for byte and both mapping tables matched.git diff --checkpassed.