Skip to main content
Every Yolocode sandbox can connect to Claude AI for coding assistance. There are two auth mechanisms for Claude access.

Auth methods

JWT (default)

When you create a sandbox, a JWT token is automatically generated and injected. This token is used by the Claude Gateway to authenticate requests from within the sandbox.

OAuth credentials

For full Claude access (using your own Anthropic account), you can inject OAuth credentials:
This writes credentials to .claude/.credentials.json inside the sandbox and restarts the Claude WebSocket server. You can also include optional fields:

Claude Gateway

The Claude Gateway (POST /api/claude-gateway/[...path]) is a proxy that forwards requests to the Claude API with auth validation. It accepts auth from multiple sources:
  • x-api-key header
  • Authorization: Bearer or Basic header
  • URL query parameter
The gateway checks your payment status before proxying. Unpaid users receive a 402 Payment Required response.

Claude OAuth token exchange

Yolocode also proxies the Claude OAuth token exchange to handle CORS:
This proxies to https://console.anthropic.com/v1/oauth/token and returns access/refresh tokens with CORS headers.