RouterAuthentication

Authentication

Three ways to authenticate to the gateway, each with its own rate limit.

API Key

Create keys at the dashboard. Keys start with sk-tan- and are SHA256-hashed before storage.

curl -H "Authorization: Bearer sk-tan-YOUR_KEY" \
  https://router.tangle.tools/v1/chat/completions
  • Rate limit: 60 req/min
  • Credit check: Yes (402 when the account has no credit)
  • Key features: Expiration dates, soft revocation, last-used tracking

Browser-based authentication via Better Auth. Supports email/password and OAuth (Google, GitHub).

  • Rate limit: 30 req/min
  • Credit check: Yes

SpendAuth (On-Chain Payment)

EIP-712 signed payment authorization. No account needed: pay operators directly on-chain.

curl -H "X-Payment-Signature: {\"commitment\":\"0x...\",\"amount\":\"1000000\",...}" \
  https://router.tangle.tools/v1/chat/completions
  • Rate limit: 120 req/min per commitment
  • Credit check: No (payment is on-chain)
  • See SpendAuth for details.

No credential

A request without a credential returns 402 payment_required. Every model call is paid by one of the three methods above.