> ## 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

> Build and run your first Agent in minutes

In this quickstart, you'll create a simple Agent, run it locally, and then build and deploy a powerful AI agent to the cloud.

<Info>
  **Prerequisites:**

  * Python 3.9 or higher (3.10+ recommended for deployment)
  * Docker (Required for local runtime) - [Install Docker](https://www.docker.com/)
</Info>

## Step 1: Install Cycls

Install Cycls SDK:

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

## Step 2: Create a Simple Agent

Create a file named `app.py` with the following code. This creates a simple agent that replies with a static message.

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

@cycls.app()
async def app(context):
    yield "Hello, World!"

app.local()
```

## Step 3: Run your Agent

<Note>
  Make sure Docker Desktop is running before starting your agent.
</Note>

Run the file from your terminal:

```bash theme={null}
python app.py
```

This will start a local development server with hot-reload. Open `http://localhost:8080` to see your agent in action.

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/cycls/wIEcbOXtHHM9MyJs/img/hi.mp4?fit=max&auto=format&n=wIEcbOXtHHM9MyJs&q=85&s=85b5ffb8b59b26f72a4782256c3a1280" data-path="img/hi.mp4" />

<Check>
  **Success!** You've created and run your first Agent locally.
</Check>

***

## Next: Cloud Deployment (OpenAI Agent)

Now let's build a simple AI agent powered by OpenAI LLMs and deploy it to the cloud.

<Steps>
  <Step title="Get Your Keys">
    1. Get your [Cycls API Key](https://cycls.com/auth/sign-in).
    2. Get your [OpenAI API Key](https://openai.com/api/).
    3. Create a `.env` file in your project root:

    ```bash .env theme={null}
    CYCLS_API_KEY=your-cycls-key
    OPENAI_API_KEY=sk-your-openai-key
    ```

    <Note>
      You can use any model of your choice, such as OpenAI, Anthropic, or Gemini, etc.
    </Note>
  </Step>

  <Step title="Write the Agent">
    Update `app.py` with this complete code:

    ```python app.py theme={null}
    import cycls
    import os

    # Set your Cycls API key for deployment
    cycls.api_key = os.getenv("CYCLS_API_KEY")

    @cycls.app(pip=["openai"], copy=[".env"], auth=True)
    async def app(context):
        from openai import AsyncOpenAI

        client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY"))
        response = await client.chat.completions.create(
            model="gpt-4o-mini",
            messages=context.messages,
            stream=True
        )
        async for chunk in response:
            content = chunk.choices[0].delta.content
            if content:
                yield content

    # Deploy to cloud
    app.deploy()
    ```

    <Tip>
      **Pro Tip:** Notice how we import `openai` inside the function? This ensures the package is loaded only when needed inside the container. Cycls automatically loads your `.env` file—no extra packages needed.
    </Tip>
  </Step>

  <Step title="Deploy">
    Run the script to deploy:

    ```bash theme={null}
    python app.py
    ```

    You will see the deployment logs and your public URL:

    ```bash theme={null}
    🚀 Deploying...
    ✅ Deployment successful!
    🔗 Service is available at: https://app.cycls.ai
    ```
  </Step>
</Steps>

## Next Steps

<Card title="Configure Your Agent" horizontal href="/core-concepts/agent">
  Explore configuration options like dependencies, secrets, and custom UI.
</Card>

<Card title="Work with Context" horizontal href="/core-concepts/context">
  Learn how to use context to store user data and conversation history.
</Card>

<Card title="Customize UI" horizontal href="/core-concepts/agent-ui">
  Tailor the chat interface to match your brand.
</Card>
