---
title: "Authentication for Pool and Synap402"
description: "Public pool telemetry, model discovery and documentation search need no credentials. Paid inference requires an authorized API key or a narrowly scoped delegated OAuth token. Both use the same account limits and metering"
canonical: "https://pool.linkrra.com/auth.md"
last-updated: "2026-12-04"
---

# Authentication for Pool and Synap402

Public pool telemetry, model discovery and documentation search need no credentials. Paid inference requires an authorized API key or a narrowly scoped delegated OAuth token. Both use the same account limits and metering; OAuth does not create free credit or bypass billing.

## Discover

Protected resource: `https://pool.linkrra.com/v1`.
[Resource metadata](https://pool.linkrra.com/.well-known/oauth-protected-resource/v1) names the [authorization server](https://synap402.com/.well-known/oauth-authorization-server). API 401 responses include `WWW-Authenticate: Bearer` with the resource metadata URL. The authorization server is on Synap402 because its verified sign-in session is first-party there.

## Pick a method

- **API key:** sign in at [Synap402](https://synap402.com/login), create/manage a key in your account, and store it privately in your client.
- **Delegated OAuth:** authorization-code flow with PKCE S256, a real user consent screen and a short-lived bearer token. Supported scopes: `models:read` and `inference:write` (chat completions only). No refresh tokens or client secrets.
- **x402:** separately discover the [pay-per-call protocol](/.well-known/x402). It authorizes a payment, not an OAuth session; inspect the current challenge before paying.

WorkOS `agent_auth`, `identity_assertion`, `service_auth` and ID-JAG token exchange are not implemented. Do not interpret ordinary OAuth support as those extensions or invent an `identity_endpoint`.

## Register an OAuth client

POST JSON to `https://synap402.com/api/oauth/register`:

```json
{"client_name":"My integration","redirect_uris":["https://your-app.example/oauth/callback"],"token_endpoint_auth_method":"none","grant_types":["authorization_code"],"response_types":["code"]}
```

Replace the redirect with your real callback. Use HTTPS; literal loopback HTTP (`127.0.0.1` or `[::1]`) is allowed for local clients. Redirect fragments and embedded credentials are rejected. Registration returns a `client_id`; it does not grant access or verify the app developer's identity.

## Claim access through user consent

Generate a cryptographically random PKCE `code_verifier` (43–128 permitted characters), its SHA-256 base64url `code_challenge`, and a random `state` to bind the callback. Open `https://synap402.com/api/oauth/authorize` in the user's browser with:

- `response_type=code`
- the registered `client_id` and exact `redirect_uri`
- `code_challenge_method=S256` and `code_challenge`
- `resource=https://pool.linkrra.com/v1`
- the minimum required `scope` (`models:read` or `inference:write`, space separated)
- your unpredictable `state`

The user signs in to Synap402 and chooses an existing account-owned API key on the consent screen. An unsigned/guest session cannot approve. If sign-in is needed, return to the integration and retry authorization after sign-in. Never ask the user to paste a password, key or session cookie into a chat. The app name is developer-supplied, not a verified endorsement. Reject a callback whose state does not match.

## Exchange the authorization code

POST form-encoded data to `https://synap402.com/api/oauth/token`: `grant_type=authorization_code`, the returned `code`, `client_id`, exact `redirect_uri`, original `code_verifier`, and `resource=https://pool.linkrra.com/v1`.

A code expires after two minutes and is consumed once. The response contains `access_token`, `token_type: Bearer`, `expires_in: 3600`, and granted `scope`. Keep both code and token private. There is no refresh-token flow; request fresh user consent when needed.

## Use the access_token

Send `Authorization: Bearer ACCESS_TOKEN` to `https://pool.linkrra.com/v1/chat/completions` with `inference:write`. This can incur charges and requires the user's authorization. The token cannot access account administration, billing, keys, files or batch jobs. Discovery reads are free. Existing key validity, revocation, account suspension, allowed models, key-kind restrictions and usage/spend limits continue to apply.

A regular API key uses the same Authorization header but retains its own stored operation restrictions. Provider and marketplace keys are not unrestricted account credentials. Never supply a key or token in a URL, repository, tool argument or public example.

## Errors

Invalid/expired tokens return 401; an insufficient delegated scope returns 403. An invalid redirect, PKCE proof or authorization request is rejected rather than redirected to an untrusted URL. Cancelled consent returns `error=access_denied` to the registered callback with state. Rate limits return HTTP 429 and retry guidance where supplied. Do not retry an ambiguous chargeable inference request blindly; only batch creation separately documents `Idempotency-Key` replay guarantees.

## Revocation

POST form-encoded `token` and `client_id` to `https://synap402.com/api/oauth/revoke`. Successful revocation returns 200 without revealing whether a token existed. Revoke the selected underlying API key in the authenticated account to invalidate every delegated token backed by it. Suspending the account also prevents token use. Tokens are stored as hashes, expire after one hour, and cannot survive removal of their underlying authority.

[API guide](/api.md) · [MCP guide](/mcp-guide.md) · [Synthetic sandbox without credentials](/sandbox.md)
