Reusable Agent Configurations
Reusable Agent Configurations allow you to define and persist the agent block of your Settings message using the Deepgram API. Once created, you receive a UUID that can be passed in place of the full agent object—simplifying your client code and enabling consistent agent behavior across sessions.
Reusable Agent Configurations are managed via the API. UI support is not yet available.
Overview
When using the Voice Agent API, you typically send a full agent configuration object inside every Settings message. With Reusable Agent Configurations, you can:
- Store a reusable
agentblock using the Console API and receive a unique UUID. - Reference that UUID in your
Settingsmessage instead of repeating the full configuration. - Use template variables to define reusable values that can be shared across multiple agent configurations.
All agent configurations and template variables are visible to every member of your Deepgram project—including members, admins, and owners. Do not store secrets such as API keys or passwords in agent configurations or template variables.
Common use cases
- Per-customer configurations — Platforms that resell agent functionality can give each customer a distinct voice, persona, or model without maintaining separate codebases.
- Regional and regulatory compliance — Maintain separate configurations for different markets (for example, EU vs. US) to enforce data-handling, language, or disclosure requirements without code branching.
- A/B testing voices or prompts — Run two configurations in parallel and measure conversion, CSAT, or containment rate to pick a winner—no code deploy required.
- Multi-agent architectures — Store and manage all of the agents used in your multi-agent architecture from a single project.
Using a reusable agent configuration
Once you’ve created an agent configuration (see Create an Agent Configuration below), pass its UUID as the value of the agent field in your Settings message:
Deepgram will look up the reusable configuration by UUID, interpolate any template variables, and apply the resulting agent block to your session.
Agent Configuration API
The base URL for all Agent Configuration endpoints is:
Create an Agent Configuration
Request body:
Example request:
Response:
The returned agent_id is the UUID you’ll pass in place of the agent block in future Settings messages.
List Agent Configurations
Returns all agent configurations for the specified project. Configurations are returned in their uninterpolated form—template variable placeholders will appear as-is rather than with their substituted values.
Example request:
Get an Agent Configuration
Returns the specified agent configuration in its uninterpolated form.
Example request:
Update Agent Metadata
Updates the metadata associated with an agent configuration. The config itself is immutable—to change the configuration, delete the existing agent and create a new one.
Request body:
Example request:
Delete an Agent Configuration
Deletes the specified agent configuration.
Deleting an agent configuration can cause a production outage if your service references this agent UUID. Migrate all active sessions to a new configuration before deleting.
Example request:
Template Variables
Template variables let you define reusable values that can be referenced across agent configurations. When an agent configuration is used in a Settings message, Deepgram automatically interpolates the variable values before applying the configuration.
Template variable values are stored as plain text and are visible to all members, admins, and owners of your Deepgram project. Do not store secrets such as API keys or passwords in template variables.
Template variables follow the format DG_<VARIABLE_NAME>, where <VARIABLE_NAME> must consist of uppercase alphanumeric characters, underscores, or hyphens (e.g., DG_MY_MODEL, DG_DEFAULT_LANGUAGE).
Using Template Variables in a Configuration
Template variables can substitute any JSON value—a string, number, boolean, or even an entire object. For example:
In this example, DG_LISTEN_MODEL, DG_THINK_MODEL, and DG_SPEAK_PROVIDER are all template variables. DG_SPEAK_PROVIDER resolves to an entire provider object, while the others resolve to strings.
Agent Variable API
List Agent Variables
Create an Agent Variable
Request body:
Example request:
Get an Agent Variable
Update an Agent Variable
Request body:
Delete an Agent Variable
Full Example
The following example walks through creating an agent configuration with template variables and using it in a Voice Agent session.
Step 1: Create a template variable
Step 2: Create an agent configuration referencing the variable
This returns an agent_id, for example: a1b2c3d4-e5f6-7890-abcd-ef1234567890.
Step 3: Use the UUID in your Settings message
Deepgram resolves the UUID to the reusable configuration, substitutes DG_SYSTEM_PROMPT with its value, and applies the fully resolved agent block to your session.
Next Steps
- Configure the Voice Agent — see all available
agentconfiguration options. - Voice Agent Settings — learn about the full
Settingsmessage format. - Voice Agent Message Flow — understand the correct message flow for building a Voice Agent client.