> Full docs index: https://docs.steel.dev/llms.txt

# Quickstart
URL: https://docs.steel.dev/overview/sessions-api/quickstart

### Overview

This guide will walk you through setting up your Steel account, creating your first browser session in the cloud, and driving it using TypeScript/Playwright. In just a few minutes, you'll be up and programmatically controlling a Steel browser Session.

### Initial Setup

#### 1\. Create a Steel Account

1.  Sign up for a free account at steel.dev

2.  Launch includes $30 in one-time free usage credits, valid for 90 days. See [Pricing/Limits](/overview/pricinglimits) for current rates and limits.

3.  No credit card required

#### 2\. Get Your API Key

1.  After signing up, navigate to Settings > API Keys

2.  Create an API key and save it somewhere safe. You will not be able to generate the same key again.

#### 3\. Set Up Environment Variables

1.  Create a `.env` file in your project root (if you don't have one)

2.  Add your Steel API key:

```bash
STEEL_API_KEY=ste-your-api-key-here
```

Make sure to add `.env` to your `.gitignore` file to keep your key secure

### Installing Dependencies

Install the Steel SDK, Playwright, dotenv to load your `.env` file, and tsx to run TypeScript:

```bash
npm install steel-sdk playwright dotenv tsx
```

Using Python? `pip install steel-sdk playwright`, then `playwright install chromium`. The PyPI package is `steel-sdk`, but the import is `from steel import Steel`.

### Create Your First Session

Save the following as `steel-client.ts`. It creates a session, connects with Playwright, visits a page, and releases the session even if a browser operation fails:

```typescript
import Steel from 'steel-sdk';
import { chromium } from 'playwright';
import 'dotenv/config';

async function main() {
  const apiKey = process.env.STEEL_API_KEY;
  if (!apiKey) {
    throw new Error('Set STEEL_API_KEY in your .env file');
  }

  const client = new Steel({
    steelAPIKey: apiKey,
  });

  const session = await client.sessions.create();
  console.log('Session created:', session.id);
  console.log(`View live session at: ${session.sessionViewerUrl}`);

  try {
    const browser = await chromium.connectOverCDP(
      `wss://connect.steel.dev?apiKey=${encodeURIComponent(apiKey)}&sessionId=${session.id}`,
    );
    const page = await browser.contexts()[0].newPage();
    await page.goto('https://example.com');
    console.log('Page title:', await page.title());
  } finally {
    // Releasing the session closes its remote browser and connection.
    await client.sessions.release(session.id);
    console.log('Session released');
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
```

Run it from the directory containing your `.env` file:

```bash
npx tsx steel-client.ts
```

### Session Features

To configure your session, replace the `client.sessions.create()` call inside `main()`
with the following options:

```typescript
const session = await client.sessions.create({
    useProxy: true,           // Use Steel's residential proxy network
    solveCaptcha: true,       // Enable automatic CAPTCHA solving
    timeout: 600000,       // Set 10-minute timeout (default is 5 minutes)
    inactivityTimeout: 300000, // Release after 5 minutes of inactivity
    userAgent: 'custom-ua'    // Set a custom user agent
});
```

You've now created your first Steel session and learned the basics of session management. With these fundamentals, you can start building more complex automations using Steel's cloud browser infrastructure.

### Need help building with the Sessions API?
Reach out to us on the **#help** channel on [Discord](https://discord.gg/steel-dev) under the ⭐ community section.

### FAQ

### How long does a Steel session last by default?

The default session timeout is 5 minutes. You can extend it with the `timeout` option on session create (for example `timeout: 600000` for 10 minutes) and set `inactivityTimeout` to release after a period of inactivity. The maximum is 15 minutes on Launch, 1 hour on Scale, and up to 24 hours on Enterprise. See [Pricing/Limits](/overview/pricinglimits).

### Can I enable proxies and CAPTCHA solving on a session?

Yes. Pass `useProxy: true` to route through Steel's residential proxy network and `solveCaptcha: true` to enable automatic CAPTCHA solving when creating the session. You can also set a custom user agent with `userAgent`. See [Pricing/Limits](/overview/pricinglimits) for access requirements and rates.
