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

# Quickstart

## Deploy a Simple Web Endpoint

To run your code in the cloud, you just add a decorator. That’s it.

Let's write a simple function that finds the square of 256.

We include numpy in the container image to show how you can easily add Python packages to your containers.

* `Image()` defines your container environment. You can add Python packages, system dependencies, or even custom Dockerfiles.

* `@endpoint` turns your function into a real, live web API that runs in the
  cloud.

```python theme={null}
from beam import endpoint, Image


@endpoint(
    name="quickstart",
    cpu=1,
    memory="1Gi",
    image=Image().add_python_packages(["numpy"]),
)
def predict(**inputs):
    x = inputs.get("x", 256)
    return {"result": x**2}
```

Save this code to a file on your computer. You can name the file whatever you want, but we'll call it `app.py` for this example.

### Deployment

With the `app.py` file saved on your computer, you can deploy this to the cloud using this command:

```sh theme={null}
beam deploy app.py:predict
```

### Call the API

After running `beam deploy`, a cURL command will print in your shell. You can use this command to invoke the API.

Make sure to replace `[TOKEN]` with your actual token.

```sh theme={null}
curl -X POST 'https://app.beam.cloud/endpoint/quickstart' \
  -H 'Authorization: Bearer [TOKEN]' \
  -H 'Content-Type: application/json' \
  -d '{"x": 12}'
```

The container spins up in seconds, runs your code, and shuts itself down.

No idle costs. No infrastructure to cleanup.

## What Next?

Here are some other things you can try:

* [Customize your container image](/v2/environment/custom-images)
* [Add a GPU to your app](/v2/environment/gpu)
* [Run a scheduled job](/v2/function/scheduled-job)
* [Parallelize a function across 10 containers](/v2/scaling/parallelizing-functions)
