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

# Run your first Cloud query

> Set up your account, connect to managed AI compute, and run a query with Python.

Connect to fully managed AI compute with the same Python API and SQL you use locally. Your application keeps SQL planning, relational execution, and result caching.

## 1. Create your API token

[Sign up](https://chowder.ai/signup), then open [**Billing**](https://chowder.ai/dashboard/billing) and select **Upgrade to Pro**. After checkout, open [**API tokens**](https://chowder.ai/dashboard/tokens) and select **Create API token**. If Cloud is at capacity, the dashboard tells you; check back later.

Copy the token when it is shown and store it securely. The dashboard does not display the full token again. Keep it out of source code and notebooks you share.

## 2. Install Chowder

Install Chowder with [uv](https://docs.astral.sh/uv/).

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
uv pip install chowder
```

The examples below use Polars to materialize results and a Python notebook for rich display. For a terminal script, use `print(result)` instead of `chowder.display(result)`. See [Installation](https://docs.chowder.ai/installation.md) for environment setup and other install options.

## 3. Choose a query

Choose an example from the [Quickstart](https://docs.chowder.ai/quickstart.md). Copy its `SQL` assignment into your notebook or script. You can use the same SQL with local or Cloud compute.

## 4. Connect and run

Use environment variables for the shortest path with `chowder.sql()`. Use an explicit engine when you want to control its configuration and lifetime. Both connect to the same Cloud service.

Copy the `CHOWDER_API_URL` value from Step 2 under **Get started** on your [Chowder Cloud dashboard](https://chowder.ai/dashboard). Replace `your-api-url` and `your-api-token` with that URL and the API token you created.

> [tab] Environment variables
>
> Set these variables before Chowder creates the default engine. If you set them in a terminal, do so before launching your script or notebook from that terminal.
>
> ```bash theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
> export CHOWDER_REMOTE=1
> export CHOWDER_API_URL="your-api-url"
> export CHOWDER_API_TOKEN="your-api-token"
> ```
>
> Run your chosen `SQL`:
>
> ```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
> import chowder
>
> relation = chowder.sql(SQL)
> result = relation.to_polars()
>
> chowder.display(result)
> ```
>
> Chowder creates the default engine on first use, including a call to `chowder.default_engine()`, and reuses it for `chowder.sql()`. If Chowder already created the engine in this session, finish or cancel its work and call `chowder.close()` before running your query. You can also restart your notebook kernel and set the variables again. Call `chowder.close()` when you finish using the default engine.

> [tab] Explicit engine
>
> Set the endpoint and your API token before launching your script or notebook.
>
> ```bash theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
> export CHOWDER_API_URL="your-api-url"
> export CHOWDER_API_TOKEN="your-api-token"
> ```
>
> Select remote compute explicitly:
>
> ```python theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
> import chowder
>
> engine = chowder.Engine(remote=True)
>
> relation = engine.sql(SQL)
> result = relation.to_polars()
>
> chowder.display(result)
>
> engine.close()
> ```
>
> `remote=True` opts this engine into remote compute without requiring `CHOWDER_REMOTE`. `engine.close()` releases the engine after the result is materialized. Use `remote=False` to keep a separate engine local even when the environment enables remote compute.

## 5. Inspect the result and usage

`result` is a Polars DataFrame containing the columns selected by your query. In a notebook, [`chowder.display(result)`](https://docs.chowder.ai/reference/python-api#inspect-query-results-in-a-notebook) renders nested structs, arrays, and supported image columns. Inspect the results before increasing your workload. Model predictions can vary.

Supported AI processing runs on Cloud compute. The first request may wait for GPU startup; subsequent compatible AI results can be reused from the client cache.

Open [**Usage**](https://chowder.ai/dashboard/usage) to inspect credits consumed, and [**Billing**](https://chowder.ai/dashboard/billing) for your balance. See [Usage and limits](https://docs.chowder.ai/cloud/usage.md) for what gets metered.

## Next steps

Try another quickstart example or query your own sources. Start with a small workload and check output quality and usage before increasing it.

> [card] [Query your data](https://docs.chowder.ai/guides/data-sources.md)
>
> Connect to local files, Hugging Face, S3, HTTP, or your own cloud mirrors.

> [card] [Explore query examples](https://docs.chowder.ai/quickstart.md)
>
> Choose a document, text, image, video, audio, or MCAP example.

> [card] [Size your workload](https://docs.chowder.ai/guides/token-profiling.md)
>
> Count rows and tokens before expanding a text inference job.

> [card] [Understand credits and limits](https://docs.chowder.ai/cloud/usage.md)
>
> Learn what gets metered and how to interpret capacity and plan limits.


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