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

# SDK Quickstart

> Get started with the TypeScript SDK in 5 minutes

## Install

```bash theme={null}
bun add buntime.sh
```

## Initialize

```typescript theme={null}
import { Buntime } from 'buntime.sh';

const client = new Buntime({
  apiKey: process.env.BUNTIME_API_KEY
});
```

## Create a Session

```typescript theme={null}
const session = await client.sessions.create();
console.log('Session ID:', session.id);
```

## Execute Code

```typescript theme={null}
const result = await client.execute({
  sessionId: session.id,
  code: `
    const sum = [1, 2, 3, 4, 5].reduce((a, b) => a + b, 0);
    console.log('Sum:', sum);
  `
});

console.log(result.stdout); // "Sum: 15"
```

## Work with Files

```typescript theme={null}
await client.files.write({
  sessionId: session.id,
  path: 'hello.ts',
  content: 'export const greet = (name: string) => `Hello, ${name}!`;'
});

const result = await client.execute({
  sessionId: session.id,
  code: 'import { greet } from "./hello"; console.log(greet("World"));'
});
```

## Clean Up

```typescript theme={null}
await client.sessions.delete({ sessionId: session.id });
```

## Next Steps

See the [full SDK introduction](/sdk/introduction) for complete examples and best practices.
