Skip to main content
Yolocode authenticates users via GitHub. Every API request requires a valid GitHub token passed as a Bearer token in the Authorization header.

Auth flow

The API validates your token by calling GET https://api.github.com/user. If valid, it extracts your userId and login for access control.

Getting a token

OAuth flow

For web and mobile apps, use the standard GitHub OAuth flow:
  1. Redirect users to GitHub authorization
  2. GitHub redirects back to https://api.yolocode.ai/api/auth/callback with a code
  3. Exchange the code for a token via POST /api/github/oauth/token
The callback handler supports multiple origins:
  • Mobile: myapp:// deep links
  • Expo: exp:// links
  • Web: Validated against allowed origins

Device flow

For CLI and headless environments:

Sandbox auth

Sandboxes use JWT tokens for internal authentication. When you create a sandbox, a JWT is generated with:
  • Algorithm: HS256
  • Issuer: yolocode-api
  • Expiry: 24 hours
  • Payload: userId, sandbox name
These JWTs are used internally by the Claude Gateway to validate requests from within sandboxes.

Payment gating

Some features (like the Claude Gateway) require a paid account. The API checks your payment status via WorkOS user metadata. If you haven’t paid, the Claude Gateway returns 402 Payment Required.