Minerval

Authentication

Read the graph with no credentials at all, connect a hosted MCP client through OAuth, or send an API key from anything where you set the headers. Every authenticated call is attributed to one account.

You are usingCredentialWhere it works
A browser page or script that only readsNonePublic REST reads. Not /mcp
Claude.ai, Cowork, or Claude Code with no key setOAuth access token (eoat_…), obtained for you/mcp only
Claude Code with a key, a CLI, a server, the browser extensionAPI key (epk_…)/mcp and every REST route an account can call

Reading without credentials

The public REST reads need no key. They answer with access-control-allow-origin: *, so a page on any site can call them from the browser. The headers a page may send are Content-Type, Authorization and X-API-Key, and a script can read RateLimit-Policy and Retry-After from the response.

An anonymous read answered 200 is cacheable: cache-control: public, max-age=60, stale-while-revalidate=300, with a weak ETag. Send the tag back in If-None-Match and an unchanged answer comes back as 304 with no body. A request that carries any credential is answered private, no-store.

A public read, as served
$ curl -sI "https://api.claimgraph.io/tags?limit=1"
HTTP/2 200
access-control-allow-origin: *
access-control-expose-headers: RateLimit-Policy, Retry-After
ratelimit-policy: 300;w=60
cache-control: public, max-age=60, stale-while-revalidate=300
vary: Authorization, X-API-Key
etag: W/"Wm70D5kbx9aL25OMz03IE46FlpA"

Requests without a recognised credential are limited to 300 a minute per IP address. Every counted response states the limit in RateLimit-Policy: 300;w=60. Past it the answer is 429 with Retry-After (in seconds) and the code ANONYMOUS_RATE_LIMITED. An anonymous caller has no account or budget to bound its use, so a count per address stands in for one. A request with a recognised key or token is not counted. Each API instance keeps its own count, and reads the edge answers from its cache never reach one.

The MCP endpoint always needs an account. An anonymous POST /mcp gets 401 with a challenge that points the client at the sign-in flow below:

The challenge
HTTP/2 401
www-authenticate: Bearer resource_metadata="https://api.claimgraph.io/.well-known/oauth-protected-resource/mcp"

{"error":"Invalid or missing API key"}

OAuth 2.1 for hosted MCP clients

The API is an OAuth 2.1 authorisation server for its own /mcp resource. A client that follows the MCP authorisation spec finds everything from the challenge above, so in Claude.ai or Cowork you add https://api.claimgraph.io/mcp as a custom connector and leave the client ID and secret empty. The client registers itself and opens the sign-in page.

  1. Discovery

    GET /.well-known/oauth-protected-resource names the authorisation server; GET /.well-known/oauth-authorization-server describes it. Both are also served with /mcp appended, because clients derive the path both ways. Each is public and cached for an hour.

  2. Registration

    POST /oauth/register (RFC 7591), with no credentials. redirect_uris (one to ten) must be https, or http on localhost, 127.0.0.1 or [::1]. token_endpoint_auth_method is none for a public client, or client_secret_basic (the default) or client_secret_post, in which case the answer carries a client secret (eocs_…) once.

  3. Authorisation

    GET /oauth/authorize with response_type=code and PKCE: code_challenge is required and code_challenge_method must be S256. The only scope is mcp. The API checks the request and sends the browser to minerval.ai/oauth/consent.

  4. Consent

    The person signs in on minerval.ai if they are not already, sees the client's name and where it will send them back, and approves or denies. Approving needs a signed-in session. The page says what the client will be able to do: read the graph, propose claims and submit sources, contributions and appeals in the person's name, and spend owls from their balance. It cannot buy owls or manage API keys.

  5. Tokens

    POST /oauth/token with grant_type=authorization_code, the code, the redirect_uri and the code_verifier. Later, grant_type=refresh_token.

ItemPrefixLasts
Pending authorisation (authorize to consent)10 minutes
Authorisation codeeoac_5 minutes, one use
Access tokeneoat_1 hour (expires_in: 3600)
Refresh tokeneort_30 days, replaced on every use

Every refresh revokes the refresh token it was given and issues a new pair, so a client that refreshes at least once every 30 days stays connected. A refresh token that has already been used is treated as stolen: every token in that grant is revoked, the answer is invalid_grant, and the person has to approve the client again.

Tokens work only on /mcp.An access token is scoped mcp and bound to the MCP endpoint, which is what the person consented to. On a REST route it is refused with 403 INSUFFICIENT_SCOPE. Every route an account can call is also an MCP tool, and the tool runs as the account that holds the token. Use an API key to call REST directly.

API keys

Create a key on your account page, under API keys. It starts epk_ and is shown once, when it is made: copy it then. Make one for each place you use it, so each can be revoked on its own. The account page lists your keys by their first twelve characters with when each was last used and what its calls cost.

claude mcp add --transport http minerval https://api.claimgraph.io/mcp \
  --header "x-api-key: epk_…"

Send the key in x-api-key. On /mcp it may instead go in Authorization: Bearer <key>; REST routes read only x-api-key, and take a Bearer value only when it is an OAuth access token.

Creating and revoking keys need a session signed in on the site, never a key. A key that leaked could otherwise mint more keys, or revoke yours. Buying owls is held the same way, so neither is an MCP tool. Listing your keys is (list_api_keys, GET /api-keys).

When a credential is refused

A key the API does not recognise (mistyped, revoked, or made up) is not a credential. What happens depends on the route:

CaseAnswer
A public read that answers everyone the same, such as GET /claims/:claim_idAnswered as an anonymous read: counted against the address limit, and marked private, no-store
A route that needs an account, or a public read that looks at the caller when one is presented (such as GET /contributions, for mine)401 {"error":"Invalid or missing API key"}
An access token that is unknown, expired or revoked401 Invalid or expired access token
An access token on a REST route403 INSUFFICIENT_SCOPE
A valid credential for a suspended account403 ACCOUNT_SUSPENDED
Key creation, revocation or a purchase without a signed-in session403 SESSION_REQUIRED
The token endpoint, with client authentication that fails401 invalid_client

On a route that exists, a 401 means the credential was not recognised: check the key, or sign the client in again. Errors →

In a members-only deployment

A members-only deployment serves nothing to a request without a credential: it answers 401 SIGN_IN_REQUIRED, and 403 NOT_A_MEMBER to an account that holds no permission there. The OAuth discovery, registration, authorise and token endpoints stay open, because a client has to reach them before it holds anything.

Where such a deployment holds material at more than one label, each API key and each OAuth grant works at one label, named by the person when the key is made (POST /api-keys takes label) or when the client is approved (POST /oauth/requests/:request_id/approve takes label), and kept through every refresh. A request made with it reads what that label reads, within what the person may read, and files what it adds at that label and no other. An MCP client is told its connection's label in the server's instructions; get_my_labels says who reads it. A key made before the deployment had a second label works at public. Members-only deployments →