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.
To create an agent without an API key, use the AI Gateway. See Quick start to learn more.
Before you start
To complete this guide, you need the following:
- An Astropods account. You use it to log in and to sign in to your deployed agent.
- Docker, 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 for the options.
- An API key from Anthropic or OpenAI, 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
Windows (PowerShell)
Open a new terminal and confirm the install:
For manual installs, Windows with WSL, and upgrades, see Install the CLI.
Create the 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:
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:
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 with the following command in the my-agent directory:
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 to learn more.
Store your key in the vault
The CLI prompts for the value and masks your input. The vault stores it encrypted and write-only. See Managing secrets to learn more.
Deploy with the key
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.
The command deploys the blueprint as a live agent and waits until it’s ready:
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: inspect, update, pause, and delete a deployed agent
- Monitor your agents: see traces, token usage, and latency
- Access control: choose who can use your agent
- Managing secrets: update, list, and import vault entries
- AI Gateway: use the gateway for some calls and your own key for others