const model = api.runtime.agent.defaults.model; // e.g. "anthropic/claude-sonnet-4-6"const provider = api.runtime.agent.defaults.provider; // e.g. "anthropic"
Model overrides (provider/model) require operator opt-in via
plugins.entries.<id>.subagent.allowModelOverride: true in config.
Untrusted plugins can still run subagents, but override requests are rejected.
api.runtime.tts
Text-to-speech synthesis.
// Standard TTSconst clip = await api.runtime.tts.textToSpeech({ text: "Hello from Agdi", cfg: api.config,});// Telephony-optimized TTSconst telephonyClip = await api.runtime.tts.textToSpeechTelephony({ text: "Hello from Agdi", cfg: api.config,});// List available voicesconst voices = await api.runtime.tts.listVoices({ provider: "elevenlabs", cfg: api.config,});
Channel-specific runtime helpers (available when a channel plugin is loaded).
Storing runtime references
Use createPluginRuntimeStore to store the runtime reference for use outside
the register callback:
import { createPluginRuntimeStore } from "agdi/plugin-sdk/runtime-store";import type { PluginRuntime } from "agdi/plugin-sdk/runtime-store";const store = createPluginRuntimeStore<PluginRuntime>("my-plugin runtime not initialized");// In your entry pointexport default defineChannelPluginEntry({ id: "my-plugin", name: "My Plugin", description: "Example", plugin: myPlugin, setRuntime: store.setRuntime,});// In other filesexport function getRuntime() { return store.getRuntime(); // throws if not initialized}export function tryGetRuntime() { return store.tryGetRuntime(); // returns null if not initialized}
Other top-level api fields
Beyond api.runtime, the API object also provides:
Field
Type
Description
api.id
string
Plugin id
api.name
string
Plugin display name
api.config
AgdiConfig
Current config snapshot
api.pluginConfig
Record<string, unknown>
Plugin-specific config from plugins.entries.<id>.config