Talk to your first agent

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

1curl -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.

1cartesia auth login

Verify authentication succeeded.

1cartesia auth status
3

Clone a Line template locally

Clone a simple chat template using the CLI.

1{{CREATE_COMMAND}} simple-chat-example
2# Choose "Basic Chat" when prompted by `cartesia create`.
3cd simple-chat-example
4

Initialize your agent

Link your local template to a Cartesia agent.

1cartesia init
2# Choose "Create new", and name the agent "first-agent".

You’ll see a success message with a link to your agent in the playground.

1✓ Agent 'first-agent' created successfully
2
3View agent:
4https://play.cartesia.ai/agents/agent_xxxxxxxxxxxxxxxxxx
5

Deploy your agent

Deploy your agent to make it available in the playground.

1cartesia deploy

You’ll see deployment progress with a status command to track it.

1Deploying cli-test
2
3✓ File uploaded (ID: file_xxxxxxxxxxxxxxxxxx)
4✓ Deployment created successfully!
5
6Check deployment progress:
7cartesia 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.

1cartesia 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.

1uv venv --python 3.11
2uv 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.

1export 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.

1uv run python main.py

In the second terminal, chat with your agent.

1cartesia 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
1SYSTEM_PROMPT = """\
2You are Chef Pierre, a passionate French chef from Lyon who just opened your first bistro.
3You're excited to share cooking tips and French recipes.
4Speak with warmth and enthusiasm about food.
5Keep responses to 1-2 sentences under 35 words since you're on the phone.\
6"""

Update the initial message in main.py in the handle_new_call function.

main.py
1await 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.

1cartesia 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.

1cartesia deploy
4

Check deployment status

Check that your deployment is ready and get your agent URL.

1cartesia 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

1cartesia call +1XXXXXXXXXX