For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Cartesia Integration for TestMu AI Agent Testing

The Cartesia integration connects a Cartesia Managed Agent to a Phone Caller agent in the TestMu AI Agent Testing Platform. TestMu AI imports the agent's prompt and tools, and after every test call it checks which tools the agent actually called, the same way as for other voice providers.

Without the integration, TestMu AI still tests any Cartesia agent that answers a phone number, with transcripts, recordings, grading, and call quality metrics. Connect it when you also want the prompt imported and the tool calls checked.

Integration at a Glance​


ItemDetails
Agent typePhone Caller, inbound. TestMu AI calls your Cartesia agent's phone number.
Where you connectThe agent's Integrations tab, on the Cartesia card.
What you needA Cartesia API key and the managed agent's ID.
What is importedThe agent's prompt and tools.
What is checkedWhether the agent called each tool a scenario expects, with the arguments and result of every call.
Supported agentsCartesia Managed Agents. Agents built with the Line SDK are not supported.

Prerequisites​


In Cartesia​

  • A Cartesia Managed Agent with a phone number it answers on.
  • A Cartesia API key, created in the Cartesia Playground, and the managed agent's ID.

In TestMu AI​

  • A Phone Caller agent with the call type Inbound (Bot receives calls), with the Cartesia agent's phone number added on its Phone Numbers tab. See Test an Inbound Phone Agent.
note

Agents built with the Cartesia Line SDK are self-hosted and don't expose their prompt or tools, so they can't be connected. You can still test them as a phone caller agent without the integration, with transcripts, recordings, grading, and call quality metrics, but without the prompt import or tool call checks.

warning

API keys are secrets. Enter them only in the integration form, never in a scenario, prompt, test data file, or source code.

Connect Cartesia​


  1. Open the Phone Caller agent and select Integrations.
  2. Select Connect on the Cartesia card.
Cartesia Integration Settings panel open over the Integrations tab, with the Cartesia API Key and Cartesia Agent ID fields and the Save button
  1. Fill in the fields, then select Save. TestMu AI imports the agent's prompt and tools.
FieldWhat to enter
Cartesia API KeyA key created in the Cartesia Playground. Cartesia keys start with sk_car_, so a value with another prefix is the wrong key.
Cartesia Agent IDThe ID of the managed agent you want to test. It starts with agent_.

TestMu AI stores the credentials as HyperExecute secrets, scoped to this agent. One provider can be connected per agent, so use a separate TestMu AI agent to test another Cartesia agent or provider.

Check the Prompt and Tools​


Open the Prompt tab to check the imported prompt, then generate your scenarios from it. The imported tools appear in the scenario editor.

After you change the agent in Cartesia, select Re-sync on the Cartesia card so the prompt and tools match what is deployed.

Select the Expected Tools for Each Scenario​


Open a scenario and, in the scenario editor, select each tool from the imported catalog that the scenario expects the agent to call.

Example scenarioExpected tools
Bookingcheck_availability, book_appointment
Cancellationcancel_appointment
  • Select only the tools the scenario must check. The tool check passes only if the agent called all of them.
  • Scenarios with no tools selected still run, without a tool check.
  • If the agent's tools change, select Re-sync and review the tools selected on each scenario.

Run a Test and Read the Tool Calls​


Start with one short scenario and one expected tool in a small suite, to confirm that the right agent answers and the tool check works. Then run your suites as for any inbound phone agent.

Open a call and select the Tool Calls tab.

SectionWhat it shows
Expected Tool ValidationEach tool selected on the scenario, marked Called or Not Called.
Selected AUT Tool CallsEach call the agent made to a selected tool, with its status, arguments, and result.
AUT Tool CallsEvery tool the agent called, including tools you didn't select, so unexpected calls are visible.
  • Read the transcript and the tool calls together. If the agent says it booked or transferred while the tool shows Not Called, it claimed an action it didn't take.
  • A tool that ran but returned an error still shows Called, so check the result of each call.
  • Not Called can be the right outcome, for example when the caller never gave the agent the details it needed.

Troubleshooting​


ProblemWhat to do
The API key is rejectedCheck that the key starts with sk_car_. If it does, create a new one in the Cartesia Playground and save it again.
The agent isn't foundCheck that the ID starts with agent_, belongs to a managed agent, and was copied in full. Line SDK agents can't be connected.
The wrong agent answersCheck the saved agent ID and the number on the Phone Numbers tab, then run the short test again.
No tools appear in the scenario editorConfirm the agent has tools in Cartesia, then select Re-sync.
A call shows no expected tools mappedThe scenario has no tools selected, so only the call itself was graded. Select its expected tools.
A key may have been exposedRotate it in Cartesia and save the new key.

Security and Credentials​


  • Saved credentials are stored as HyperExecute secrets, scoped to the agent where you save them.
  • TestMu AI uses them to read the agent's configuration and check its tool calls during your test calls.
  • Use separate keys for test and production, rotate them on your usual schedule, and disconnect the integration when you no longer need it.

Other Integrations​


Help and Support

Related Articles