# VectorBT PRO authentication

Public content at https://vectorbt.pro needs no authentication. Member content at https://members.vectorbt.pro requires an active VectorBT PRO membership.

## Browser access

[Sign in with GitHub](https://members.vectorbt.pro/auth/login) using the account linked to your membership. This creates a session cookie.

## Agent access

Exchange a GitHub token from the member's account for a site token. Any token that identifies the member works, including the GitHub CLI token and fine-grained tokens without permissions. Our GitHub App checks repository access. The site uses the token only to look up the account and does not store it.

1. Get the member's GitHub token, trying these sources in order:
   * Run `gh auth token`. Members sign in with GitHub CLI to [install VectorBT PRO](https://members.vectorbt.pro/installation/), so this usually works without extra setup.
   * Read the user's configured token (for example, `GITHUB_TOKEN`) from their environment or parse only its value from their local .env file. Do not execute the file.
2. POST to https://members.vectorbt.pro/auth/token with `Authorization: Bearer <github-user-token>`.
3. Use the returned `access_token` in `Authorization: Bearer <access_token>` for member requests to https://members.vectorbt.pro. Reuse it for the lifetime specified by `expires_in` in seconds, then repeat the exchange.

If no token is found, ask the user to run `gh auth login` and `gh auth setup-git` in their terminal, which also lets pip install the package from the private repository. If GitHub CLI is signed in but `gh auth token` fails, your sandbox may be blocking its credential store. Ask the user to allow it or to tell you where a token is configured. For other setups, see [Using AI](https://members.vectorbt.pro/using-ai/#set-up-github-access).

Never print or log either token. Keep the site token in memory when possible. Issued tokens remain valid until expiry, even if GitHub access is revoked.

## Find content

Fetch https://members.vectorbt.pro/llms.txt with authentication for the full index. Send `Accept: text/markdown` or follow Markdown links. A 401 response means credentials are missing, invalid, or expired.

Authentication metadata: https://members.vectorbt.pro/.well-known/oauth-protected-resource
