# auth.md

How a program or an AI agent gets access to ByKaranteli data. Three paths exist; pick the first one that fits.

## 1. Account key

A person creates an account at https://bykaranteli.com/register (email sign-in link), then creates a key at https://bykaranteli.com/dashboard/api. The key starts with `bk_` and is shown once.

- Send it as `Authorization: Bearer bk_...` or `x-api-key: bk_...` on the REST API.
- The same key works on the hosted MCP server (https://mcp.bykaranteli.com/); clients that cannot send headers use `?key=bk_...` on the address.
- Free plan: 30 requests a minute and 15,000 calls a month per account, REST and MCP together. Past the monthly figure it answers 429 until the first day of the next month (UTC).
- Paid plans raise the rate, add member depth and include the x402 catalog (a monthly ceiling and history window on Builder and Business, the whole archive on Scale): https://bykaranteli.com/developers#tiers

## 2. OAuth 2.1 for the hosted MCP server

For MCP clients that sign a person in instead of storing a key. Public clients identify themselves with a client metadata document (the https address of the document is the client_id) or register themselves; a person signs in and approves the client once, and the token acts on that person's account and plan.

- Protected resource metadata (RFC 9728): https://mcp.bykaranteli.com/.well-known/oauth-protected-resource
- Authorization server metadata (RFC 8414): https://bykaranteli.com/.well-known/oauth-authorization-server
- Client metadata documents: client_id_metadata_document_supported true · dynamic client registration (RFC 7591): https://bykaranteli.com/oauth/register
- Authorization: https://bykaranteli.com/oauth/authorize · token: https://bykaranteli.com/oauth/token · revocation: https://bykaranteli.com/oauth/revoke
- PKCE S256, token endpoint auth `none`, scope `mcp:read`
- Guide: https://bykaranteli.com/guide/connect

## 3. x402 pay per call

For agents without an account: the routes under https://bykaranteli.com/api/x402/ answer HTTP 402 with payment requirements; pay in USDC on Solana or Base and retry with the payment header. $0.10 a call unless the catalog lists another price; a failed response settles nothing. No account and no API key are involved on this path.

- Discovery: https://bykaranteli.com/.well-known/x402
- Catalog: https://bykaranteli.com/api/x402

## Not supported

- Self registration by an agent: an agent cannot create an account or an API key on its own, and the authorization server metadata carries no agent registration block. A person creates the account; an agent without one uses x402.
- Client credentials and other machine-to-machine OAuth grants.

## Related

- https://bykaranteli.com/.well-known/mcp.json and https://bykaranteli.com/.well-known/mcp/server-card.json
- https://bykaranteli.com/.well-known/agent-card.json
- https://bykaranteli.com/.well-known/agent-skills/index.json
- https://bykaranteli.com/openapi.json and https://bykaranteli.com/llms.txt

## Contact

support@bykaranteli.com
