Authorization header.
Auth flow
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:- Redirect users to GitHub authorization
- GitHub redirects back to
https://api.yolocode.ai/api/auth/callbackwith acode - Exchange the code for a token via
POST /api/github/oauth/token
- 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
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 returns402 Payment Required.