Skip to content

DeepgramAgentConfig

Top-level configuration for the Deepgram Agent API provider.

Defined in: src/providers/agent/deepgram/types.ts:536

Top-level configuration for the Deepgram Agent API provider.

Remarks

This interface maps to the Settings WebSocket message defined in the Deepgram Agent V1 AsyncAPI spec. It extends BaseProviderConfig so apiKey, proxyUrl, and other base fields are also available.

Example

const config: DeepgramAgentConfig = {
  apiKey: process.env.DEEPGRAM_API_KEY,
  audio: {
    input:  { encoding: 'linear16', sample_rate: 16000 },
    output: { encoding: 'linear16', sample_rate: 24000, container: 'none' },
  },
  listen: {
    provider: { type: 'deepgram', model: 'nova-3', language: 'en' },
  },
  think: {
    provider: { type: 'open_ai', model: 'gpt-4o-mini' },
    prompt: 'You are a helpful assistant.',
    functions: [
      { name: 'get_weather', description: 'Get current weather', parameters: { ... } },
    ],
  },
  speak: {
    provider: { type: 'deepgram', model: 'aura-2-thalia-en' },
  },
  greeting: 'Hello! How can I help you today?',
};

Extends

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
apiKey?string | () => Promise<string>undefinedAPI key or authentication token for the provider. Remarks Can be a static string or an async factory function that returns a fresh token on each call. Use a factory for short-lived tokens (e.g. Deepgram JWTs) so each WebSocket connection gets a valid credential. For client-side usage, consider using a proxy server to keep API keys secure. The SDK provides Express, Next.js, and Node adapters for this purpose.BaseProviderConfig.apiKeysrc/core/types/providers.ts:71
audio?AgentAudioConfigundefinedAudio encoding/sample rate for input and output.-src/providers/agent/deepgram/types.ts:538
authType?"token" | "bearer"Provider-specific (typically 'token' for Deepgram, ignored for REST providers)Authentication type for providers that support multiple auth mechanisms. Remarks Controls how the apiKey is sent to the provider: - 'token' — WebSocket subprotocol ['token', apiKey] or header Authorization: Token <key>. This is the default for Deepgram providers. - 'bearer' — WebSocket subprotocol ['bearer', token] or header Authorization: Bearer <token>. Use this for OAuth tokens or providers that expect Bearer auth. REST/SDK providers (Anthropic, OpenAI) handle auth through their SDK constructors and ignore this field.BaseProviderConfig.authTypesrc/core/types/providers.ts:115
context?{ messages?: { content: string; role: "user" | "assistant"; }[]; }undefinedPre-seed conversation context.-src/providers/agent/deepgram/types.ts:553
context.messages?{ content: string; role: "user" | "assistant"; }[]undefined--src/providers/agent/deepgram/types.ts:554
debug?booleanfalseWhether to enable debug logging for this provider. Remarks When true, the provider emits detailed internal logs. This is separate from the SDK-level LoggingConfig.BaseProviderConfig.debugsrc/core/types/providers.ts:126
endpoint?stringundefinedCustom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments.BaseProviderConfig.endpointsrc/core/types/providers.ts:79
experimental?booleanundefinedEnable experimental Agent API features (e.g. AgentStartedSpeaking).-src/providers/agent/deepgram/types.ts:561
greeting?stringundefinedGreeting message the agent speaks when the session starts.-src/providers/agent/deepgram/types.ts:550
listen?AgentListenConfigundefinedSTT configuration (Deepgram Nova/Flux).-src/providers/agent/deepgram/types.ts:541
onFunctionCall?(call) => Promise<{ content: string; }>undefinedClient-side function call handler. Remarks Called when the Agent API requests execution of a client-side function. Return the result content as a string.-src/providers/agent/deepgram/types.ts:570
proxyUrl?stringundefinedURL of a CompositeVoice proxy server endpoint for this provider. Remarks When set, requests are routed through the proxy which injects the real API key server-side. This keeps API keys out of the browser. For WebSocket providers the HTTP URL is automatically converted to ws(s)://. At least one of apiKey or proxyUrl must be set for providers that require authentication (all except NativeSTT, NativeTTS, and WebLLM). Example proxyUrl: 'http://localhost:3000/api/proxy/deepgram'BaseProviderConfig.proxyUrlsrc/core/types/providers.ts:97
speak?AgentSpeakConfigundefinedTTS configuration (provider, voice).-src/providers/agent/deepgram/types.ts:547
think?AgentThinkConfigundefinedLLM configuration (provider, prompt, functions).-src/providers/agent/deepgram/types.ts:544
timeout?numberundefinedRequest timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout.BaseProviderConfig.timeoutsrc/core/types/providers.ts:135

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency