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

# Quickstart

> Install Cycls, run an agent on your machine, then deploy it to a public URL.

> [!NOTE]
>
> **Before you start**
>
> * Python 3.10 or newer
> * [Docker](https://www.docker.com/) running, for local runs and builds
> * A [Cycls API key](https://cloud.cycls.com) for deploying
> * A model key, for example `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`

<video autoPlay muted loop playsInline alt="Writing an agent file, then running cycls deploy and getting a live URL" aria-label="Writing an agent file, then running cycls deploy and getting a live URL" src="https://mintcdn.com/cycls/Vjgw_hSP7-Pr95Zb/img/deploy.mp4?fit=max&auto=format&n=Vjgw_hSP7-Pr95Zb&q=85&s=5fc6ee772f131f0ed0d9c96c441bc8ca" />

What the five minutes below look like: one file, one command, a live URL.

**1. Install the SDK**

```bash theme={null}
pip install cycls
```

Check it:

```bash theme={null}
cycls version
```

**2. Set your keys**

Cycls reads a `.env` file from the working directory automatically.

```bash .env theme={null}
CYCLS_API_KEY=your_cycls_key
ANTHROPIC_API_KEY=sk-ant-your_key
```

> [!TIP]
>
> Keep two files. `.env` holds keys that stay on your machine, such as
> `CYCLS_API_KEY`. `.providers.env` holds keys the container needs, such as
> `ANTHROPIC_API_KEY`. Ship only the second one with
> `cycls.Image().copy(".providers.env", ".env")`.

**3. Scaffold an agent**

```bash theme={null}
cycls init my_agent
```

This writes `my_agent.py`:

```python my_agent.py theme={null}
import cycls

image = cycls.Image()

chats = cycls.Volume("my-agent-chats")

web = (
    cycls.Web()
    .auth(cycls.Clerk())
    .title("my_agent")
)

llm = (
    cycls.LLM()
    .model("anthropic/claude-sonnet-4-6")
    .system("You are a helpful assistant.")
)


@cycls.agent(image=image, web=web, volumes={"/workspace": chats})
async def my_agent(context):
    async for ev in llm.run(context=context):
        yield ev
```

Four declarations and one function body. The `image` describes the container,
the `volume` holds chat state, `web` configures the interface, and `llm`
configures the model. The body receives a `context` and yields events.

**4. Run it locally**

```bash theme={null}
cycls run my_agent.py
```

Cycls builds the image, starts the container and serves on
`http://localhost:8080`. Every save rebuilds and reloads. The first build takes
a minute or two, later ones are cached.

**5. Deploy it**

```bash theme={null}
cycls deploy my_agent.py
#   [BUILDING]  ...
#   [DEPLOYING] ...
#   [DONE]      https://my-agent.cycls.ai
```

The build happens in the cloud, not on your laptop. The deployment name comes
from the function name, and redeploying the same name updates it in place.

## Give it tools

The managed loop ships with built-in tools. Enabling one is a single call, and
each tool brings its own prompt guidance.

```python theme={null}
llm = (
    cycls.LLM()
    .model("anthropic/claude-sonnet-4-6")
    .system("You are a research assistant. Show your work.")
    .allowed_tools(["Bash", "Editor", "WebSearch", "Canvas"])
)
```

Now the agent can search the web, write files into the user's workspace, run
shell commands in a sandbox, and open results on the canvas. See
[Tools](https://docs.cycls.com/agents/tools.md) for the full set.

## Talk to it over HTTP

Every agent serves an OpenAI-compatible endpoint, so existing clients work
without changes.

```bash cURL theme={null}
curl https://my-agent.cycls.ai/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello"}], "stream": true}'
```

```python OpenAI SDK theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://my-agent.cycls.ai", api_key="unused")

stream = client.chat.completions.create(
    model="my-agent",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

## Next steps

> [card] [Core concepts](https://docs.cycls.com/get-started/concepts.md)
>
> Run, remote and deploy, and when to use each layer.

> [card] [Build an agent](https://docs.cycls.com/agents/overview.md)
>
> The loop, the context object, and what the body yields.

> [card] [Local and remote builds](https://docs.cycls.com/ship/builds.md)
>
> What happens on your machine and what happens in the cloud.

> [card] [Guides](https://docs.cycls.com/guides/first-agent.md)
>
> End-to-end examples you can copy.


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