Skip to main content
Create a new voice agent, deploy it and talk to it in under 5 minutes. Then, learn how to make a quick change to customize an agent.

Already created an agent in the Playground?

Other guides might be a better starting point for you.
  • If you used Text to Agent, try this quickstart.
  • If you used Build From a Template, try this quickstart.

Deploy and call your first agent

Prerequisites

  • A free Cartesia account, sign up here.
  • Access to a terminal on your local machine.
1

Install the CLI

curl -fsSL https://cartesia.sh | sh
2

Connect to Cartesia

Authenticate with your Cartesia account. This will prompt you to add an API key from your playground.
cartesia auth login
Verify authentication succeeded.
cartesia auth status
3

Clone a Line template locally

Clone a simple chat template using the CLI.
cartesia create simple-chat-example
# Choose "Basic Chat" when prompted by `cartesia create`.
cd simple-chat-example
4

Initialize your agent

Link your local template to a Cartesia agent.
cartesia init
# Choose "Create new", and name the agent "first-agent".
You’ll see a success message with a link to your agent in the playground.
 Agent 'first-agent' created successfully

View agent:
https://play.cartesia.ai/agents/agent_xxxxxxxxxxxxxxxxxx
5

Deploy your agent

Deploy your agent to make it available in the playground.
cartesia deploy
You’ll see deployment progress with a status command to track it.
Deploying cli-test

 File uploaded (ID: file_xxxxxxxxxxxxxxxxxx)
 Deployment created successfully!

Check deployment progress:
cartesia status ad_xxxxxxxxxxxxxxxxxx
6

Talk to your agent

Your agent should deploy in < 1 minute. Use the CLI to have your agent call your phone number.
cartesia call +1XXXXXXXXXX
Or visit the Playground to call your agent from the web interface.
This first agent should only give you canned responses. Next, we’ll enable it to give intelligent responses.

Setup local agent development

Now let’s set up your local environment to iterate on your agent.

Additional Prerequisites

  • Python 3.9+ installed on your machine.
  • A Gemini API key (recommended for intelligent responses).(optional)
1

Install dependencies

Choose your preferred Python package manager.
uv venv --python 3.11
uv pip install .
2

(Optional) Setup your LLM API key

Set your Gemini API key to connect a language model.
Line supports integrations with any LLM provider of your choice.
export GEMINI_API_KEY=YOUR_GEMINI_KEY
If you choose to skip this step, your agent will continue to give canned answers.
3

Chat locally with your template

Open two terminals. In the first, start the server.
uv run python main.py
In the second terminal, chat with your agent.
cartesia chat 8000
Chat with your agent.
This is a nifty way to test your agent’s reasoning and responses locally.

Customize and redeploy your agent

Let’s customize your agent’s personality and voice to make it truly unique.
1

Customize your agent

Open config.py and modify SYSTEM_PROMPT to set your agent’s personality.
config.py
SYSTEM_PROMPT = """\
You are Chef Pierre, a passionate French chef from Lyon who just opened your first bistro. 
You're excited to share cooking tips and French recipes. 
Speak with warmth and enthusiasm about food. 
Keep responses to 1-2 sentences under 35 words since you're on the phone.\
"""
Update the initial message in main.py in the handle_new_call function.
main.py
await system.send_initial_message("Bonjour! I'm Chef Pierre.")
2

(Optional) Set remote environment variables

If you set a Gemini API key earlier, make it available to your deployed agent. Your prompt change will have no effect without this key.
Make sure to run this command in the same terminal where you previously set the GEMINI_API_KEY environment variable.
cartesia env set GEMINI_API_KEY=$GEMINI_API_KEY
3

Redeploy your changes

Verify that you’re in the simple-chat-example folder and redeploy your changes.
cartesia deploy
4

Check deployment status

Check that your deployment is ready and get your agent URL.
cartesia status
Visit your agent page in the Playground using the URL from the status command.
5

Update voice in the Playground

On your agent page, go to Configuration. Change the voice to “Stern French Man” to match your chef personality.
Update voice in the Configuration tab on the Playground.
6

Call your custom agent

cartesia call +1XXXXXXXXXX