> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Create with a provider key

Create an agent that calls a model provider directly with your own API key. You set the key on your machine to run the agent locally, then store it in your account's vault to deploy.

> **Note**
>
> To create an agent without an API key, use the [AI Gateway](/ai-gateway). See [Quick start](/get-started) to learn more.

## Before you start

To complete this guide, you need the following:

* An [Astropods account](/accounts). You use it to log in and to sign in to your deployed agent.
* [Docker](https://www.docker.com/products/docker-desktop/), installed and running. The CLI uses it to run your agent locally. On Windows, your agent runs in Docker containers, so Windows users also need Docker Desktop or WSL. See [running agents locally on Windows](/install-cli#running-agents-locally-on-windows) for the options.
* An API key from [Anthropic](https://console.anthropic.com/) or [OpenAI](https://platform.openai.com/), the two providers you can create an agent with directly. Your agent uses it to call the model.
* A coding agent, such as Claude Code, Cursor, or GitHub Copilot. It turns your description into a working agent.

#### Install the CLI

#### macOS / Linux

```bash
curl -fsSL https://astropods.com/install | sh
```

#### Windows (PowerShell)

```powershell
irm https://astropods.com/install.ps1 | iex
```

Open a new terminal and confirm the install:

```bash
ast --version
```

For manual installs, Windows with WSL, and upgrades, see [Install the CLI](/install-cli).

#### Log in

```bash
ast login
```

A browser opens to authorize the CLI with your Astropods account.

#### Create the agent

```bash
ast project create my-agent --model anthropic
cd my-agent
```

For OpenAI, use `--model openai`. Without `--model`, the CLI creates an Anthropic agent.

The CLI creates a `my-agent` directory with starter source code and an `astropods.yml` configuration file that lists your provider in the `models` section. When prompted, enter a description of what you want your agent to do. The CLI prints a new prompt based on your description.

Open the `my-agent` directory in your editor or terminal, start your coding agent, and paste the new prompt into it. The coding agent reviews the project, asks clarifying questions, and writes the project's source code.

#### Set your key locally

From the `my-agent` directory, run the following command:

```bash
ast project configure
```

Enter your key when the CLI asks for `ANTHROPIC_API_KEY` (or `OPENAI_API_KEY`). Astropods stores it on your machine.

#### Run the agent locally

From the `my-agent` directory, run the following command:

```bash
ast project start
```

Open `http://localhost:3100` to run and test the agent locally.

#### Publish the blueprint

When the agent runs the way you want it to, publish it as a [blueprint](/blueprints) with the following command in the `my-agent` directory:

```bash
ast blueprint push
```

The command builds your agent's container image and pushes it to the registry as a private blueprint. The first build takes a few minutes. When it finishes, the CLI prints `Pushed successfully!` and a link to the blueprint page.

The blueprint holds your agent's image and spec, not your key. See [Publish a blueprint](/blueprints) to learn more.

#### Store your key in the vault

```bash
ast secrets create ANTHROPIC_API_KEY
```

The CLI prompts for the value and masks your input. The vault stores it encrypted and write-only. See [Managing secrets](/secrets) to learn more.

#### Deploy with the key

```bash
ast blueprint deploy my-agent --var ANTHROPIC_API_KEY=@ --wait
```

The `@` shorthand resolves the value from the vault secret with the same name, so the key never appears on the command line. See [Deploy an agent](/deploy-agent).

The command deploys the blueprint as a live agent and waits until it's ready:

```text
→ Deploying blueprint my-agent as agent my-agent
  ✓ deployed into environment main  gfm-n5w-u32
```

To chat with the deployed agent, go to astropods.com and sign in. On the **Agents** page under **my-agent**, click **Launch**, then send the agent a message like "What are you?" to confirm it responds.

---

## Next steps

* [Managing your agents](/managing-agents): inspect, update, pause, and delete a deployed agent
* [Monitor your agents](/monitor-agents): see traces, token usage, and latency
* [Access control](/access-control#who-can-talk-to-an-agent): choose who can use your agent
* [Managing secrets](/secrets): update, list, and import vault entries
* [AI Gateway](/ai-gateway): use the gateway for some calls and your own key for others