> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yolocode.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create your first cloud sandbox in under a minute

## Prerequisites

* A GitHub account
* A GitHub personal access token (or use the device flow)

## 1. Get a GitHub token

Use the device flow to authenticate without managing tokens manually:

```bash theme={null}
# Initiate device flow
curl -X POST https://api.yolocode.ai/api/github/device/code \
  -H "Content-Type: application/json" \
  -d '{"scope": "user repo read:org workflow"}'
```

This returns a `user_code` and `verification_uri`. Open the URL in your browser, enter the code, and then poll for the token:

```bash theme={null}
# Poll for token
curl -X POST https://api.yolocode.ai/api/github/device/token \
  -H "Content-Type: application/json" \
  -d '{"device_code": "<device_code_from_step_above>"}'
```

## 2. Create a sandbox

```bash theme={null}
curl -X POST https://api.yolocode.ai/api/e2b-sandboxes \
  -H "Authorization: Bearer <your_github_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-first-sandbox",
    "taskDescription": "Set up a Next.js project",
    "gitHubRepo": "your-username/your-repo",
    "githubToken": "<your_github_token>"
  }'
```

The response includes your sandbox details:

```json theme={null}
{
  "id": "sandbox-abc123",
  "name": "my-first-sandbox",
  "displayName": "nextjs-setup",
  "status": "running",
  "host": "sandbox-abc123.e2b.dev",
  "websshHost": "sandbox-abc123-8888.e2b.dev",
  "claudeHost": "sandbox-abc123-9999.e2b.dev"
}
```

## 3. Run a command

```bash theme={null}
curl -X POST https://api.yolocode.ai/api/e2b-sandboxes/<sandbox_id>/exec \
  -H "Authorization: Bearer <your_github_token>" \
  -H "Content-Type: application/json" \
  -d '{"command": "ls -la"}'
```

## 4. Chat with Claude

```bash theme={null}
curl -X POST https://api.yolocode.ai/api/e2b-sandboxes/<sandbox_id>/chat \
  -H "Authorization: Bearer <your_github_token>" \
  -H "Content-Type: application/json" \
  -d '{"message": "What files are in this project?"}'
```

This returns a Server-Sent Events stream with Claude's response.

## Next steps

> [card] [Sandbox lifecycle](https://docs.yolocode.ai/guides/sandboxes.md)
>
> Learn about pausing, resuming, and managing sandboxes.

> [card] [File management](https://docs.yolocode.ai/guides/file-management.md)
>
> Read and write files inside your sandbox.

> [card] [Claude integration](https://docs.yolocode.ai/guides/claude-integration.md)
>
> Configure Claude OAuth credentials for full AI access.

> [card] [API reference](https://docs.yolocode.ai/api-reference/introduction.md)
>
> Explore every endpoint in detail.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.