TypeScript SDK
The @omnidim-ai/sdk package. A typed, server-side SDK for the OmniDimension API.
@omnidim-ai/sdk is the server-side SDK for the OmniDimension REST API.
Fully typed, and works in plain JavaScript too.
Run it on your backend with a secret API key. For a browser experience, use the web widget.
Installation
npm install @omnidim-ai/sdkRequires Node.js 20 or later. Package details and version history live at npmjs.com/package/@omnidim-ai/sdk.
Initialization
Get an API key by following Authentication, then create a client:
import OmniDimension from '@omnidim-ai/sdk';
const client = new OmniDimension({ apiKey: process.env.OMNIDIM_API_KEY! });
const agents = await client.agents.list({ pagesize: 10 });Using plain JavaScript? Drop the ! and the rest is identical:
const client = new OmniDimension({ apiKey: process.env.OMNIDIM_API_KEY });Client structure
client.agents // Agent operations
client.calls // Call dispatch and logs
client.bulkCalls // Bulk-call campaigns
client.knowledgeBase // Knowledge base files
client.phoneNumbers // Phone numbers
client.providers // LLM, voice, STT, TTS providers
client.integrations // Integrations and agent attachment
client.reseller // Partner operations (partner credentials required)Agents
Create, retrieve, update, and delete AI voice agents.
Calls
Dispatch calls and read call logs and transcripts.
Knowledge base
Upload, attach, and manage knowledge base files.
Phone numbers
List, attach, and import phone numbers.
Error handling
Non-2xx responses and network failures throw OmniDimensionError:
import OmniDimension, { OmniDimensionError } from '@omnidim-ai/sdk';
const client = new OmniDimension({ apiKey: process.env.OMNIDIM_API_KEY! });
try {
await client.agents.get(999);
} catch (err) {
if (err instanceof OmniDimensionError) {
console.error(err.status, err.message, err.body);
}
}status is the HTTP status code (0 for network or timeout errors).
body is the parsed error payload when present.
Types
Schema types are exported for use in your own code:
import type { Agent, Call, Voice } from '@omnidim-ai/sdk';Client options
interface ClientOptions {
// Your OmniDimension API key. Required.
apiKey: string;
// Override the API base URL. Defaults to production.
baseURL?: string;
// Per-request timeout in milliseconds. Defaults to 60000.
timeout?: number;
// Custom fetch implementation. Defaults to the global fetch.
fetch?: typeof fetch;
// Headers added to every request.
defaultHeaders?: Record<string, string>;
}