Quick start: deploy your first agent
This guide will show you how to creating and deploy a new agent using the th
command line interface.
Initial setup
First, install the Toolhouse CLI:
npm i -g @toolhouseai/cli
The CLI will need a Toolhouse API key. Type th login
to automatically get one. This command will open your default browser and ask you to log into Toolhouse or create a new account, if you haven't done so already.
Note: you will only need to run this command once.
th login
Your API Key will be stored in the ~/.toolhouse
file.
Step 0: Create your th file
You can now create a Toolhouse agent file, or th file for short. A th file is a YAML file containing the setup for your agent. Type th new
to create a new agent file:
th new hello.yaml
The CLI will create a hello.yaml
file in your current folder.
Step 1: Test your agent
You can test your agent by running it via th run
.
th run hello.yaml
Running the agent will show the configuration parameters and will stream any MCP server calls and the final output. You can change the th file and run th run
again to see new results.
Once you're happy with the results, you can deploy your agent.
Step 2: Deploy your agent
You can deploy your agent by typing th deploy
. You agent will be deployed as an API with its own unique URL:
th deploy hello.yaml
You will receive a URL similar to this:
https://agents.toolhouse.ai/a1d93c2e-7013-4cea-b857-a27980a52ba2
You can simply call your agent as an HTTP POST
request, and it will stream the response using the configuration from your th file.
curl -XPOST https://agents.toolhouse.ai/a1d93c2e-7013-4cea-b857-a27980a52ba2
Last updated