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

# Quickstart

> Run code in a sandbox and deploy your first agent in under 10 minutes.

This quickstart takes you from zero to a running sandbox and a deployed agent. You'll install a client, authenticate, execute code in an isolated environment, and deploy a Docker image to a permanent endpoint.

## Prerequisites

* A Hexel Studio account. Sign up at [console.hexelstudio.com](https://console.hexelstudio.com).
* An API key. In the Console, go to **IAM → Service Users → Create API Key**.
* For agent deployment: a Docker image that implements the [agent contract](/docs/compute/agents#the-agent-contract).

<Tip>
  Set your API key as an environment variable so the SDKs and CLI pick it up automatically:

  ```bash theme={"dark"}
  export HEXEL_API_KEY="YOUR_API_KEY"
  ```
</Tip>

In this quickstart you will install a client, authenticate with an API key, run Python code in an isolated sandbox, and deploy a Docker image as a live agent with a permanent URL.

## 1. Install a client

<Tabs>
  <Tab title="Python">
    ```bash theme={"dark"}
    pip install hexel
    ```

    Requires Python 3.10+.
  </Tab>

  <Tab title="TypeScript">
    ```bash theme={"dark"}
    npm install hexel-sdk
    ```

    Requires Node.js 18+.
  </Tab>

  <Tab title="CLI">
    ```bash theme={"dark"}
    curl -fsSL https://hexelstudio.com/install.sh | bash
    ```
  </Tab>
</Tabs>

## 2. Authenticate

Hexel exchanges your API key for a short-lived token automatically. You only provide the key.

<Tabs>
  <Tab title="Python">
    ```python theme={"dark"}
    from hexel import Hexel

    client = Hexel(api_key="YOUR_API_KEY")
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={"dark"}
    import { Hexel } from "hexel-sdk";

    const client = new Hexel({ apiKey: "YOUR_API_KEY" });
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={"dark"}
    export HEXEL_API_KEY="YOUR_API_KEY"
    hexel auth login
    ```
  </Tab>
</Tabs>

For production services, use OAuth client credentials instead of an API key. See [Authentication](/docs/getting-started/authentication).

## 3. Run code in a sandbox

A sandbox is an isolated environment you allocate on demand to run code or shell commands. Each sandbox is single-use with a default TTL of 3600 seconds (1 hour).

<Tabs>
  <Tab title="Python">
    ```python theme={"dark"}
    sandbox = client.compute.sandbox.create(tier="standard")

    result = client.compute.sandbox.execute(
        sandbox["sandbox_id"],
        code="print('Hello from Hexel')",
        language="python",
    )
    print(result)

    client.compute.sandbox.release(sandbox["sandbox_id"])
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={"dark"}
    const sandbox = await client.compute.sandbox.create({ tier: "standard" });

    const result = await client.compute.sandbox.execute(sandbox.sandbox_id, {
      code: "print('Hello from Hexel')",
      language: "python",
    });
    console.log(result);

    await client.compute.sandbox.release(sandbox.sandbox_id);
    ```
  </Tab>

  <Tab title="CLI">
    ```bash theme={"dark"}
    hexel compute sandbox create --tier standard
    hexel compute sandbox exec YOUR_SANDBOX_ID --code "print('Hello from Hexel')"
    hexel compute sandbox release YOUR_SANDBOX_ID
    ```
  </Tab>
</Tabs>

## 4. Deploy an agent

Register a Docker image, then deploy it to receive a permanent endpoint.

<Steps>
  <Step title="Register the agent">
    <Tabs>
      <Tab title="Python">
        ```python theme={"dark"}
        agent = client.compute.agent.register(
            name="my-agent",
            image="ghcr.io/your-org/agent:v1",
            capabilities=["chat", "streaming"],
        )
        print(agent["id"])
        ```
      </Tab>

      <Tab title="CLI">
        ```bash theme={"dark"}
        hexel compute agent register \
          --name my-agent \
          --image ghcr.io/your-org/agent:v1 \
          --capabilities "chat,streaming"
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Deploy an instance">
    <Tabs>
      <Tab title="CLI">
        ```bash theme={"dark"}
        hexel compute instance deploy YOUR_AGENT_ID
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={"dark"}
        curl -X POST https://api.hexelstudio.com/compute/v1/agents/YOUR_AGENT_ID/instances \
          -H "Authorization: Bearer $TOKEN" \
          -H "Content-Type: application/json" \
          -d '{"env": {"MODEL": "gpt-4"}}'
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

The same agent and configuration always produces the same permanent endpoint, even across redeployments.

## 5. Call your agent

Your agent serves streaming and blocking endpoints at its permanent URL:

```
https://agent-<name>-<hash>.compute.hexelstudio.com
```

```bash theme={"dark"}
# Streaming (Server-Sent Events)
curl -N https://agent-my-agent-abc123.compute.hexelstudio.com/stream \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "Hello"}'

# Blocking
curl https://agent-my-agent-abc123.compute.hexelstudio.com/invoke \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "Hello"}'
```

## Next steps

<CardGroup cols={2}>
  <Card title="First Deployment" icon="server" href="/docs/getting-started/first-deployment">
    A complete walkthrough of deploying and operating an agent.
  </Card>

  <Card title="Authentication" icon="key" href="/docs/getting-started/authentication">
    API keys, OAuth clients, and token handling.
  </Card>

  <Card title="Core Concepts" icon="diagram-project" href="/docs/concepts/overview">
    Understand agents, fleets, tasks, and tools.
  </Card>

  <Card title="Orchestration" icon="sitemap" href="/docs/orchestration/overview">
    Submit multi-step tasks to agent fleets.
  </Card>
</CardGroup>
