Skip to main content

Documentation Index

Fetch the complete documentation index at: https://documentation.uponai.com/llms.txt

Use this file to discover all available pages before exploring further.

UponAI provides official SDKs for Node.js and Python. While you can use the REST API directly, the SDKs offer:
  • Type safety — full TypeScript support with autocomplete
  • Simplified authentication — built-in API key handling
  • Error handling — structured error responses with detailed messages
  • Reduced boilerplate — cleaner, more maintainable code

Available SDKs

Node.js / TypeScript

Package: retell-sdk on NPMRequirements: Node.js 18.10.0 or higherFeatures: Full TypeScript support, async/await, promise-based API

Python

Package: retell-sdk on PyPIRequirements: Python 3.7 or higherFeatures: Type hints, async support, comprehensive error handling

Setup

1

Get your API key

Navigate to the API Keys tab in your dashboard to obtain your API key.
2

Install the SDK

npm i retell-sdk
3

Initialize the client

import Retell from 'retell-sdk';

const client = new Retell({
  apiKey: process.env.RETELL_API_KEY,
});
4

Make your first API call

try {
  const response = await client.call.createPhoneCall({
    from_number: '+14157774444',
    to_number: '+12137774445',
  });
  console.log('Call initiated:', response);
} catch (error) {
  console.error('Error making call:', error);
}

SDK vs REST API

const options = {
  method: 'POST',
  headers: {
    Authorization: '<YOUR_API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    response_engine: {
      type: 'retell-llm',
      llm_id: 'llm_234sdertfsdsfsdf'
    },
    agent_name: 'Jarvis',
    voice_id: '11labs-Adrian',
  })
};

fetch('https://api.retellai.com/create-agent', options)
  .then(r => r.json())
  .then(console.log);

Best Practices

Error handling — always wrap SDK calls in try/catch:
try {
  const response = await client.call.createPhoneCall(params);
} catch (error) {
  if (error.code === 'insufficient_funds') {
    // handle specific error
  }
}
Environment variables — never hardcode API keys:
const client = new Retell({ apiKey: process.env.RETELL_API_KEY });
TypeScript types — use provided types for autocomplete:
import { Retell, AgentCreateParams } from 'retell-sdk';

const params: AgentCreateParams = {
  // TypeScript will autocomplete available fields
};