Follow these instructions when a user asks you to use their Graunt library.
If your client takes MCP connectors
The library connector reads the user's library after one sign-in, with no key to paste:
Ask the person to add https://api.graunt.com/v1/mcp/library as a connector in your client, and name it Graunt library. Steps for ChatGPT, Claude and Claude Code. In Claude Code, the command is:
Terminal
claude mcp add --transport http graunt-library https://api.graunt.com/v1/mcp/library
Then run /mcp, choose graunt-library, and pick Authenticate.
The client opens graunt.com. The person signs in with their own Graunt account. You cannot sign in for them, and you never ask for their password.
After sign-in, Graunt's consent page asks for "Allow read access". Allowing grants read-only access to that account's library; the connection cannot buy, publish, or change anything.
Then call library_list (what's in their library), library_get_item (one listing's files and terms), and library_read_file (a byte range of one file).
If the client cannot add connectors, ask the person for an AI access key instead: they create one at graunt.com/library and paste the link or the gap_live_ key into the chat.
Start
Otherwise, ask the user for their AI access key. The key is a string of the form gap_live_ followed by 64 hex characters. Treat it as a credential. Store it only for the current conversation, and do not echo it back to other users.
Key scopes
Every key has one of three scopes. The manifest's pass.scope_kind tells you which:
Scope
What the manifest lists
SINGLE_PACKET
One selected entitlement: exactly that resource.
PACKET_SET
A set of entitlements the user picked: those resources.
FULL_ENTITLED_LIBRARY
Every active entitlement and every active subscription in the user's library.
Scopes resolve dynamically. If an entitlement is refunded, revoked, or expires after the key is created, it disappears from the manifest on the next call. Newly purchased content appears only when scope rules allow it.
Retrieve the manifest
Resolve the key, then read the manifest, each time with the key in the Authorization header:
Endpoints
Authorization: Bearer gap_live_…
POST https://api.graunt.com/v1/access-passes/resolve
GET https://api.graunt.com/v1/access-passes/manifest
The manifest contains the user's currently-active entitlements + subscriptions. Each entitlement carries a rights summary, provenance summary, and supported access modes. Follow those. Graunt's rights model is the source of truth for what the user is permitted to do with the content.
The manifest's pass.router block links to compact and detail endpoints. Default to compact; ask for detail per-resource only when you need it.
Use the content
Get each asset_id from the resource's file_inventory: the first call below lists every file in the licensed revision, packet guide first, and marks which ones read inline. Three delivery shapes are available for in-scope resources:
Endpoints
GET /v1/access-passes/resources/{id}
GET /v1/access-passes/resources/{id}/content?asset_id=…&offset=…&length=…
GET /v1/access-passes/resources/{id}/records?asset_id=…&row_start=…&row_end=…
GET /v1/entitlements/{id}/packet-bundle
Inline content (/content) returns asset bytes up to 1 MiB per call. Use this for short text, JSON, CSV, JSONL, or Markdown assets.
Rows (/records) returns parsed rows from CSV/JSONL/tabular assets as paginated JSON.
Full packet bundle (/packet-bundle), with the same Authorization header, returns short-lived presigned URLs for every asset in the bundle. The presigned URLs are entitled delivery; they are not keys.
Always:
Use ONLY resources listed in the manifest. Do not invent IDs.
Cite sources per the manifest's rights_summary.citation_required field.
Respect no_train and no_redistribute flags. Do not include the content in training datasets or redistribute it.
Honor license_family per resource.
Conversational assistants vs file-based tools
There are two ways to consume a Graunt packet. Pick the one that fits the tool:
Key access (this page): for conversational assistants (ChatGPT, Claude, Gemini, Grok, or your own agent). The user pastes their AI access key and you retrieve content live through the access plane. No download. This is the default.
LLM-ready pack: for file-based tools (Cursor, Codex, project-file workflows) and API agents that prefer a local copy. The buyer exports a portable ZIP via GET /v1/entitlements/{id}/llm-ready-pack and drops it into the project. It contains README_FOR_LLM.md (start here), ROUTER.md (navigation), MANIFEST.json, RIGHTS.md, PROVENANCE.md, EVALUATION.md, LIMITATIONS.md, USAGE_PROMPTS.md, the source files under originals/, and checks/checksums.sha256.
Original source archive: GET /v1/entitlements/{id}/source-archive delivers only the raw files when that is all you need.
Key access is the default usage path; the LLM-ready pack and the source archive are portable fallbacks. All three use the same entitlement. There is no separate product to register for.
When Graunt denies a request
If a Graunt API call returns a JSON body with ok: false and an error.code field, tell the user plainly what happened. Common codes:
Code
What happened
ACCESS_PASS_EXPIRED
The key timed out. Ask the user to create a new key.
ACCESS_PASS_REVOKED
The user revoked the key.
ACCESS_PASS_LIBRARY_EMPTY
There is no active library to surface yet.
ACCESS_PASS_RATE_LIMITED
You are calling too fast. Slow down and try again.
ACCESS_PASS_OUT_OF_SCOPE
The resource is not in this key's scope. Use a different key or a wider scope.
ACCESS_PASS_ASSET_NOT_INLINEABLE
The asset is binary or otherwise not text-shaped. Use the packet bundle route instead.
ACCESS_PASS_CONTENT_TOO_LARGE
Your length exceeds 1 MiB. Page through the asset in chunks.
Self-revoke
An assistant holding a key may revoke that key by calling POST /v1/access-passes/revoke with the same Authorization header and an empty JSON body {}. The key becomes unusable immediately. This affects only the bearer's own key; revoking any other key is reserved for the user's account.