@retell-ai/mcp-server 5.11.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/auth.d.mts.map +1 -1
- package/auth.d.ts.map +1 -1
- package/auth.js +4 -1
- package/auth.js.map +1 -1
- package/auth.mjs +4 -1
- package/auth.mjs.map +1 -1
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +43 -2
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +10 -2
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.js +5 -2
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +6 -3
- package/code-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +10 -3
- package/http.js.map +1 -1
- package/http.mjs +10 -3
- package/http.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +221 -221
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +221 -221
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +1 -3
- package/server.js.map +1 -1
- package/server.mjs +1 -3
- package/server.mjs.map +1 -1
- package/src/auth.ts +5 -1
- package/src/code-tool-worker.ts +10 -2
- package/src/code-tool.ts +9 -3
- package/src/http.ts +14 -5
- package/src/local-docs-search.ts +227 -221
- package/src/server.ts +1 -2
package/src/local-docs-search.ts
CHANGED
|
@@ -75,17 +75,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
75
75
|
perLanguage: {
|
|
76
76
|
http: {
|
|
77
77
|
example:
|
|
78
|
-
'curl https://api.retellai.com/v2/create-phone-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
78
|
+
'curl https://api.retellai.com/v2/create-phone-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n --max-time 120 \\\n -d \'{\n "from_number": "+14157774444",\n "to_number": "+12137774445",\n "custom_sip_headers": {\n "X-Custom-Header": "Custom Value"\n },\n "ignore_e164_validation": true,\n "override_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "override_agent_version": 1,\n "retell_llm_dynamic_variables": {\n "customer_name": "bar"\n }\n }\'',
|
|
79
79
|
},
|
|
80
80
|
python: {
|
|
81
81
|
method: 'call.create_phone_call',
|
|
82
82
|
example:
|
|
83
|
-
'
|
|
83
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_call_response = client.call.create_phone_call(\n from_number="+14157774444",\n to_number="+12137774445",\n)\nprint(phone_call_response.agent_id)',
|
|
84
84
|
},
|
|
85
85
|
typescript: {
|
|
86
86
|
method: 'client.call.createPhoneCall',
|
|
87
87
|
example:
|
|
88
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
88
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneCallResponse = await client.call.createPhoneCall({\n from_number: '+14157774444',\n to_number: '+12137774445',\n});\n\nconsole.log(phoneCallResponse.agent_id);",
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
},
|
|
@@ -113,17 +113,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
113
113
|
perLanguage: {
|
|
114
114
|
http: {
|
|
115
115
|
example:
|
|
116
|
-
'curl https://api.retellai.com/v2/register-phone-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
116
|
+
'curl https://api.retellai.com/v2/register-phone-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "agent_version": 1,\n "direction": "inbound",\n "from_number": "+14157774444",\n "retell_llm_dynamic_variables": {\n "customer_name": "bar"\n },\n "to_number": "+12137774445"\n }\'',
|
|
117
117
|
},
|
|
118
118
|
python: {
|
|
119
119
|
method: 'call.register_phone_call',
|
|
120
120
|
example:
|
|
121
|
-
'
|
|
121
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_call_response = client.call.register_phone_call(\n agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)\nprint(phone_call_response.agent_id)',
|
|
122
122
|
},
|
|
123
123
|
typescript: {
|
|
124
124
|
method: 'client.call.registerPhoneCall',
|
|
125
125
|
example:
|
|
126
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
126
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneCallResponse = await client.call.registerPhoneCall({\n agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',\n});\n\nconsole.log(phoneCallResponse.agent_id);",
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
},
|
|
@@ -151,17 +151,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
151
151
|
perLanguage: {
|
|
152
152
|
http: {
|
|
153
153
|
example:
|
|
154
|
-
'curl https://api.retellai.com/v2/create-web-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
154
|
+
'curl https://api.retellai.com/v2/create-web-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "agent_version": 1,\n "current_node_id": "collect_info",\n "current_state": "information_collection",\n "retell_llm_dynamic_variables": {\n "customer_name": "bar"\n }\n }\'',
|
|
155
155
|
},
|
|
156
156
|
python: {
|
|
157
157
|
method: 'call.create_web_call',
|
|
158
158
|
example:
|
|
159
|
-
'
|
|
159
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nweb_call_response = client.call.create_web_call(\n agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)\nprint(web_call_response.agent_id)',
|
|
160
160
|
},
|
|
161
161
|
typescript: {
|
|
162
162
|
method: 'client.call.createWebCall',
|
|
163
163
|
example:
|
|
164
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
164
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst webCallResponse = await client.call.createWebCall({\n agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',\n});\n\nconsole.log(webCallResponse.agent_id);",
|
|
165
165
|
},
|
|
166
166
|
},
|
|
167
167
|
},
|
|
@@ -180,17 +180,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
180
180
|
perLanguage: {
|
|
181
181
|
http: {
|
|
182
182
|
example:
|
|
183
|
-
'curl https://api.retellai.com/v2/get-call/$CALL_ID \\\n -H "Authorization: Bearer $
|
|
183
|
+
'curl https://api.retellai.com/v2/get-call/$CALL_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
184
184
|
},
|
|
185
185
|
python: {
|
|
186
186
|
method: 'call.retrieve',
|
|
187
187
|
example:
|
|
188
|
-
'
|
|
188
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ncall_response = client.call.retrieve(\n "119c3f8e47135a29e65947eeb34cf12d",\n)\nprint(call_response)',
|
|
189
189
|
},
|
|
190
190
|
typescript: {
|
|
191
191
|
method: 'client.call.retrieve',
|
|
192
192
|
example:
|
|
193
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
193
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst callResponse = await client.call.retrieve('119c3f8e47135a29e65947eeb34cf12d');\n\nconsole.log(callResponse);",
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
196
|
},
|
|
@@ -214,17 +214,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
214
214
|
perLanguage: {
|
|
215
215
|
http: {
|
|
216
216
|
example:
|
|
217
|
-
'curl https://api.retellai.com/v2/list-calls \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
217
|
+
'curl https://api.retellai.com/v2/list-calls \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n --max-time 300 \\\n -d \'{\n "filter_criteria": {\n "agent_id": [\n "agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"\n ],\n "call_id": [\n "call_5a82f0a43ea0977566b1104fcfc"\n ],\n "call_status": [\n "ended"\n ],\n "call_successful": [\n true\n ],\n "call_type": [\n "phone_call"\n ],\n "direction": [\n "inbound"\n ],\n "start_timestamp": {\n "lower_threshold": 1738475411000,\n "upper_threshold": 1738475421000\n },\n "user_sentiment": [\n "Positive"\n ]\n }\n }\'',
|
|
218
218
|
},
|
|
219
219
|
python: {
|
|
220
220
|
method: 'call.list',
|
|
221
221
|
example:
|
|
222
|
-
'
|
|
222
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ncall_responses = client.call.list()\nprint(call_responses)',
|
|
223
223
|
},
|
|
224
224
|
typescript: {
|
|
225
225
|
method: 'client.call.list',
|
|
226
226
|
example:
|
|
227
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
227
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst callResponses = await client.call.list();\n\nconsole.log(callResponses);",
|
|
228
228
|
},
|
|
229
229
|
},
|
|
230
230
|
},
|
|
@@ -249,17 +249,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
249
249
|
perLanguage: {
|
|
250
250
|
http: {
|
|
251
251
|
example:
|
|
252
|
-
'curl https://api.retellai.com/v2/update-call/$CALL_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
252
|
+
'curl https://api.retellai.com/v2/update-call/$CALL_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "custom_attributes": {\n "custom_attribute_1": "value1",\n "custom_attribute_2": "value2"\n },\n "data_storage_setting": "everything_except_pii",\n "metadata": {\n "customer_id": "cust_123",\n "notes": "Follow-up required"\n },\n "override_dynamic_variables": {\n "additional_discount": "15%"\n }\n }\'',
|
|
253
253
|
},
|
|
254
254
|
python: {
|
|
255
255
|
method: 'call.update',
|
|
256
256
|
example:
|
|
257
|
-
'
|
|
257
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ncall_response = client.call.update(\n call_id="call_a4441234567890777c4a4a123e6",\n data_storage_setting="everything_except_pii",\n metadata={\n "customer_id": "cust_123",\n "notes": "Follow-up required",\n },\n)\nprint(call_response)',
|
|
258
258
|
},
|
|
259
259
|
typescript: {
|
|
260
260
|
method: 'client.call.update',
|
|
261
261
|
example:
|
|
262
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
262
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst callResponse = await client.call.update('call_a4441234567890777c4a4a123e6', {\n data_storage_setting: 'everything_except_pii',\n metadata: { customer_id: 'cust_123', notes: 'Follow-up required' },\n});\n\nconsole.log(callResponse);",
|
|
263
263
|
},
|
|
264
264
|
},
|
|
265
265
|
},
|
|
@@ -277,17 +277,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
277
277
|
perLanguage: {
|
|
278
278
|
http: {
|
|
279
279
|
example:
|
|
280
|
-
'curl https://api.retellai.com/v2/delete-call/$CALL_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
280
|
+
'curl https://api.retellai.com/v2/delete-call/$CALL_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
281
281
|
},
|
|
282
282
|
python: {
|
|
283
283
|
method: 'call.delete',
|
|
284
284
|
example:
|
|
285
|
-
'
|
|
285
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.call.delete(\n "119c3f8e47135a29e65947eeb34cf12d",\n)',
|
|
286
286
|
},
|
|
287
287
|
typescript: {
|
|
288
288
|
method: 'client.call.delete',
|
|
289
289
|
example:
|
|
290
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
290
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.call.delete('119c3f8e47135a29e65947eeb34cf12d');",
|
|
291
291
|
},
|
|
292
292
|
},
|
|
293
293
|
},
|
|
@@ -312,17 +312,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
312
312
|
perLanguage: {
|
|
313
313
|
http: {
|
|
314
314
|
example:
|
|
315
|
-
'curl https://api.retellai.com/create-chat \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
315
|
+
'curl https://api.retellai.com/create-chat \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "agent_version": 1,\n "retell_llm_dynamic_variables": {\n "customer_name": "bar"\n }\n }\'',
|
|
316
316
|
},
|
|
317
317
|
python: {
|
|
318
318
|
method: 'chat.create',
|
|
319
319
|
example:
|
|
320
|
-
'
|
|
320
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_response = client.chat.create(\n agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)\nprint(chat_response.agent_id)',
|
|
321
321
|
},
|
|
322
322
|
typescript: {
|
|
323
323
|
method: 'client.chat.create',
|
|
324
324
|
example:
|
|
325
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
325
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' });\n\nconsole.log(chatResponse.agent_id);",
|
|
326
326
|
},
|
|
327
327
|
},
|
|
328
328
|
},
|
|
@@ -350,17 +350,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
350
350
|
perLanguage: {
|
|
351
351
|
http: {
|
|
352
352
|
example:
|
|
353
|
-
'curl https://api.retellai.com/create-sms-chat \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
353
|
+
'curl https://api.retellai.com/create-sms-chat \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "from_number": "+12137771234",\n "to_number": "+14155551234",\n "override_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "override_agent_version": 1,\n "retell_llm_dynamic_variables": {\n "customer_name": "bar"\n }\n }\'',
|
|
354
354
|
},
|
|
355
355
|
python: {
|
|
356
356
|
method: 'chat.create_sms_chat',
|
|
357
357
|
example:
|
|
358
|
-
'
|
|
358
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_response = client.chat.create_sms_chat(\n from_number="+12137771234",\n to_number="+14155551234",\n)\nprint(chat_response.agent_id)',
|
|
359
359
|
},
|
|
360
360
|
typescript: {
|
|
361
361
|
method: 'client.chat.createSMSChat',
|
|
362
362
|
example:
|
|
363
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
363
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatResponse = await client.chat.createSMSChat({\n from_number: '+12137771234',\n to_number: '+14155551234',\n});\n\nconsole.log(chatResponse.agent_id);",
|
|
364
364
|
},
|
|
365
365
|
},
|
|
366
366
|
},
|
|
@@ -378,17 +378,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
378
378
|
perLanguage: {
|
|
379
379
|
http: {
|
|
380
380
|
example:
|
|
381
|
-
'curl https://api.retellai.com/end-chat/$CHAT_ID \\\n -X PATCH \\\n -H "Authorization: Bearer $
|
|
381
|
+
'curl https://api.retellai.com/end-chat/$CHAT_ID \\\n -X PATCH \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
382
382
|
},
|
|
383
383
|
python: {
|
|
384
384
|
method: 'chat.end',
|
|
385
385
|
example:
|
|
386
|
-
'
|
|
386
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.chat.end(\n "16b980523634a6dc504898cda492e939",\n)',
|
|
387
387
|
},
|
|
388
388
|
typescript: {
|
|
389
389
|
method: 'client.chat.end',
|
|
390
390
|
example:
|
|
391
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
391
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chat.end('16b980523634a6dc504898cda492e939');",
|
|
392
392
|
},
|
|
393
393
|
},
|
|
394
394
|
},
|
|
@@ -408,17 +408,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
408
408
|
perLanguage: {
|
|
409
409
|
http: {
|
|
410
410
|
example:
|
|
411
|
-
'curl https://api.retellai.com/get-chat/$CHAT_ID \\\n -H "Authorization: Bearer $
|
|
411
|
+
'curl https://api.retellai.com/get-chat/$CHAT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
412
412
|
},
|
|
413
413
|
python: {
|
|
414
414
|
method: 'chat.retrieve',
|
|
415
415
|
example:
|
|
416
|
-
'
|
|
416
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_response = client.chat.retrieve(\n "16b980523634a6dc504898cda492e939",\n)\nprint(chat_response.agent_id)',
|
|
417
417
|
},
|
|
418
418
|
typescript: {
|
|
419
419
|
method: 'client.chat.retrieve',
|
|
420
420
|
example:
|
|
421
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
421
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatResponse = await client.chat.retrieve('16b980523634a6dc504898cda492e939');\n\nconsole.log(chatResponse.agent_id);",
|
|
422
422
|
},
|
|
423
423
|
},
|
|
424
424
|
},
|
|
@@ -438,17 +438,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
438
438
|
perLanguage: {
|
|
439
439
|
http: {
|
|
440
440
|
example:
|
|
441
|
-
'curl https://api.retellai.com/create-chat-completion \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
441
|
+
'curl https://api.retellai.com/create-chat-completion \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n --max-time 300 \\\n -d \'{\n "chat_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "content": "hi how are you doing?"\n }\'',
|
|
442
442
|
},
|
|
443
443
|
python: {
|
|
444
444
|
method: 'chat.create_chat_completion',
|
|
445
445
|
example:
|
|
446
|
-
'
|
|
446
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.chat.create_chat_completion(\n chat_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n content="hi how are you doing?",\n)\nprint(response.messages)',
|
|
447
447
|
},
|
|
448
448
|
typescript: {
|
|
449
449
|
method: 'client.chat.createChatCompletion',
|
|
450
450
|
example:
|
|
451
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
451
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.chat.createChatCompletion({\n chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',\n content: 'hi how are you doing?',\n});\n\nconsole.log(response.messages);",
|
|
452
452
|
},
|
|
453
453
|
},
|
|
454
454
|
},
|
|
@@ -468,17 +468,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
468
468
|
perLanguage: {
|
|
469
469
|
http: {
|
|
470
470
|
example:
|
|
471
|
-
'curl https://api.retellai.com/list-chat \\\n -H "Authorization: Bearer $
|
|
471
|
+
'curl https://api.retellai.com/list-chat \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n --max-time 300',
|
|
472
472
|
},
|
|
473
473
|
python: {
|
|
474
474
|
method: 'chat.list',
|
|
475
475
|
example:
|
|
476
|
-
'
|
|
476
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_responses = client.chat.list()\nprint(chat_responses)',
|
|
477
477
|
},
|
|
478
478
|
typescript: {
|
|
479
479
|
method: 'client.chat.list',
|
|
480
480
|
example:
|
|
481
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
481
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatResponses = await client.chat.list();\n\nconsole.log(chatResponses);",
|
|
482
482
|
},
|
|
483
483
|
},
|
|
484
484
|
},
|
|
@@ -504,17 +504,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
504
504
|
perLanguage: {
|
|
505
505
|
http: {
|
|
506
506
|
example:
|
|
507
|
-
'curl https://api.retellai.com/update-chat/$CHAT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
507
|
+
'curl https://api.retellai.com/update-chat/$CHAT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "custom_attributes": {\n "custom_attribute_1": "value1",\n "custom_attribute_2": "value2"\n },\n "data_storage_setting": "everything",\n "override_dynamic_variables": {\n "additional_discount": "15%"\n }\n }\'',
|
|
508
508
|
},
|
|
509
509
|
python: {
|
|
510
510
|
method: 'chat.update',
|
|
511
511
|
example:
|
|
512
|
-
'
|
|
512
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_response = client.chat.update(\n chat_id="chat_98c1a2157aa0559144d67bb0729",\n data_storage_setting="everything",\n metadata={\n "customer_id": "cust_123",\n "notes": "Follow-up required",\n },\n override_dynamic_variables={\n "additional_discount": "15%"\n },\n)\nprint(chat_response.agent_id)',
|
|
513
513
|
},
|
|
514
514
|
typescript: {
|
|
515
515
|
method: 'client.chat.update',
|
|
516
516
|
example:
|
|
517
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
517
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatResponse = await client.chat.update('chat_98c1a2157aa0559144d67bb0729', {\n data_storage_setting: 'everything',\n metadata: { customer_id: 'cust_123', notes: 'Follow-up required' },\n override_dynamic_variables: { additional_discount: '15%' },\n});\n\nconsole.log(chatResponse.agent_id);",
|
|
518
518
|
},
|
|
519
519
|
},
|
|
520
520
|
},
|
|
@@ -552,17 +552,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
552
552
|
perLanguage: {
|
|
553
553
|
http: {
|
|
554
554
|
example:
|
|
555
|
-
'curl https://api.retellai.com/create-phone-number \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
555
|
+
'curl https://api.retellai.com/create-phone-number \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "allowed_inbound_country_list": [\n "US",\n "CA",\n "GB"\n ],\n "allowed_outbound_country_list": [\n "US",\n "CA"\n ],\n "area_code": 415,\n "country_code": "US",\n "fallback_number": "+14155551234",\n "inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "inbound_agent_version": 1,\n "inbound_webhook_url": "https://example.com/inbound-webhook",\n "nickname": "Frontdesk Number",\n "number_provider": "twilio",\n "outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "outbound_agent_version": 1,\n "phone_number": "+14157774444",\n "transport": "TCP"\n }\'',
|
|
556
556
|
},
|
|
557
557
|
python: {
|
|
558
558
|
method: 'phone_number.create',
|
|
559
559
|
example:
|
|
560
|
-
'
|
|
560
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_number_response = client.phone_number.create()\nprint(phone_number_response.inbound_agent_id)',
|
|
561
561
|
},
|
|
562
562
|
typescript: {
|
|
563
563
|
method: 'client.phoneNumber.create',
|
|
564
564
|
example:
|
|
565
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
565
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumberResponse = await client.phoneNumber.create();\n\nconsole.log(phoneNumberResponse.inbound_agent_id);",
|
|
566
566
|
},
|
|
567
567
|
},
|
|
568
568
|
},
|
|
@@ -599,17 +599,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
599
599
|
perLanguage: {
|
|
600
600
|
http: {
|
|
601
601
|
example:
|
|
602
|
-
'curl https://api.retellai.com/import-phone-number \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
602
|
+
'curl https://api.retellai.com/import-phone-number \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "phone_number": "+14157774444",\n "termination_uri": "someuri.pstn.twilio.com",\n "allowed_inbound_country_list": [\n "US",\n "CA",\n "GB"\n ],\n "allowed_outbound_country_list": [\n "US",\n "CA"\n ],\n "ignore_e164_validation": true,\n "inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "inbound_agent_version": 1,\n "inbound_webhook_url": "https://example.com/inbound-webhook",\n "nickname": "Frontdesk Number",\n "outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "outbound_agent_version": 1,\n "sip_trunk_auth_password": "123456",\n "sip_trunk_auth_username": "username",\n "transport": "TCP"\n }\'',
|
|
603
603
|
},
|
|
604
604
|
python: {
|
|
605
605
|
method: 'phone_number.import_',
|
|
606
606
|
example:
|
|
607
|
-
'
|
|
607
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_number_response = client.phone_number.import_(\n phone_number="+14157774444",\n termination_uri="someuri.pstn.twilio.com",\n)\nprint(phone_number_response.inbound_agent_id)',
|
|
608
608
|
},
|
|
609
609
|
typescript: {
|
|
610
610
|
method: 'client.phoneNumber.import',
|
|
611
611
|
example:
|
|
612
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
612
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumberResponse = await client.phoneNumber.import({\n phone_number: '+14157774444',\n termination_uri: 'someuri.pstn.twilio.com',\n});\n\nconsole.log(phoneNumberResponse.inbound_agent_id);",
|
|
613
613
|
},
|
|
614
614
|
},
|
|
615
615
|
},
|
|
@@ -629,17 +629,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
629
629
|
perLanguage: {
|
|
630
630
|
http: {
|
|
631
631
|
example:
|
|
632
|
-
'curl https://api.retellai.com/get-phone-number/$PHONE_NUMBER \\\n -H "Authorization: Bearer $
|
|
632
|
+
'curl https://api.retellai.com/get-phone-number/$PHONE_NUMBER \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
633
633
|
},
|
|
634
634
|
python: {
|
|
635
635
|
method: 'phone_number.retrieve',
|
|
636
636
|
example:
|
|
637
|
-
'
|
|
637
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_number_response = client.phone_number.retrieve(\n "+14157774444",\n)\nprint(phone_number_response.inbound_agent_id)',
|
|
638
638
|
},
|
|
639
639
|
typescript: {
|
|
640
640
|
method: 'client.phoneNumber.retrieve',
|
|
641
641
|
example:
|
|
642
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
642
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumberResponse = await client.phoneNumber.retrieve('+14157774444');\n\nconsole.log(phoneNumberResponse.inbound_agent_id);",
|
|
643
643
|
},
|
|
644
644
|
},
|
|
645
645
|
},
|
|
@@ -658,17 +658,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
658
658
|
perLanguage: {
|
|
659
659
|
http: {
|
|
660
660
|
example:
|
|
661
|
-
'curl https://api.retellai.com/list-phone-numbers \\\n -H "Authorization: Bearer $
|
|
661
|
+
'curl https://api.retellai.com/list-phone-numbers \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
662
662
|
},
|
|
663
663
|
python: {
|
|
664
664
|
method: 'phone_number.list',
|
|
665
665
|
example:
|
|
666
|
-
'
|
|
666
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_number_responses = client.phone_number.list()\nprint(phone_number_responses)',
|
|
667
667
|
},
|
|
668
668
|
typescript: {
|
|
669
669
|
method: 'client.phoneNumber.list',
|
|
670
670
|
example:
|
|
671
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
671
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumberResponses = await client.phoneNumber.list();\n\nconsole.log(phoneNumberResponses);",
|
|
672
672
|
},
|
|
673
673
|
},
|
|
674
674
|
},
|
|
@@ -708,17 +708,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
708
708
|
perLanguage: {
|
|
709
709
|
http: {
|
|
710
710
|
example:
|
|
711
|
-
'curl https://api.retellai.com/update-phone-number/$PHONE_NUMBER \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
711
|
+
'curl https://api.retellai.com/update-phone-number/$PHONE_NUMBER \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "allowed_inbound_country_list": [\n "US",\n "CA",\n "GB"\n ],\n "allowed_outbound_country_list": [\n "US",\n "CA"\n ],\n "auth_password": "123456",\n "auth_username": "username",\n "fallback_number": "+14155551234",\n "inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "inbound_agent_version": 1,\n "inbound_sms_webhook_url": "https://example.com/inbound-sms-webhook",\n "inbound_webhook_url": "https://example.com/inbound-webhook",\n "nickname": "Frontdesk Number",\n "outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n "outbound_agent_version": 1,\n "termination_uri": "someuri.pstn.twilio.com",\n "transport": "TCP"\n }\'',
|
|
712
712
|
},
|
|
713
713
|
python: {
|
|
714
714
|
method: 'phone_number.update',
|
|
715
715
|
example:
|
|
716
|
-
'
|
|
716
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nphone_number_response = client.phone_number.update(\n phone_number="+14157774444",\n inbound_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n nickname="Frontdesk Number",\n outbound_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)\nprint(phone_number_response.inbound_agent_id)',
|
|
717
717
|
},
|
|
718
718
|
typescript: {
|
|
719
719
|
method: 'client.phoneNumber.update',
|
|
720
720
|
example:
|
|
721
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
721
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst phoneNumberResponse = await client.phoneNumber.update('+14157774444', {\n inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',\n nickname: 'Frontdesk Number',\n outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',\n});\n\nconsole.log(phoneNumberResponse.inbound_agent_id);",
|
|
722
722
|
},
|
|
723
723
|
},
|
|
724
724
|
},
|
|
@@ -736,17 +736,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
736
736
|
perLanguage: {
|
|
737
737
|
http: {
|
|
738
738
|
example:
|
|
739
|
-
'curl https://api.retellai.com/delete-phone-number/$PHONE_NUMBER \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
739
|
+
'curl https://api.retellai.com/delete-phone-number/$PHONE_NUMBER \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
740
740
|
},
|
|
741
741
|
python: {
|
|
742
742
|
method: 'phone_number.delete',
|
|
743
743
|
example:
|
|
744
|
-
'
|
|
744
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.phone_number.delete(\n "+14157774444",\n)',
|
|
745
745
|
},
|
|
746
746
|
typescript: {
|
|
747
747
|
method: 'client.phoneNumber.delete',
|
|
748
748
|
example:
|
|
749
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
749
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.phoneNumber.delete('+14157774444');",
|
|
750
750
|
},
|
|
751
751
|
},
|
|
752
752
|
},
|
|
@@ -822,17 +822,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
822
822
|
perLanguage: {
|
|
823
823
|
http: {
|
|
824
824
|
example:
|
|
825
|
-
'curl https://api.retellai.com/create-agent \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
825
|
+
'curl https://api.retellai.com/create-agent \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d "{\n \\"response_engine\\": {\n \\"llm_id\\": \\"llm_234sdertfsdsfsdf\\",\n \\"type\\": \\"retell-llm\\",\n \\"version\\": 0\n },\n \\"voice_id\\": \\"retell-Cimo\\",\n \\"agent_name\\": \\"Jarvis\\",\n \\"allow_user_dtmf\\": true,\n \\"ambient_sound_volume\\": 1,\n \\"analysis_successful_prompt\\": \\"The agent finished the task and the call was complete without being cutoff.\\",\n \\"analysis_summary_prompt\\": \\"Summarize the outcome of the conversation in two sentences.\\",\n \\"analysis_user_sentiment_prompt\\": \\"Evaluate the user\'s sentiment based on their tone and satisfaction level.\\",\n \\"backchannel_frequency\\": 0.9,\n \\"backchannel_words\\": [\n \\"yeah\\",\n \\"uh-huh\\"\n ],\n \\"begin_message_delay_ms\\": 1000,\n \\"boosted_keywords\\": [\n \\"retell\\",\n \\"kroger\\"\n ],\n \\"data_storage_retention_days\\": 30,\n \\"data_storage_setting\\": \\"everything\\",\n \\"denoising_mode\\": \\"noise-cancellation\\",\n \\"enable_backchannel\\": true,\n \\"enable_dynamic_responsiveness\\": true,\n \\"enable_dynamic_voice_speed\\": true,\n \\"end_call_after_silence_ms\\": 600000,\n \\"fallback_voice_ids\\": [\n \\"cartesia-Cimo\\",\n \\"minimax-Cimo\\"\n ],\n \\"interruption_sensitivity\\": 1,\n \\"ivr_option\\": {\n \\"action\\": {\n \\"type\\": \\"hangup\\"\n }\n },\n \\"language\\": \\"en-US\\",\n \\"max_call_duration_ms\\": 3600000,\n \\"normalize_for_speech\\": true,\n \\"opt_in_signed_url\\": true,\n \\"post_call_analysis_model\\": \\"gpt-4.1-mini\\",\n \\"reminder_max_count\\": 2,\n \\"reminder_trigger_ms\\": 10000,\n \\"responsiveness\\": 1,\n \\"ring_duration_ms\\": 30000,\n \\"signed_url_expiration_ms\\": 86400000,\n \\"stt_mode\\": \\"fast\\",\n \\"timezone\\": \\"America/New_York\\",\n \\"version_description\\": \\"Customer support agent for handling product inquiries\\",\n \\"vocab_specialization\\": \\"general\\",\n \\"voice_emotion\\": \\"calm\\",\n \\"voice_speed\\": 1,\n \\"voice_temperature\\": 1,\n \\"voicemail_detection_timeout_ms\\": 30000,\n \\"voicemail_message\\": \\"Hi, please give us a callback.\\",\n \\"voicemail_option\\": {\n \\"action\\": {\n \\"text\\": \\"Please give us a callback tomorrow at 10am.\\",\n \\"type\\": \\"static_text\\"\n }\n },\n \\"volume\\": 1,\n \\"webhook_timeout_ms\\": 10000,\n \\"webhook_url\\": \\"https://webhook-url-here\\"\n }"',
|
|
826
826
|
},
|
|
827
827
|
python: {
|
|
828
828
|
method: 'agent.create',
|
|
829
829
|
example:
|
|
830
|
-
'
|
|
830
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nagent_response = client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\nprint(agent_response.agent_id)',
|
|
831
831
|
},
|
|
832
832
|
typescript: {
|
|
833
833
|
method: 'client.agent.create',
|
|
834
834
|
example:
|
|
835
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
835
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponse = await client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n});\n\nconsole.log(agentResponse.agent_id);",
|
|
836
836
|
},
|
|
837
837
|
},
|
|
838
838
|
},
|
|
@@ -851,17 +851,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
851
851
|
perLanguage: {
|
|
852
852
|
http: {
|
|
853
853
|
example:
|
|
854
|
-
'curl https://api.retellai.com/get-agent/$AGENT_ID \\\n -H "Authorization: Bearer $
|
|
854
|
+
'curl https://api.retellai.com/get-agent/$AGENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
855
855
|
},
|
|
856
856
|
python: {
|
|
857
857
|
method: 'agent.retrieve',
|
|
858
858
|
example:
|
|
859
|
-
'
|
|
859
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nagent_response = client.agent.retrieve(\n agent_id="16b980523634a6dc504898cda492e939",\n)\nprint(agent_response.agent_id)',
|
|
860
860
|
},
|
|
861
861
|
typescript: {
|
|
862
862
|
method: 'client.agent.retrieve',
|
|
863
863
|
example:
|
|
864
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
864
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939');\n\nconsole.log(agentResponse.agent_id);",
|
|
865
865
|
},
|
|
866
866
|
},
|
|
867
867
|
},
|
|
@@ -879,17 +879,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
879
879
|
"## list\n\n`client.agent.list(limit?: number, pagination_key?: string, pagination_key_version?: number): object[]`\n\n**get** `/list-agents`\n\nList all agents\n\n### Parameters\n\n- `limit?: number`\n A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 1000.\n\n- `pagination_key?: string`\n The pagination key to continue fetching the next page of agents. Pagination key is represented by a agent id, pagination key and version pair is exclusive (not included in the fetched page). If not set, will start from the beginning.\n\n- `pagination_key_version?: number`\n Specifies the version of the agent associated with the pagination_key. When paginating, both the pagination_key and its version must be provided to ensure consistent ordering and to fetch the next page correctly.\n\n### Returns\n\n- `{ agent_id: string; last_modification_timestamp: number; response_engine: { llm_id: string; type: 'retell-llm'; version?: number; } | { llm_websocket_url: string; type: 'custom-llm'; } | { conversation_flow_id: string; type: 'conversation-flow'; version?: number; }; version: number; voice_id: string; agent_name?: string; allow_user_dtmf?: boolean; ambient_sound?: string; ambient_sound_volume?: number; analysis_successful_prompt?: string; analysis_summary_prompt?: string; analysis_user_sentiment_prompt?: string; backchannel_frequency?: number; backchannel_words?: string[]; begin_message_delay_ms?: number; boosted_keywords?: string[]; custom_stt_config?: { endpointing_ms: number; provider: 'azure' | 'deepgram'; }; data_storage_retention_days?: number; data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; denoising_mode?: 'no-denoise' | 'noise-cancellation' | 'noise-and-background-speech-cancellation'; enable_backchannel?: boolean; enable_dynamic_responsiveness?: boolean; enable_dynamic_voice_speed?: boolean; end_call_after_silence_ms?: number; fallback_voice_ids?: string[]; guardrail_config?: { input_topics?: 'platform_integrity_jailbreaking'[]; output_topics?: string[]; }; handbook_config?: { ai_disclosure?: boolean; default_personality?: boolean; echo_verification?: boolean; high_empathy?: boolean; nato_phonetic_alphabet?: boolean; natural_filler_words?: boolean; scope_boundaries?: boolean; smart_matching?: boolean; speech_normalization?: boolean; }; interruption_sensitivity?: number; is_public?: boolean; is_published?: boolean; ivr_option?: { action: object; }; language?: string; max_call_duration_ms?: number; normalize_for_speech?: boolean; opt_in_signed_url?: boolean; pii_config?: { categories: string[]; mode: 'post_call'; }; post_call_analysis_data?: { description: string; name: string; type: 'string'; conditional_prompt?: string; examples?: string[]; required?: boolean; } | { choices: string[]; description: string; name: string; type: 'enum'; conditional_prompt?: string; required?: boolean; } | { description: string; name: string; type: 'boolean'; conditional_prompt?: string; required?: boolean; } | { description: string; name: string; type: 'number'; conditional_prompt?: string; required?: boolean; } | { name: 'call_summary' | 'call_successful' | 'user_sentiment'; type: 'system-presets'; conditional_prompt?: string; description?: string; required?: boolean; }[]; post_call_analysis_model?: string; pronunciation_dictionary?: { alphabet: 'ipa' | 'cmu'; phoneme: string; word: string; }[]; reminder_max_count?: number; reminder_trigger_ms?: number; responsiveness?: number; ring_duration_ms?: number; signed_url_expiration_ms?: number; stt_mode?: 'fast' | 'accurate' | 'custom'; timezone?: string; user_dtmf_options?: { digit_limit?: number; termination_key?: string; timeout_ms?: number; }; version_description?: string; vocab_specialization?: 'general' | 'medical'; voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised'; voice_model?: string; voice_speed?: number; voice_temperature?: number; voicemail_detection_timeout_ms?: number; voicemail_message?: string; voicemail_option?: { action: object | object | object | object; }; volume?: number; webhook_events?: string[]; webhook_timeout_ms?: number; webhook_url?: string; }[]`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst agentResponses = await client.agent.list();\n\nconsole.log(agentResponses);\n```",
|
|
880
880
|
perLanguage: {
|
|
881
881
|
http: {
|
|
882
|
-
example:
|
|
882
|
+
example:
|
|
883
|
+
'curl https://api.retellai.com/list-agents \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
883
884
|
},
|
|
884
885
|
python: {
|
|
885
886
|
method: 'agent.list',
|
|
886
887
|
example:
|
|
887
|
-
'
|
|
888
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nagent_responses = client.agent.list()\nprint(agent_responses)',
|
|
888
889
|
},
|
|
889
890
|
typescript: {
|
|
890
891
|
method: 'client.agent.list',
|
|
891
892
|
example:
|
|
892
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
893
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponses = await client.agent.list();\n\nconsole.log(agentResponses);",
|
|
893
894
|
},
|
|
894
895
|
},
|
|
895
896
|
},
|
|
@@ -967,17 +968,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
967
968
|
perLanguage: {
|
|
968
969
|
http: {
|
|
969
970
|
example:
|
|
970
|
-
'curl https://api.retellai.com/update-agent/$AGENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
971
|
+
'curl https://api.retellai.com/update-agent/$AGENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d "{\n \\"agent_name\\": \\"Jarvis\\",\n \\"allow_user_dtmf\\": true,\n \\"ambient_sound_volume\\": 1,\n \\"analysis_successful_prompt\\": \\"The agent finished the task and the call was complete without being cutoff.\\",\n \\"analysis_summary_prompt\\": \\"Summarize the outcome of the conversation in two sentences.\\",\n \\"analysis_user_sentiment_prompt\\": \\"Evaluate the user\'s sentiment based on their tone and satisfaction level.\\",\n \\"backchannel_frequency\\": 0.9,\n \\"backchannel_words\\": [\n \\"yeah\\",\n \\"uh-huh\\"\n ],\n \\"begin_message_delay_ms\\": 1000,\n \\"boosted_keywords\\": [\n \\"retell\\",\n \\"kroger\\"\n ],\n \\"data_storage_retention_days\\": 30,\n \\"data_storage_setting\\": \\"everything\\",\n \\"denoising_mode\\": \\"noise-cancellation\\",\n \\"enable_backchannel\\": true,\n \\"enable_dynamic_responsiveness\\": true,\n \\"enable_dynamic_voice_speed\\": true,\n \\"end_call_after_silence_ms\\": 600000,\n \\"fallback_voice_ids\\": [\n \\"cartesia-Cimo\\",\n \\"minimax-Cimo\\"\n ],\n \\"interruption_sensitivity\\": 1,\n \\"ivr_option\\": {\n \\"action\\": {\n \\"type\\": \\"hangup\\"\n }\n },\n \\"language\\": \\"en-US\\",\n \\"max_call_duration_ms\\": 3600000,\n \\"normalize_for_speech\\": true,\n \\"opt_in_signed_url\\": true,\n \\"post_call_analysis_model\\": \\"gpt-4.1-mini\\",\n \\"reminder_max_count\\": 2,\n \\"reminder_trigger_ms\\": 10000,\n \\"response_engine\\": {\n \\"llm_id\\": \\"llm_234sdertfsdsfsdf\\",\n \\"type\\": \\"retell-llm\\",\n \\"version\\": 0\n },\n \\"responsiveness\\": 1,\n \\"ring_duration_ms\\": 30000,\n \\"signed_url_expiration_ms\\": 86400000,\n \\"stt_mode\\": \\"fast\\",\n \\"timezone\\": \\"America/New_York\\",\n \\"version_description\\": \\"Customer support agent for handling product inquiries\\",\n \\"vocab_specialization\\": \\"general\\",\n \\"voice_emotion\\": \\"calm\\",\n \\"voice_id\\": \\"retell-Cimo\\",\n \\"voice_speed\\": 1,\n \\"voice_temperature\\": 1,\n \\"voicemail_detection_timeout_ms\\": 30000,\n \\"voicemail_message\\": \\"Hi, please give us a callback.\\",\n \\"voicemail_option\\": {\n \\"action\\": {\n \\"text\\": \\"Please give us a callback tomorrow at 10am.\\",\n \\"type\\": \\"static_text\\"\n }\n },\n \\"volume\\": 1,\n \\"webhook_timeout_ms\\": 10000,\n \\"webhook_url\\": \\"https://webhook-url-here\\"\n }"',
|
|
971
972
|
},
|
|
972
973
|
python: {
|
|
973
974
|
method: 'agent.update',
|
|
974
975
|
example:
|
|
975
|
-
'
|
|
976
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nagent_response = client.agent.update(\n agent_id="16b980523634a6dc504898cda492e939",\n agent_name="Jarvis",\n)\nprint(agent_response.agent_id)',
|
|
976
977
|
},
|
|
977
978
|
typescript: {
|
|
978
979
|
method: 'client.agent.update',
|
|
979
980
|
example:
|
|
980
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
981
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', {\n agent_name: 'Jarvis',\n});\n\nconsole.log(agentResponse.agent_id);",
|
|
981
982
|
},
|
|
982
983
|
},
|
|
983
984
|
},
|
|
@@ -995,17 +996,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
995
996
|
perLanguage: {
|
|
996
997
|
http: {
|
|
997
998
|
example:
|
|
998
|
-
'curl https://api.retellai.com/delete-agent/$AGENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
999
|
+
'curl https://api.retellai.com/delete-agent/$AGENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
999
1000
|
},
|
|
1000
1001
|
python: {
|
|
1001
1002
|
method: 'agent.delete',
|
|
1002
1003
|
example:
|
|
1003
|
-
'
|
|
1004
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.agent.delete(\n "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)',
|
|
1004
1005
|
},
|
|
1005
1006
|
typescript: {
|
|
1006
1007
|
method: 'client.agent.delete',
|
|
1007
1008
|
example:
|
|
1008
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1009
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.agent.delete('oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD');",
|
|
1009
1010
|
},
|
|
1010
1011
|
},
|
|
1011
1012
|
},
|
|
@@ -1023,17 +1024,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1023
1024
|
perLanguage: {
|
|
1024
1025
|
http: {
|
|
1025
1026
|
example:
|
|
1026
|
-
'curl https://api.retellai.com/publish-agent/$AGENT_ID \\\n -X POST \\\n -H "Authorization: Bearer $
|
|
1027
|
+
'curl https://api.retellai.com/publish-agent/$AGENT_ID \\\n -X POST \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1027
1028
|
},
|
|
1028
1029
|
python: {
|
|
1029
1030
|
method: 'agent.publish',
|
|
1030
1031
|
example:
|
|
1031
|
-
'
|
|
1032
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.agent.publish(\n "16b980523634a6dc504898cda492e939",\n)',
|
|
1032
1033
|
},
|
|
1033
1034
|
typescript: {
|
|
1034
1035
|
method: 'client.agent.publish',
|
|
1035
1036
|
example:
|
|
1036
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1037
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.agent.publish('16b980523634a6dc504898cda492e939');",
|
|
1037
1038
|
},
|
|
1038
1039
|
},
|
|
1039
1040
|
},
|
|
@@ -1052,17 +1053,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1052
1053
|
perLanguage: {
|
|
1053
1054
|
http: {
|
|
1054
1055
|
example:
|
|
1055
|
-
'curl https://api.retellai.com/get-agent-versions/$AGENT_ID \\\n -H "Authorization: Bearer $
|
|
1056
|
+
'curl https://api.retellai.com/get-agent-versions/$AGENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1056
1057
|
},
|
|
1057
1058
|
python: {
|
|
1058
1059
|
method: 'agent.get_versions',
|
|
1059
1060
|
example:
|
|
1060
|
-
'
|
|
1061
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nagent_responses = client.agent.get_versions(\n "16b980523634a6dc504898cda492e939",\n)\nprint(agent_responses)',
|
|
1061
1062
|
},
|
|
1062
1063
|
typescript: {
|
|
1063
1064
|
method: 'client.agent.getVersions',
|
|
1064
1065
|
example:
|
|
1065
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1066
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponses = await client.agent.getVersions('16b980523634a6dc504898cda492e939');\n\nconsole.log(agentResponses);",
|
|
1066
1067
|
},
|
|
1067
1068
|
},
|
|
1068
1069
|
},
|
|
@@ -1105,17 +1106,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1105
1106
|
perLanguage: {
|
|
1106
1107
|
http: {
|
|
1107
1108
|
example:
|
|
1108
|
-
'curl https://api.retellai.com/create-chat-agent \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1109
|
+
'curl https://api.retellai.com/create-chat-agent \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d "{\n \\"response_engine\\": {\n \\"llm_id\\": \\"llm_234sdertfsdsfsdf\\",\n \\"type\\": \\"retell-llm\\",\n \\"version\\": 0\n },\n \\"agent_name\\": \\"Jarvis\\",\n \\"analysis_successful_prompt\\": \\"The agent finished the task and the call was complete without being cutoff.\\",\n \\"analysis_summary_prompt\\": \\"Summarize the call in a few sentences.\\",\n \\"analysis_user_sentiment_prompt\\": \\"Evaluate the user\'s sentiment based on their tone and satisfaction level.\\",\n \\"auto_close_message\\": \\"Thank you for chatting. The conversation has ended.\\",\n \\"data_storage_retention_days\\": 30,\n \\"data_storage_setting\\": \\"everything\\",\n \\"end_chat_after_silence_ms\\": 3600000,\n \\"language\\": \\"en-US\\",\n \\"opt_in_signed_url\\": true,\n \\"post_chat_analysis_model\\": \\"gpt-4.1-mini\\",\n \\"signed_url_expiration_ms\\": 86400000,\n \\"timezone\\": \\"America/New_York\\",\n \\"webhook_timeout_ms\\": 10000,\n \\"webhook_url\\": \\"https://webhook-url-here\\"\n }"',
|
|
1109
1110
|
},
|
|
1110
1111
|
python: {
|
|
1111
1112
|
method: 'chat_agent.create',
|
|
1112
1113
|
example:
|
|
1113
|
-
'
|
|
1114
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_agent_response = client.chat_agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n)\nprint(chat_agent_response.agent_id)',
|
|
1114
1115
|
},
|
|
1115
1116
|
typescript: {
|
|
1116
1117
|
method: 'client.chatAgent.create',
|
|
1117
1118
|
example:
|
|
1118
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1119
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatAgentResponse = await client.chatAgent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n});\n\nconsole.log(chatAgentResponse.agent_id);",
|
|
1119
1120
|
},
|
|
1120
1121
|
},
|
|
1121
1122
|
},
|
|
@@ -1135,17 +1136,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1135
1136
|
perLanguage: {
|
|
1136
1137
|
http: {
|
|
1137
1138
|
example:
|
|
1138
|
-
'curl https://api.retellai.com/get-chat-agent/$AGENT_ID \\\n -H "Authorization: Bearer $
|
|
1139
|
+
'curl https://api.retellai.com/get-chat-agent/$AGENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1139
1140
|
},
|
|
1140
1141
|
python: {
|
|
1141
1142
|
method: 'chat_agent.retrieve',
|
|
1142
1143
|
example:
|
|
1143
|
-
'
|
|
1144
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_agent_response = client.chat_agent.retrieve(\n agent_id="16b980523634a6dc504898cda492e939",\n)\nprint(chat_agent_response.agent_id)',
|
|
1144
1145
|
},
|
|
1145
1146
|
typescript: {
|
|
1146
1147
|
method: 'client.chatAgent.retrieve',
|
|
1147
1148
|
example:
|
|
1148
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1149
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatAgentResponse = await client.chatAgent.retrieve('16b980523634a6dc504898cda492e939');\n\nconsole.log(chatAgentResponse.agent_id);",
|
|
1149
1150
|
},
|
|
1150
1151
|
},
|
|
1151
1152
|
},
|
|
@@ -1164,17 +1165,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1164
1165
|
"## list\n\n`client.chatAgent.list(limit?: number, pagination_key?: string, pagination_key_version?: number): object[]`\n\n**get** `/list-chat-agents`\n\nList all chat agents\n\n### Parameters\n\n- `limit?: number`\n A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 1000.\n\n- `pagination_key?: string`\n The pagination key to continue fetching the next page of agents. Pagination key is represented by a agent id, pagination key and version pair is exclusive (not included in the fetched page). If not set, will start from the beginning.\n\n- `pagination_key_version?: number`\n Specifies the version of the agent associated with the pagination_key. When paginating, both the pagination_key and its version must be provided to ensure consistent ordering and to fetch the next page correctly.\n\n### Returns\n\n- `{ agent_id: string; last_modification_timestamp: number; response_engine: { llm_id: string; type: 'retell-llm'; version?: number; } | { llm_websocket_url: string; type: 'custom-llm'; } | { conversation_flow_id: string; type: 'conversation-flow'; version?: number; }; agent_name?: string; analysis_successful_prompt?: string; analysis_summary_prompt?: string; analysis_user_sentiment_prompt?: string; auto_close_message?: string; data_storage_retention_days?: number; data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only'; end_chat_after_silence_ms?: number; guardrail_config?: { input_topics?: 'platform_integrity_jailbreaking'[]; output_topics?: string[]; }; handbook_config?: { ai_disclosure?: boolean; default_personality?: boolean; high_empathy?: boolean; scope_boundaries?: boolean; }; is_public?: boolean; is_published?: boolean; language?: string; opt_in_signed_url?: boolean; pii_config?: { categories: string[]; mode: 'post_call'; }; post_chat_analysis_data?: { description: string; name: string; type: 'string'; conditional_prompt?: string; examples?: string[]; required?: boolean; } | { choices: string[]; description: string; name: string; type: 'enum'; conditional_prompt?: string; required?: boolean; } | { description: string; name: string; type: 'boolean'; conditional_prompt?: string; required?: boolean; } | { description: string; name: string; type: 'number'; conditional_prompt?: string; required?: boolean; } | { name: 'chat_summary' | 'chat_successful' | 'user_sentiment'; type: 'system-presets'; conditional_prompt?: string; description?: string; required?: boolean; }[]; post_chat_analysis_model?: string; signed_url_expiration_ms?: number; timezone?: string; version?: number; webhook_events?: 'chat_started' | 'chat_ended' | 'chat_analyzed'[]; webhook_timeout_ms?: number; webhook_url?: string; }[]`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst chatAgentResponses = await client.chatAgent.list();\n\nconsole.log(chatAgentResponses);\n```",
|
|
1165
1166
|
perLanguage: {
|
|
1166
1167
|
http: {
|
|
1167
|
-
example:
|
|
1168
|
+
example:
|
|
1169
|
+
'curl https://api.retellai.com/list-chat-agents \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1168
1170
|
},
|
|
1169
1171
|
python: {
|
|
1170
1172
|
method: 'chat_agent.list',
|
|
1171
1173
|
example:
|
|
1172
|
-
'
|
|
1174
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_agent_responses = client.chat_agent.list()\nprint(chat_agent_responses)',
|
|
1173
1175
|
},
|
|
1174
1176
|
typescript: {
|
|
1175
1177
|
method: 'client.chatAgent.list',
|
|
1176
1178
|
example:
|
|
1177
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1179
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatAgentResponses = await client.chatAgent.list();\n\nconsole.log(chatAgentResponses);",
|
|
1178
1180
|
},
|
|
1179
1181
|
},
|
|
1180
1182
|
},
|
|
@@ -1219,17 +1221,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1219
1221
|
perLanguage: {
|
|
1220
1222
|
http: {
|
|
1221
1223
|
example:
|
|
1222
|
-
'curl https://api.retellai.com/update-chat-agent/$AGENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1224
|
+
'curl https://api.retellai.com/update-chat-agent/$AGENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d "{\n \\"agent_name\\": \\"Jarvis\\",\n \\"analysis_successful_prompt\\": \\"The agent finished the task and the call was complete without being cutoff.\\",\n \\"analysis_summary_prompt\\": \\"Summarize the call in a few sentences.\\",\n \\"analysis_user_sentiment_prompt\\": \\"Evaluate the user\'s sentiment based on their tone and satisfaction level.\\",\n \\"auto_close_message\\": \\"Thank you for chatting. The conversation has ended.\\",\n \\"data_storage_retention_days\\": 30,\n \\"data_storage_setting\\": \\"everything\\",\n \\"end_chat_after_silence_ms\\": 3600000,\n \\"language\\": \\"en-US\\",\n \\"opt_in_signed_url\\": true,\n \\"post_chat_analysis_model\\": \\"gpt-4.1-mini\\",\n \\"response_engine\\": {\n \\"llm_id\\": \\"llm_234sdertfsdsfsdf\\",\n \\"type\\": \\"retell-llm\\",\n \\"version\\": 0\n },\n \\"signed_url_expiration_ms\\": 86400000,\n \\"timezone\\": \\"America/New_York\\",\n \\"webhook_timeout_ms\\": 10000,\n \\"webhook_url\\": \\"https://webhook-url-here\\"\n }"',
|
|
1223
1225
|
},
|
|
1224
1226
|
python: {
|
|
1225
1227
|
method: 'chat_agent.update',
|
|
1226
1228
|
example:
|
|
1227
|
-
'
|
|
1229
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_agent_response = client.chat_agent.update(\n agent_id="16b980523634a6dc504898cda492e939",\n)\nprint(chat_agent_response.agent_id)',
|
|
1228
1230
|
},
|
|
1229
1231
|
typescript: {
|
|
1230
1232
|
method: 'client.chatAgent.update',
|
|
1231
1233
|
example:
|
|
1232
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1234
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatAgentResponse = await client.chatAgent.update('16b980523634a6dc504898cda492e939');\n\nconsole.log(chatAgentResponse.agent_id);",
|
|
1233
1235
|
},
|
|
1234
1236
|
},
|
|
1235
1237
|
},
|
|
@@ -1247,17 +1249,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1247
1249
|
perLanguage: {
|
|
1248
1250
|
http: {
|
|
1249
1251
|
example:
|
|
1250
|
-
'curl https://api.retellai.com/delete-chat-agent/$AGENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
1252
|
+
'curl https://api.retellai.com/delete-chat-agent/$AGENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1251
1253
|
},
|
|
1252
1254
|
python: {
|
|
1253
1255
|
method: 'chat_agent.delete',
|
|
1254
1256
|
example:
|
|
1255
|
-
'
|
|
1257
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.chat_agent.delete(\n "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)',
|
|
1256
1258
|
},
|
|
1257
1259
|
typescript: {
|
|
1258
1260
|
method: 'client.chatAgent.delete',
|
|
1259
1261
|
example:
|
|
1260
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1262
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chatAgent.delete('oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD');",
|
|
1261
1263
|
},
|
|
1262
1264
|
},
|
|
1263
1265
|
},
|
|
@@ -1276,17 +1278,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1276
1278
|
perLanguage: {
|
|
1277
1279
|
http: {
|
|
1278
1280
|
example:
|
|
1279
|
-
'curl https://api.retellai.com/publish-chat-agent/$AGENT_ID \\\n -X POST \\\n -H "Authorization: Bearer $
|
|
1281
|
+
'curl https://api.retellai.com/publish-chat-agent/$AGENT_ID \\\n -X POST \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1280
1282
|
},
|
|
1281
1283
|
python: {
|
|
1282
1284
|
method: 'chat_agent.publish',
|
|
1283
1285
|
example:
|
|
1284
|
-
'
|
|
1286
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.chat_agent.publish(\n "16b980523634a6dc504898cda492e939",\n)',
|
|
1285
1287
|
},
|
|
1286
1288
|
typescript: {
|
|
1287
1289
|
method: 'client.chatAgent.publish',
|
|
1288
1290
|
example:
|
|
1289
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1291
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.chatAgent.publish('16b980523634a6dc504898cda492e939');",
|
|
1290
1292
|
},
|
|
1291
1293
|
},
|
|
1292
1294
|
},
|
|
@@ -1306,17 +1308,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1306
1308
|
perLanguage: {
|
|
1307
1309
|
http: {
|
|
1308
1310
|
example:
|
|
1309
|
-
'curl https://api.retellai.com/get-chat-agent-versions/$AGENT_ID \\\n -H "Authorization: Bearer $
|
|
1311
|
+
'curl https://api.retellai.com/get-chat-agent-versions/$AGENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1310
1312
|
},
|
|
1311
1313
|
python: {
|
|
1312
1314
|
method: 'chat_agent.get_versions',
|
|
1313
1315
|
example:
|
|
1314
|
-
'
|
|
1316
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nchat_agent_responses = client.chat_agent.get_versions(\n "16b980523634a6dc504898cda492e939",\n)\nprint(chat_agent_responses)',
|
|
1315
1317
|
},
|
|
1316
1318
|
typescript: {
|
|
1317
1319
|
method: 'client.chatAgent.getVersions',
|
|
1318
1320
|
example:
|
|
1319
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1321
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatAgentResponses = await client.chatAgent.getVersions('16b980523634a6dc504898cda492e939');\n\nconsole.log(chatAgentResponses);",
|
|
1320
1322
|
},
|
|
1321
1323
|
},
|
|
1322
1324
|
},
|
|
@@ -1355,17 +1357,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1355
1357
|
perLanguage: {
|
|
1356
1358
|
http: {
|
|
1357
1359
|
example:
|
|
1358
|
-
'curl https://api.retellai.com/create-retell-llm \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1360
|
+
'curl https://api.retellai.com/create-retell-llm \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "begin_after_user_silence_ms": 2000,\n "begin_message": "Hey I am a virtual assistant calling from Retell Hospital.",\n "default_dynamic_variables": {\n "customer_name": "John Doe"\n },\n "general_prompt": "You are ...",\n "general_tools": [\n {\n "name": "end_call",\n "type": "end_call",\n "description": "End the call with user."\n }\n ],\n "model": "gpt-4.1",\n "model_high_priority": true,\n "s2s_model": "gpt-realtime-1.5",\n "starting_state": "information_collection",\n "states": [\n {\n "name": "information_collection",\n "edges": [\n {\n "description": "Transition to book an appointment.",\n "destination_state_name": "appointment_booking"\n }\n ],\n "state_prompt": "You will follow the steps below to collect information...",\n "tools": [\n {\n "name": "transfer_to_support",\n "transfer_destination": {\n "number": "16175551212",\n "type": "predefined"\n },\n "transfer_option": {\n "type": "cold_transfer",\n "show_transferee_as_caller": false\n },\n "type": "transfer_call",\n "description": "Transfer to the support team."\n }\n ]\n },\n {\n "name": "appointment_booking",\n "state_prompt": "You will follow the steps below to book an appointment...",\n "tools": [\n {\n "cal_api_key": "cal_live_xxxxxxxxxxxx",\n "event_type_id": 60444,\n "name": "book_appointment",\n "type": "book_appointment_cal",\n "description": "Book an annual check up.",\n "timezone": "America/Los_Angeles"\n }\n ]\n }\n ],\n "tool_call_strict_mode": true,\n "version": 1\n }\'',
|
|
1359
1361
|
},
|
|
1360
1362
|
python: {
|
|
1361
1363
|
method: 'llm.create',
|
|
1362
1364
|
example:
|
|
1363
|
-
'
|
|
1365
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nllm_response = client.llm.create()\nprint(llm_response.llm_id)',
|
|
1364
1366
|
},
|
|
1365
1367
|
typescript: {
|
|
1366
1368
|
method: 'client.llm.create',
|
|
1367
1369
|
example:
|
|
1368
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1370
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst llmResponse = await client.llm.create();\n\nconsole.log(llmResponse.llm_id);",
|
|
1369
1371
|
},
|
|
1370
1372
|
},
|
|
1371
1373
|
},
|
|
@@ -1385,17 +1387,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1385
1387
|
perLanguage: {
|
|
1386
1388
|
http: {
|
|
1387
1389
|
example:
|
|
1388
|
-
'curl https://api.retellai.com/get-retell-llm/$LLM_ID \\\n -H "Authorization: Bearer $
|
|
1390
|
+
'curl https://api.retellai.com/get-retell-llm/$LLM_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1389
1391
|
},
|
|
1390
1392
|
python: {
|
|
1391
1393
|
method: 'llm.retrieve',
|
|
1392
1394
|
example:
|
|
1393
|
-
'
|
|
1395
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nllm_response = client.llm.retrieve(\n llm_id="16b980523634a6dc504898cda492e939",\n)\nprint(llm_response.llm_id)',
|
|
1394
1396
|
},
|
|
1395
1397
|
typescript: {
|
|
1396
1398
|
method: 'client.llm.retrieve',
|
|
1397
1399
|
example:
|
|
1398
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1400
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939');\n\nconsole.log(llmResponse.llm_id);",
|
|
1399
1401
|
},
|
|
1400
1402
|
},
|
|
1401
1403
|
},
|
|
@@ -1414,17 +1416,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1414
1416
|
"## list\n\n`client.llm.list(limit?: number, pagination_key?: string, pagination_key_version?: number): object[]`\n\n**get** `/list-retell-llms`\n\nList all Retell LLM Response Engines that can be attached to an agent.\n\n### Parameters\n\n- `limit?: number`\n A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 1000.\n\n- `pagination_key?: string`\n The pagination key to continue fetching the next page of LLMs. Pagination key is represented by a llm id, pagination key and version pair is exclusive (not included in the fetched page). If not set, will start from the beginning.\n\n- `pagination_key_version?: number`\n Specifies the version of the llm associated with the pagination_key. When paginating, both the pagination_key and its version must be provided to ensure consistent ordering and to fetch the next page correctly.\n\n### Returns\n\n- `{ last_modification_timestamp: number; llm_id: string; begin_after_user_silence_ms?: number; begin_message?: string; default_dynamic_variables?: object; general_prompt?: string; general_tools?: { name: string; type: 'end_call'; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; speak_during_execution?: boolean; } | { name: string; transfer_destination: object | object; transfer_option: object | object | object; type: 'transfer_call'; custom_sip_headers?: object; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; ignore_e164_validation?: boolean; speak_during_execution?: boolean; } | { cal_api_key: string; event_type_id: number | string; name: string; type: 'check_availability_cal'; description?: string; timezone?: string; } | { cal_api_key: string; event_type_id: number | string; name: string; type: 'book_appointment_cal'; description?: string; timezone?: string; } | { agent_id: string; name: string; post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; agent_version?: number; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; keep_current_language?: boolean; keep_current_voice?: boolean; speak_during_execution?: boolean; webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } | { name: string; type: 'press_digit'; delay_ms?: number; description?: string; } | { name: string; sms_content: object | object; type: 'send_sms'; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; speak_during_execution?: boolean; } | { name: string; type: 'custom'; url: string; args_at_root?: boolean; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; headers?: object; method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; parameters?: object; query_params?: object; response_variables?: object; speak_after_execution?: boolean; speak_during_execution?: boolean; timeout_ms?: number; } | { code: string; name: string; type: 'code'; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; response_variables?: object; speak_after_execution?: boolean; speak_during_execution?: boolean; timeout_ms?: number; } | { description: string; name: string; type: 'extract_dynamic_variable'; variables: object | object | object | object[]; } | { name: string; type: 'bridge_transfer'; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; speak_during_execution?: boolean; } | { name: string; type: 'cancel_transfer'; description?: string; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; speak_during_execution?: boolean; } | { description: string; name: string; type: 'mcp'; execution_message_description?: string; execution_message_type?: 'prompt' | 'static_text'; input_schema?: object; mcp_id?: string; response_variables?: object; speak_after_execution?: boolean; speak_during_execution?: boolean; }[]; is_published?: boolean; kb_config?: { filter_score?: number; top_k?: number; }; knowledge_base_ids?: string[]; mcps?: { name: string; url: string; headers?: object; query_params?: object; timeout_ms?: number; }[]; model?: string; model_high_priority?: boolean; model_temperature?: number; s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini'; start_speaker?: 'user' | 'agent'; starting_state?: string; states?: { name: string; edges?: object[]; state_prompt?: string; tools?: object | object | object | object | object | object | object | object | object | object | object | object | object[]; }[]; tool_call_strict_mode?: boolean; version?: number; }[]`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst llmResponses = await client.llm.list();\n\nconsole.log(llmResponses);\n```",
|
|
1415
1417
|
perLanguage: {
|
|
1416
1418
|
http: {
|
|
1417
|
-
example:
|
|
1419
|
+
example:
|
|
1420
|
+
'curl https://api.retellai.com/list-retell-llms \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1418
1421
|
},
|
|
1419
1422
|
python: {
|
|
1420
1423
|
method: 'llm.list',
|
|
1421
1424
|
example:
|
|
1422
|
-
'
|
|
1425
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nllm_responses = client.llm.list()\nprint(llm_responses)',
|
|
1423
1426
|
},
|
|
1424
1427
|
typescript: {
|
|
1425
1428
|
method: 'client.llm.list',
|
|
1426
1429
|
example:
|
|
1427
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1430
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst llmResponses = await client.llm.list();\n\nconsole.log(llmResponses);",
|
|
1428
1431
|
},
|
|
1429
1432
|
},
|
|
1430
1433
|
},
|
|
@@ -1464,17 +1467,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1464
1467
|
perLanguage: {
|
|
1465
1468
|
http: {
|
|
1466
1469
|
example:
|
|
1467
|
-
'curl https://api.retellai.com/update-retell-llm/$LLM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1470
|
+
'curl https://api.retellai.com/update-retell-llm/$LLM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "begin_after_user_silence_ms": 2000,\n "begin_message": "Hey I am a virtual assistant calling from Retell Hospital.",\n "default_dynamic_variables": {\n "customer_name": "John Doe"\n },\n "general_prompt": "You are ...",\n "general_tools": [\n {\n "name": "end_call",\n "type": "end_call",\n "description": "End the call with user."\n }\n ],\n "model": "gpt-4.1",\n "model_high_priority": true,\n "s2s_model": "gpt-realtime-1.5",\n "starting_state": "information_collection",\n "states": [\n {\n "name": "information_collection",\n "edges": [\n {\n "description": "Transition to book an appointment.",\n "destination_state_name": "appointment_booking"\n }\n ],\n "state_prompt": "You will follow the steps below to collect information...",\n "tools": [\n {\n "name": "transfer_to_support",\n "transfer_destination": {\n "number": "16175551212",\n "type": "predefined"\n },\n "transfer_option": {\n "type": "cold_transfer",\n "show_transferee_as_caller": false\n },\n "type": "transfer_call",\n "description": "Transfer to the support team."\n }\n ]\n },\n {\n "name": "appointment_booking",\n "state_prompt": "You will follow the steps below to book an appointment...",\n "tools": [\n {\n "cal_api_key": "cal_live_xxxxxxxxxxxx",\n "event_type_id": 60444,\n "name": "book_appointment",\n "type": "book_appointment_cal",\n "description": "Book an annual check up.",\n "timezone": "America/Los_Angeles"\n }\n ]\n }\n ],\n "tool_call_strict_mode": true,\n "version": 1\n }\'',
|
|
1468
1471
|
},
|
|
1469
1472
|
python: {
|
|
1470
1473
|
method: 'llm.update',
|
|
1471
1474
|
example:
|
|
1472
|
-
'
|
|
1475
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nllm_response = client.llm.update(\n llm_id="16b980523634a6dc504898cda492e939",\n begin_message="Hey I am a virtual assistant calling from Retell Hospital.",\n)\nprint(llm_response.llm_id)',
|
|
1473
1476
|
},
|
|
1474
1477
|
typescript: {
|
|
1475
1478
|
method: 'client.llm.update',
|
|
1476
1479
|
example:
|
|
1477
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1480
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {\n begin_message: 'Hey I am a virtual assistant calling from Retell Hospital.',\n});\n\nconsole.log(llmResponse.llm_id);",
|
|
1478
1481
|
},
|
|
1479
1482
|
},
|
|
1480
1483
|
},
|
|
@@ -1492,17 +1495,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1492
1495
|
perLanguage: {
|
|
1493
1496
|
http: {
|
|
1494
1497
|
example:
|
|
1495
|
-
'curl https://api.retellai.com/delete-retell-llm/$LLM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
1498
|
+
'curl https://api.retellai.com/delete-retell-llm/$LLM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1496
1499
|
},
|
|
1497
1500
|
python: {
|
|
1498
1501
|
method: 'llm.delete',
|
|
1499
1502
|
example:
|
|
1500
|
-
'
|
|
1503
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.llm.delete(\n "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n)',
|
|
1501
1504
|
},
|
|
1502
1505
|
typescript: {
|
|
1503
1506
|
method: 'client.llm.delete',
|
|
1504
1507
|
example:
|
|
1505
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1508
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.llm.delete('oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD');",
|
|
1506
1509
|
},
|
|
1507
1510
|
},
|
|
1508
1511
|
},
|
|
@@ -1541,17 +1544,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1541
1544
|
perLanguage: {
|
|
1542
1545
|
http: {
|
|
1543
1546
|
example:
|
|
1544
|
-
'curl https://api.retellai.com/create-conversation-flow \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1547
|
+
'curl https://api.retellai.com/create-conversation-flow \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "model_choice": {\n "model": "gpt-4.1",\n "type": "cascading"\n },\n "nodes": [\n {\n "id": "start",\n "instruction": {\n "text": "Greet the customer and ask how you can help them.",\n "type": "prompt"\n },\n "type": "conversation",\n "edges": [\n {\n "id": "edge_1",\n "transition_condition": {\n "prompt": "Customer wants to book appointment",\n "type": "prompt"\n },\n "destination_node_id": "book_appointment"\n }\n ]\n }\n ],\n "start_speaker": "agent",\n "begin_after_user_silence_ms": 2000,\n "default_dynamic_variables": {\n "company_name": "Retell Inc",\n "support_hours": "9 AM - 5 PM"\n },\n "global_prompt": "You are a helpful customer service agent.",\n "knowledge_base_ids": [\n "kb_001",\n "kb_002"\n ],\n "model_temperature": 0.7,\n "start_node_id": "start",\n "tool_call_strict_mode": true,\n "tools": [\n {\n "name": "get_customer_info",\n "type": "custom",\n "url": "https://api.example.com/customer",\n "description": "Get customer information from database",\n "method": "GET",\n "tool_id": "tool_001"\n }\n ]\n }\'',
|
|
1545
1548
|
},
|
|
1546
1549
|
python: {
|
|
1547
1550
|
method: 'conversation_flow.create',
|
|
1548
1551
|
example:
|
|
1549
|
-
'
|
|
1552
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_response = client.conversation_flow.create(\n model_choice={\n "model": "gpt-4.1",\n "type": "cascading",\n },\n nodes=[{\n "id": "start",\n "instruction": {\n "text": "Greet the customer and ask how you can help them.",\n "type": "prompt",\n },\n "type": "conversation",\n }],\n start_speaker="agent",\n)\nprint(conversation_flow_response.conversation_flow_id)',
|
|
1550
1553
|
},
|
|
1551
1554
|
typescript: {
|
|
1552
1555
|
method: 'client.conversationFlow.create',
|
|
1553
1556
|
example:
|
|
1554
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1557
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowResponse = await client.conversationFlow.create({\n model_choice: { model: 'gpt-4.1', type: 'cascading' },\n nodes: [\n {\n id: 'start',\n instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },\n type: 'conversation',\n },\n ],\n start_speaker: 'agent',\n});\n\nconsole.log(conversationFlowResponse.conversation_flow_id);",
|
|
1555
1558
|
},
|
|
1556
1559
|
},
|
|
1557
1560
|
},
|
|
@@ -1571,17 +1574,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1571
1574
|
perLanguage: {
|
|
1572
1575
|
http: {
|
|
1573
1576
|
example:
|
|
1574
|
-
'curl https://api.retellai.com/get-conversation-flow/$CONVERSATION_FLOW_ID \\\n -H "Authorization: Bearer $
|
|
1577
|
+
'curl https://api.retellai.com/get-conversation-flow/$CONVERSATION_FLOW_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1575
1578
|
},
|
|
1576
1579
|
python: {
|
|
1577
1580
|
method: 'conversation_flow.retrieve',
|
|
1578
1581
|
example:
|
|
1579
|
-
'
|
|
1582
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_response = client.conversation_flow.retrieve(\n conversation_flow_id="conversation_flow_id",\n)\nprint(conversation_flow_response.conversation_flow_id)',
|
|
1580
1583
|
},
|
|
1581
1584
|
typescript: {
|
|
1582
1585
|
method: 'client.conversationFlow.retrieve',
|
|
1583
1586
|
example:
|
|
1584
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1587
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowResponse = await client.conversationFlow.retrieve('conversation_flow_id');\n\nconsole.log(conversationFlowResponse.conversation_flow_id);",
|
|
1585
1588
|
},
|
|
1586
1589
|
},
|
|
1587
1590
|
},
|
|
@@ -1601,17 +1604,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1601
1604
|
perLanguage: {
|
|
1602
1605
|
http: {
|
|
1603
1606
|
example:
|
|
1604
|
-
'curl https://api.retellai.com/list-conversation-flows \\\n -H "Authorization: Bearer $
|
|
1607
|
+
'curl https://api.retellai.com/list-conversation-flows \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1605
1608
|
},
|
|
1606
1609
|
python: {
|
|
1607
1610
|
method: 'conversation_flow.list',
|
|
1608
1611
|
example:
|
|
1609
|
-
'
|
|
1612
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_responses = client.conversation_flow.list()\nprint(conversation_flow_responses)',
|
|
1610
1613
|
},
|
|
1611
1614
|
typescript: {
|
|
1612
1615
|
method: 'client.conversationFlow.list',
|
|
1613
1616
|
example:
|
|
1614
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1617
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowResponses = await client.conversationFlow.list();\n\nconsole.log(conversationFlowResponses);",
|
|
1615
1618
|
},
|
|
1616
1619
|
},
|
|
1617
1620
|
},
|
|
@@ -1651,17 +1654,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1651
1654
|
perLanguage: {
|
|
1652
1655
|
http: {
|
|
1653
1656
|
example:
|
|
1654
|
-
'curl https://api.retellai.com/update-conversation-flow/$CONVERSATION_FLOW_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1657
|
+
'curl https://api.retellai.com/update-conversation-flow/$CONVERSATION_FLOW_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "begin_after_user_silence_ms": 2000,\n "default_dynamic_variables": {\n "company_name": "Retell Inc",\n "support_hours": "9 AM - 5 PM"\n },\n "global_prompt": "You are a helpful customer service agent.",\n "knowledge_base_ids": [\n "kb_001",\n "kb_002"\n ],\n "model_temperature": 0.7,\n "nodes": [\n {\n "id": "start",\n "instruction": {\n "text": "Greet the customer and ask how you can help them.",\n "type": "prompt"\n },\n "type": "conversation",\n "edges": [\n {\n "id": "edge_1",\n "transition_condition": {\n "prompt": "Customer wants to book appointment",\n "type": "prompt"\n },\n "destination_node_id": "book_appointment"\n }\n ]\n }\n ],\n "start_node_id": "start",\n "start_speaker": "agent",\n "tool_call_strict_mode": true,\n "tools": [\n {\n "name": "get_customer_info",\n "type": "custom",\n "url": "https://api.example.com/customer",\n "description": "Get customer information from database",\n "method": "GET",\n "tool_id": "tool_001"\n }\n ]\n }\'',
|
|
1655
1658
|
},
|
|
1656
1659
|
python: {
|
|
1657
1660
|
method: 'conversation_flow.update',
|
|
1658
1661
|
example:
|
|
1659
|
-
'
|
|
1662
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_response = client.conversation_flow.update(\n conversation_flow_id="conversation_flow_id",\n)\nprint(conversation_flow_response.conversation_flow_id)',
|
|
1660
1663
|
},
|
|
1661
1664
|
typescript: {
|
|
1662
1665
|
method: 'client.conversationFlow.update',
|
|
1663
1666
|
example:
|
|
1664
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1667
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowResponse = await client.conversationFlow.update('conversation_flow_id');\n\nconsole.log(conversationFlowResponse.conversation_flow_id);",
|
|
1665
1668
|
},
|
|
1666
1669
|
},
|
|
1667
1670
|
},
|
|
@@ -1679,17 +1682,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1679
1682
|
perLanguage: {
|
|
1680
1683
|
http: {
|
|
1681
1684
|
example:
|
|
1682
|
-
'curl https://api.retellai.com/delete-conversation-flow/$CONVERSATION_FLOW_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
1685
|
+
'curl https://api.retellai.com/delete-conversation-flow/$CONVERSATION_FLOW_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1683
1686
|
},
|
|
1684
1687
|
python: {
|
|
1685
1688
|
method: 'conversation_flow.delete',
|
|
1686
1689
|
example:
|
|
1687
|
-
'
|
|
1690
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.conversation_flow.delete(\n "conversation_flow_id",\n)',
|
|
1688
1691
|
},
|
|
1689
1692
|
typescript: {
|
|
1690
1693
|
method: 'client.conversationFlow.delete',
|
|
1691
1694
|
example:
|
|
1692
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1695
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.conversationFlow.delete('conversation_flow_id');",
|
|
1693
1696
|
},
|
|
1694
1697
|
},
|
|
1695
1698
|
},
|
|
@@ -1717,17 +1720,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1717
1720
|
perLanguage: {
|
|
1718
1721
|
http: {
|
|
1719
1722
|
example:
|
|
1720
|
-
'curl https://api.retellai.com/create-conversation-flow-component \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1723
|
+
'curl https://api.retellai.com/create-conversation-flow-component \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "name": "Customer Information Collector",\n "nodes": [\n {\n "id": "collect_info",\n "instruction": {\n "text": "Ask the customer for their name and contact information.",\n "type": "prompt"\n },\n "type": "conversation"\n }\n ],\n "start_node_id": "collect_info",\n "tools": [\n {\n "name": "get_customer_info",\n "type": "custom",\n "url": "https://api.example.com/customer",\n "description": "Get customer information from database",\n "method": "GET",\n "tool_id": "tool_001"\n }\n ]\n }\'',
|
|
1721
1724
|
},
|
|
1722
1725
|
python: {
|
|
1723
1726
|
method: 'conversation_flow_component.create',
|
|
1724
1727
|
example:
|
|
1725
|
-
'
|
|
1728
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_component_response = client.conversation_flow_component.create(\n name="Customer Information Collector",\n nodes=[{\n "id": "collect_info",\n "instruction": {\n "text": "Ask the customer for their name and contact information.",\n "type": "prompt",\n },\n "type": "conversation",\n }],\n)\nprint(conversation_flow_component_response.conversation_flow_component_id)',
|
|
1726
1729
|
},
|
|
1727
1730
|
typescript: {
|
|
1728
1731
|
method: 'client.conversationFlowComponent.create',
|
|
1729
1732
|
example:
|
|
1730
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1733
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowComponentResponse = await client.conversationFlowComponent.create({\n name: 'Customer Information Collector',\n nodes: [\n {\n id: 'collect_info',\n instruction: {\n text: 'Ask the customer for their name and contact information.',\n type: 'prompt',\n },\n type: 'conversation',\n },\n ],\n});\n\nconsole.log(conversationFlowComponentResponse.conversation_flow_component_id);",
|
|
1731
1734
|
},
|
|
1732
1735
|
},
|
|
1733
1736
|
},
|
|
@@ -1747,17 +1750,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1747
1750
|
perLanguage: {
|
|
1748
1751
|
http: {
|
|
1749
1752
|
example:
|
|
1750
|
-
'curl https://api.retellai.com/get-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -H "Authorization: Bearer $
|
|
1753
|
+
'curl https://api.retellai.com/get-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1751
1754
|
},
|
|
1752
1755
|
python: {
|
|
1753
1756
|
method: 'conversation_flow_component.retrieve',
|
|
1754
1757
|
example:
|
|
1755
|
-
'
|
|
1758
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_component_response = client.conversation_flow_component.retrieve(\n "conversation_flow_component_id",\n)\nprint(conversation_flow_component_response.conversation_flow_component_id)',
|
|
1756
1759
|
},
|
|
1757
1760
|
typescript: {
|
|
1758
1761
|
method: 'client.conversationFlowComponent.retrieve',
|
|
1759
1762
|
example:
|
|
1760
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1763
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowComponentResponse = await client.conversationFlowComponent.retrieve(\n 'conversation_flow_component_id',\n);\n\nconsole.log(conversationFlowComponentResponse.conversation_flow_component_id);",
|
|
1761
1764
|
},
|
|
1762
1765
|
},
|
|
1763
1766
|
},
|
|
@@ -1776,17 +1779,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1776
1779
|
perLanguage: {
|
|
1777
1780
|
http: {
|
|
1778
1781
|
example:
|
|
1779
|
-
'curl https://api.retellai.com/list-conversation-flow-components \\\n -H "Authorization: Bearer $
|
|
1782
|
+
'curl https://api.retellai.com/list-conversation-flow-components \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1780
1783
|
},
|
|
1781
1784
|
python: {
|
|
1782
1785
|
method: 'conversation_flow_component.list',
|
|
1783
1786
|
example:
|
|
1784
|
-
'
|
|
1787
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_component_responses = client.conversation_flow_component.list()\nprint(conversation_flow_component_responses)',
|
|
1785
1788
|
},
|
|
1786
1789
|
typescript: {
|
|
1787
1790
|
method: 'client.conversationFlowComponent.list',
|
|
1788
1791
|
example:
|
|
1789
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1792
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowComponentResponses = await client.conversationFlowComponent.list();\n\nconsole.log(conversationFlowComponentResponses);",
|
|
1790
1793
|
},
|
|
1791
1794
|
},
|
|
1792
1795
|
},
|
|
@@ -1815,17 +1818,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1815
1818
|
perLanguage: {
|
|
1816
1819
|
http: {
|
|
1817
1820
|
example:
|
|
1818
|
-
'curl https://api.retellai.com/update-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
1821
|
+
'curl https://api.retellai.com/update-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "name": "Customer Information Collector",\n "nodes": [\n {\n "id": "collect_info",\n "instruction": {\n "text": "Ask the customer for their name and contact information.",\n "type": "prompt"\n },\n "type": "conversation"\n }\n ],\n "start_node_id": "collect_info",\n "tools": [\n {\n "name": "get_customer_info",\n "type": "custom",\n "url": "https://api.example.com/customer",\n "description": "Get customer information from database",\n "method": "GET",\n "tool_id": "tool_001"\n }\n ]\n }\'',
|
|
1819
1822
|
},
|
|
1820
1823
|
python: {
|
|
1821
1824
|
method: 'conversation_flow_component.update',
|
|
1822
1825
|
example:
|
|
1823
|
-
'
|
|
1826
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconversation_flow_component_response = client.conversation_flow_component.update(\n conversation_flow_component_id="conversation_flow_component_id",\n)\nprint(conversation_flow_component_response.conversation_flow_component_id)',
|
|
1824
1827
|
},
|
|
1825
1828
|
typescript: {
|
|
1826
1829
|
method: 'client.conversationFlowComponent.update',
|
|
1827
1830
|
example:
|
|
1828
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1831
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationFlowComponentResponse = await client.conversationFlowComponent.update(\n 'conversation_flow_component_id',\n);\n\nconsole.log(conversationFlowComponentResponse.conversation_flow_component_id);",
|
|
1829
1832
|
},
|
|
1830
1833
|
},
|
|
1831
1834
|
},
|
|
@@ -1844,17 +1847,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1844
1847
|
perLanguage: {
|
|
1845
1848
|
http: {
|
|
1846
1849
|
example:
|
|
1847
|
-
'curl https://api.retellai.com/delete-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
1850
|
+
'curl https://api.retellai.com/delete-conversation-flow-component/$CONVERSATION_FLOW_COMPONENT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1848
1851
|
},
|
|
1849
1852
|
python: {
|
|
1850
1853
|
method: 'conversation_flow_component.delete',
|
|
1851
1854
|
example:
|
|
1852
|
-
'
|
|
1855
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.conversation_flow_component.delete(\n "conversation_flow_component_id",\n)',
|
|
1853
1856
|
},
|
|
1854
1857
|
typescript: {
|
|
1855
1858
|
method: 'client.conversationFlowComponent.delete',
|
|
1856
1859
|
example:
|
|
1857
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1860
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.conversationFlowComponent.delete('conversation_flow_component_id');",
|
|
1858
1861
|
},
|
|
1859
1862
|
},
|
|
1860
1863
|
},
|
|
@@ -1882,17 +1885,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1882
1885
|
perLanguage: {
|
|
1883
1886
|
http: {
|
|
1884
1887
|
example:
|
|
1885
|
-
'curl https://api.retellai.com/create-knowledge-base \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $
|
|
1888
|
+
'curl https://api.retellai.com/create-knowledge-base \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -F knowledge_base_name=\'Sample KB\' \\\n -F enable_auto_refresh=true \\\n -F knowledge_base_urls=\'["https://www.example.com","https://www.retellai.com"]\' \\\n -F max_chunk_size=2000 \\\n -F min_chunk_size=400',
|
|
1886
1889
|
},
|
|
1887
1890
|
python: {
|
|
1888
1891
|
method: 'knowledge_base.create',
|
|
1889
1892
|
example:
|
|
1890
|
-
'
|
|
1893
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nknowledge_base_response = client.knowledge_base.create(\n knowledge_base_name="Sample KB",\n)\nprint(knowledge_base_response.knowledge_base_id)',
|
|
1891
1894
|
},
|
|
1892
1895
|
typescript: {
|
|
1893
1896
|
method: 'client.knowledgeBase.create',
|
|
1894
1897
|
example:
|
|
1895
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1898
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst knowledgeBaseResponse = await client.knowledgeBase.create({\n knowledge_base_name: 'Sample KB',\n});\n\nconsole.log(knowledgeBaseResponse.knowledge_base_id);",
|
|
1896
1899
|
},
|
|
1897
1900
|
},
|
|
1898
1901
|
},
|
|
@@ -1912,17 +1915,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1912
1915
|
perLanguage: {
|
|
1913
1916
|
http: {
|
|
1914
1917
|
example:
|
|
1915
|
-
'curl https://api.retellai.com/get-knowledge-base/$KNOWLEDGE_BASE_ID \\\n -H "Authorization: Bearer $
|
|
1918
|
+
'curl https://api.retellai.com/get-knowledge-base/$KNOWLEDGE_BASE_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1916
1919
|
},
|
|
1917
1920
|
python: {
|
|
1918
1921
|
method: 'knowledge_base.retrieve',
|
|
1919
1922
|
example:
|
|
1920
|
-
'
|
|
1923
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nknowledge_base_response = client.knowledge_base.retrieve(\n "kb_1234567890",\n)\nprint(knowledge_base_response.knowledge_base_id)',
|
|
1921
1924
|
},
|
|
1922
1925
|
typescript: {
|
|
1923
1926
|
method: 'client.knowledgeBase.retrieve',
|
|
1924
1927
|
example:
|
|
1925
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1928
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst knowledgeBaseResponse = await client.knowledgeBase.retrieve('kb_1234567890');\n\nconsole.log(knowledgeBaseResponse.knowledge_base_id);",
|
|
1926
1929
|
},
|
|
1927
1930
|
},
|
|
1928
1931
|
},
|
|
@@ -1941,17 +1944,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1941
1944
|
perLanguage: {
|
|
1942
1945
|
http: {
|
|
1943
1946
|
example:
|
|
1944
|
-
'curl https://api.retellai.com/list-knowledge-bases \\\n -H "Authorization: Bearer $
|
|
1947
|
+
'curl https://api.retellai.com/list-knowledge-bases \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1945
1948
|
},
|
|
1946
1949
|
python: {
|
|
1947
1950
|
method: 'knowledge_base.list',
|
|
1948
1951
|
example:
|
|
1949
|
-
'
|
|
1952
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nknowledge_base_responses = client.knowledge_base.list()\nprint(knowledge_base_responses)',
|
|
1950
1953
|
},
|
|
1951
1954
|
typescript: {
|
|
1952
1955
|
method: 'client.knowledgeBase.list',
|
|
1953
1956
|
example:
|
|
1954
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1957
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst knowledgeBaseResponses = await client.knowledgeBase.list();\n\nconsole.log(knowledgeBaseResponses);",
|
|
1955
1958
|
},
|
|
1956
1959
|
},
|
|
1957
1960
|
},
|
|
@@ -1969,17 +1972,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1969
1972
|
perLanguage: {
|
|
1970
1973
|
http: {
|
|
1971
1974
|
example:
|
|
1972
|
-
'curl https://api.retellai.com/delete-knowledge-base/$KNOWLEDGE_BASE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
1975
|
+
'curl https://api.retellai.com/delete-knowledge-base/$KNOWLEDGE_BASE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
1973
1976
|
},
|
|
1974
1977
|
python: {
|
|
1975
1978
|
method: 'knowledge_base.delete',
|
|
1976
1979
|
example:
|
|
1977
|
-
'
|
|
1980
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.knowledge_base.delete(\n "kb_1234567890",\n)',
|
|
1978
1981
|
},
|
|
1979
1982
|
typescript: {
|
|
1980
1983
|
method: 'client.knowledgeBase.delete',
|
|
1981
1984
|
example:
|
|
1982
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
1985
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.knowledgeBase.delete('kb_1234567890');",
|
|
1983
1986
|
},
|
|
1984
1987
|
},
|
|
1985
1988
|
},
|
|
@@ -2004,17 +2007,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2004
2007
|
perLanguage: {
|
|
2005
2008
|
http: {
|
|
2006
2009
|
example:
|
|
2007
|
-
'curl https://api.retellai.com/add-knowledge-base-sources/$KNOWLEDGE_BASE_ID \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $
|
|
2010
|
+
'curl https://api.retellai.com/add-knowledge-base-sources/$KNOWLEDGE_BASE_ID \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -F knowledge_base_urls=\'["https://www.example.com","https://www.retellai.com"]\'',
|
|
2008
2011
|
},
|
|
2009
2012
|
python: {
|
|
2010
2013
|
method: 'knowledge_base.add_sources',
|
|
2011
2014
|
example:
|
|
2012
|
-
'
|
|
2015
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nknowledge_base_response = client.knowledge_base.add_sources(\n knowledge_base_id="kb_1234567890",\n)\nprint(knowledge_base_response.knowledge_base_id)',
|
|
2013
2016
|
},
|
|
2014
2017
|
typescript: {
|
|
2015
2018
|
method: 'client.knowledgeBase.addSources',
|
|
2016
2019
|
example:
|
|
2017
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2020
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst knowledgeBaseResponse = await client.knowledgeBase.addSources('kb_1234567890');\n\nconsole.log(knowledgeBaseResponse.knowledge_base_id);",
|
|
2018
2021
|
},
|
|
2019
2022
|
},
|
|
2020
2023
|
},
|
|
@@ -2034,17 +2037,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2034
2037
|
perLanguage: {
|
|
2035
2038
|
http: {
|
|
2036
2039
|
example:
|
|
2037
|
-
'curl https://api.retellai.com/delete-knowledge-base-source/$KNOWLEDGE_BASE_ID/source/$SOURCE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
2040
|
+
'curl https://api.retellai.com/delete-knowledge-base-source/$KNOWLEDGE_BASE_ID/source/$SOURCE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2038
2041
|
},
|
|
2039
2042
|
python: {
|
|
2040
2043
|
method: 'knowledge_base.delete_source',
|
|
2041
2044
|
example:
|
|
2042
|
-
'
|
|
2045
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nknowledge_base_response = client.knowledge_base.delete_source(\n source_id="source_1234567890",\n knowledge_base_id="kb_1234567890",\n)\nprint(knowledge_base_response.knowledge_base_id)',
|
|
2043
2046
|
},
|
|
2044
2047
|
typescript: {
|
|
2045
2048
|
method: 'client.knowledgeBase.deleteSource',
|
|
2046
2049
|
example:
|
|
2047
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2050
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst knowledgeBaseResponse = await client.knowledgeBase.deleteSource('source_1234567890', {\n knowledge_base_id: 'kb_1234567890',\n});\n\nconsole.log(knowledgeBaseResponse.knowledge_base_id);",
|
|
2048
2051
|
},
|
|
2049
2052
|
},
|
|
2050
2053
|
},
|
|
@@ -2069,17 +2072,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2069
2072
|
perLanguage: {
|
|
2070
2073
|
http: {
|
|
2071
2074
|
example:
|
|
2072
|
-
'curl https://api.retellai.com/add-community-voice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
2075
|
+
'curl https://api.retellai.com/add-community-voice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "provider_voice_id": "provider_voice_id",\n "voice_name": "x"\n }\'',
|
|
2073
2076
|
},
|
|
2074
2077
|
python: {
|
|
2075
2078
|
method: 'voice.add_resource',
|
|
2076
2079
|
example:
|
|
2077
|
-
'
|
|
2080
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nvoice_response = client.voice.add_resource(\n provider_voice_id="provider_voice_id",\n voice_name="x",\n)\nprint(voice_response.provider)',
|
|
2078
2081
|
},
|
|
2079
2082
|
typescript: {
|
|
2080
2083
|
method: 'client.voice.addResource',
|
|
2081
2084
|
example:
|
|
2082
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2085
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst voiceResponse = await client.voice.addResource({\n provider_voice_id: 'provider_voice_id',\n voice_name: 'x',\n});\n\nconsole.log(voiceResponse.provider);",
|
|
2083
2086
|
},
|
|
2084
2087
|
},
|
|
2085
2088
|
},
|
|
@@ -2103,17 +2106,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2103
2106
|
perLanguage: {
|
|
2104
2107
|
http: {
|
|
2105
2108
|
example:
|
|
2106
|
-
'curl https://api.retellai.com/clone-voice \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $
|
|
2109
|
+
'curl https://api.retellai.com/clone-voice \\\n -H \'Content-Type: multipart/form-data\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -F files=\'["Example data"]\' \\\n -F voice_name=x \\\n -F voice_provider=elevenlabs',
|
|
2107
2110
|
},
|
|
2108
2111
|
python: {
|
|
2109
2112
|
method: 'voice.clone',
|
|
2110
2113
|
example:
|
|
2111
|
-
'
|
|
2114
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nvoice_response = client.voice.clone(\n files=[b"Example data"],\n voice_name="x",\n voice_provider="elevenlabs",\n)\nprint(voice_response.provider)',
|
|
2112
2115
|
},
|
|
2113
2116
|
typescript: {
|
|
2114
2117
|
method: 'client.voice.clone',
|
|
2115
2118
|
example:
|
|
2116
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2119
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst voiceResponse = await client.voice.clone({\n files: [fs.createReadStream('path/to/file')],\n voice_name: 'x',\n voice_provider: 'elevenlabs',\n});\n\nconsole.log(voiceResponse.provider);",
|
|
2117
2120
|
},
|
|
2118
2121
|
},
|
|
2119
2122
|
},
|
|
@@ -2133,17 +2136,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2133
2136
|
perLanguage: {
|
|
2134
2137
|
http: {
|
|
2135
2138
|
example:
|
|
2136
|
-
'curl https://api.retellai.com/get-voice/$VOICE_ID \\\n -H "Authorization: Bearer $
|
|
2139
|
+
'curl https://api.retellai.com/get-voice/$VOICE_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2137
2140
|
},
|
|
2138
2141
|
python: {
|
|
2139
2142
|
method: 'voice.retrieve',
|
|
2140
2143
|
example:
|
|
2141
|
-
'
|
|
2144
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nvoice_response = client.voice.retrieve(\n "retell-Cimo",\n)\nprint(voice_response.provider)',
|
|
2142
2145
|
},
|
|
2143
2146
|
typescript: {
|
|
2144
2147
|
method: 'client.voice.retrieve',
|
|
2145
2148
|
example:
|
|
2146
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2149
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst voiceResponse = await client.voice.retrieve('retell-Cimo');\n\nconsole.log(voiceResponse.provider);",
|
|
2147
2150
|
},
|
|
2148
2151
|
},
|
|
2149
2152
|
},
|
|
@@ -2161,17 +2164,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2161
2164
|
"## list\n\n`client.voice.list(): object[]`\n\n**get** `/list-voices`\n\nList all voices available to the user\n\n### Returns\n\n- `{ gender: 'male' | 'female'; provider: 'elevenlabs' | 'openai' | 'deepgram' | 'cartesia' | 'minimax' | 'fish_audio' | 'platform'; voice_id: string; voice_name: string; accent?: string; age?: string; preview_audio_url?: string; }[]`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst voiceResponses = await client.voice.list();\n\nconsole.log(voiceResponses);\n```",
|
|
2162
2165
|
perLanguage: {
|
|
2163
2166
|
http: {
|
|
2164
|
-
example:
|
|
2167
|
+
example:
|
|
2168
|
+
'curl https://api.retellai.com/list-voices \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2165
2169
|
},
|
|
2166
2170
|
python: {
|
|
2167
2171
|
method: 'voice.list',
|
|
2168
2172
|
example:
|
|
2169
|
-
'
|
|
2173
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nvoice_responses = client.voice.list()\nprint(voice_responses)',
|
|
2170
2174
|
},
|
|
2171
2175
|
typescript: {
|
|
2172
2176
|
method: 'client.voice.list',
|
|
2173
2177
|
example:
|
|
2174
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2178
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst voiceResponses = await client.voice.list();\n\nconsole.log(voiceResponses);",
|
|
2175
2179
|
},
|
|
2176
2180
|
},
|
|
2177
2181
|
},
|
|
@@ -2194,17 +2198,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2194
2198
|
perLanguage: {
|
|
2195
2199
|
http: {
|
|
2196
2200
|
example:
|
|
2197
|
-
'curl https://api.retellai.com/search-community-voice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
2201
|
+
'curl https://api.retellai.com/search-community-voice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "search_query": "search_query"\n }\'',
|
|
2198
2202
|
},
|
|
2199
2203
|
python: {
|
|
2200
2204
|
method: 'voice.search',
|
|
2201
2205
|
example:
|
|
2202
|
-
'
|
|
2206
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.voice.search(\n search_query="search_query",\n)\nprint(response.voices)',
|
|
2203
2207
|
},
|
|
2204
2208
|
typescript: {
|
|
2205
2209
|
method: 'client.voice.search',
|
|
2206
2210
|
example:
|
|
2207
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2211
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.voice.search({ search_query: 'search_query' });\n\nconsole.log(response.voices);",
|
|
2208
2212
|
},
|
|
2209
2213
|
},
|
|
2210
2214
|
},
|
|
@@ -2222,17 +2226,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2222
2226
|
"## retrieve\n\n`client.concurrency.retrieve(): { base_concurrency?: number; concurrency_burst_enabled?: boolean; concurrency_burst_limit?: number; concurrency_limit?: number; concurrency_purchase_limit?: number; current_concurrency?: number; purchased_concurrency?: number; remaining_purchase_limit?: number; }`\n\n**get** `/get-concurrency`\n\nGet the current concurrency and concurrency limit of the org\n\n### Returns\n\n- `{ base_concurrency?: number; concurrency_burst_enabled?: boolean; concurrency_burst_limit?: number; concurrency_limit?: number; concurrency_purchase_limit?: number; current_concurrency?: number; purchased_concurrency?: number; remaining_purchase_limit?: number; }`\n\n - `base_concurrency?: number`\n - `concurrency_burst_enabled?: boolean`\n - `concurrency_burst_limit?: number`\n - `concurrency_limit?: number`\n - `concurrency_purchase_limit?: number`\n - `current_concurrency?: number`\n - `purchased_concurrency?: number`\n - `remaining_purchase_limit?: number`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst concurrency = await client.concurrency.retrieve();\n\nconsole.log(concurrency);\n```",
|
|
2223
2227
|
perLanguage: {
|
|
2224
2228
|
http: {
|
|
2225
|
-
example:
|
|
2229
|
+
example:
|
|
2230
|
+
'curl https://api.retellai.com/get-concurrency \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2226
2231
|
},
|
|
2227
2232
|
python: {
|
|
2228
2233
|
method: 'concurrency.retrieve',
|
|
2229
2234
|
example:
|
|
2230
|
-
'
|
|
2235
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nconcurrency = client.concurrency.retrieve()\nprint(concurrency.base_concurrency)',
|
|
2231
2236
|
},
|
|
2232
2237
|
typescript: {
|
|
2233
2238
|
method: 'client.concurrency.retrieve',
|
|
2234
2239
|
example:
|
|
2235
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2240
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst concurrency = await client.concurrency.retrieve();\n\nconsole.log(concurrency.base_concurrency);",
|
|
2236
2241
|
},
|
|
2237
2242
|
},
|
|
2238
2243
|
},
|
|
@@ -2259,17 +2264,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2259
2264
|
perLanguage: {
|
|
2260
2265
|
http: {
|
|
2261
2266
|
example:
|
|
2262
|
-
'curl https://api.retellai.com/create-batch-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
2267
|
+
'curl https://api.retellai.com/create-batch-call \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n --max-time 300 \\\n -d \'{\n "from_number": "+14157774444",\n "tasks": [\n {\n "to_number": "+12137774445"\n }\n ],\n "name": "First batch call",\n "trigger_timestamp": 1735718400000\n }\'',
|
|
2263
2268
|
},
|
|
2264
2269
|
python: {
|
|
2265
2270
|
method: 'batch_call.create_batch_call',
|
|
2266
2271
|
example:
|
|
2267
|
-
'
|
|
2272
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nbatch_call_response = client.batch_call.create_batch_call(\n from_number="+14157774444",\n tasks=[{\n "to_number": "+12137774445"\n }],\n)\nprint(batch_call_response.batch_call_id)',
|
|
2268
2273
|
},
|
|
2269
2274
|
typescript: {
|
|
2270
2275
|
method: 'client.batchCall.createBatchCall',
|
|
2271
2276
|
example:
|
|
2272
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2277
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst batchCallResponse = await client.batchCall.createBatchCall({\n from_number: '+14157774444',\n tasks: [{ to_number: '+12137774445' }],\n});\n\nconsole.log(batchCallResponse.batch_call_id);",
|
|
2273
2278
|
},
|
|
2274
2279
|
},
|
|
2275
2280
|
},
|
|
@@ -2297,17 +2302,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2297
2302
|
perLanguage: {
|
|
2298
2303
|
http: {
|
|
2299
2304
|
example:
|
|
2300
|
-
'curl https://api.retellai.com/create-test-case-definition \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
2305
|
+
'curl https://api.retellai.com/create-test-case-definition \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "metrics": [\n "string"\n ],\n "name": "name",\n "response_engine": {\n "llm_id": "llm_id",\n "type": "retell-llm"\n },\n "user_prompt": "user_prompt"\n }\'',
|
|
2301
2306
|
},
|
|
2302
2307
|
python: {
|
|
2303
2308
|
method: 'tests.create_test_case_definition',
|
|
2304
2309
|
example:
|
|
2305
|
-
'
|
|
2310
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_definition_response = client.tests.create_test_case_definition(\n metrics=["string"],\n name="name",\n response_engine={\n "llm_id": "llm_id",\n "type": "retell-llm",\n },\n user_prompt="user_prompt",\n)\nprint(test_case_definition_response.test_case_definition_id)',
|
|
2306
2311
|
},
|
|
2307
2312
|
typescript: {
|
|
2308
2313
|
method: 'client.tests.createTestCaseDefinition',
|
|
2309
2314
|
example:
|
|
2310
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2315
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseDefinitionResponse = await client.tests.createTestCaseDefinition({\n metrics: ['string'],\n name: 'name',\n response_engine: { llm_id: 'llm_id', type: 'retell-llm' },\n user_prompt: 'user_prompt',\n});\n\nconsole.log(testCaseDefinitionResponse.test_case_definition_id);",
|
|
2311
2316
|
},
|
|
2312
2317
|
},
|
|
2313
2318
|
},
|
|
@@ -2327,17 +2332,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2327
2332
|
perLanguage: {
|
|
2328
2333
|
http: {
|
|
2329
2334
|
example:
|
|
2330
|
-
'curl https://api.retellai.com/get-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -H "Authorization: Bearer $
|
|
2335
|
+
'curl https://api.retellai.com/get-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2331
2336
|
},
|
|
2332
2337
|
python: {
|
|
2333
2338
|
method: 'tests.get_test_case_definition',
|
|
2334
2339
|
example:
|
|
2335
|
-
'
|
|
2340
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_definition_response = client.tests.get_test_case_definition(\n "test_case_definition_id",\n)\nprint(test_case_definition_response.test_case_definition_id)',
|
|
2336
2341
|
},
|
|
2337
2342
|
typescript: {
|
|
2338
2343
|
method: 'client.tests.getTestCaseDefinition',
|
|
2339
2344
|
example:
|
|
2340
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2345
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseDefinitionResponse = await client.tests.getTestCaseDefinition(\n 'test_case_definition_id',\n);\n\nconsole.log(testCaseDefinitionResponse.test_case_definition_id);",
|
|
2341
2346
|
},
|
|
2342
2347
|
},
|
|
2343
2348
|
},
|
|
@@ -2362,17 +2367,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2362
2367
|
perLanguage: {
|
|
2363
2368
|
http: {
|
|
2364
2369
|
example:
|
|
2365
|
-
'curl https://api.retellai.com/list-test-case-definitions \\\n -H "Authorization: Bearer $
|
|
2370
|
+
'curl https://api.retellai.com/list-test-case-definitions \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2366
2371
|
},
|
|
2367
2372
|
python: {
|
|
2368
2373
|
method: 'tests.list_test_case_definitions',
|
|
2369
2374
|
example:
|
|
2370
|
-
'
|
|
2375
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_definition_responses = client.tests.list_test_case_definitions(\n type="retell-llm",\n)\nprint(test_case_definition_responses)',
|
|
2371
2376
|
},
|
|
2372
2377
|
typescript: {
|
|
2373
2378
|
method: 'client.tests.listTestCaseDefinitions',
|
|
2374
2379
|
example:
|
|
2375
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2380
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseDefinitionResponses = await client.tests.listTestCaseDefinitions({\n type: 'retell-llm',\n});\n\nconsole.log(testCaseDefinitionResponses);",
|
|
2376
2381
|
},
|
|
2377
2382
|
},
|
|
2378
2383
|
},
|
|
@@ -2401,17 +2406,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2401
2406
|
perLanguage: {
|
|
2402
2407
|
http: {
|
|
2403
2408
|
example:
|
|
2404
|
-
"curl https://api.retellai.com/update-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -X PUT \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $
|
|
2409
|
+
"curl https://api.retellai.com/update-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -X PUT \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $RETELL_API_KEY\" \\\n -d '{}'",
|
|
2405
2410
|
},
|
|
2406
2411
|
python: {
|
|
2407
2412
|
method: 'tests.update_test_case_definition',
|
|
2408
2413
|
example:
|
|
2409
|
-
'
|
|
2414
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_definition_response = client.tests.update_test_case_definition(\n test_case_definition_id="test_case_definition_id",\n)\nprint(test_case_definition_response.test_case_definition_id)',
|
|
2410
2415
|
},
|
|
2411
2416
|
typescript: {
|
|
2412
2417
|
method: 'client.tests.updateTestCaseDefinition',
|
|
2413
2418
|
example:
|
|
2414
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2419
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseDefinitionResponse = await client.tests.updateTestCaseDefinition(\n 'test_case_definition_id',\n);\n\nconsole.log(testCaseDefinitionResponse.test_case_definition_id);",
|
|
2415
2420
|
},
|
|
2416
2421
|
},
|
|
2417
2422
|
},
|
|
@@ -2429,17 +2434,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2429
2434
|
perLanguage: {
|
|
2430
2435
|
http: {
|
|
2431
2436
|
example:
|
|
2432
|
-
'curl https://api.retellai.com/delete-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $
|
|
2437
|
+
'curl https://api.retellai.com/delete-test-case-definition/$TEST_CASE_DEFINITION_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2433
2438
|
},
|
|
2434
2439
|
python: {
|
|
2435
2440
|
method: 'tests.delete_test_case_definition',
|
|
2436
2441
|
example:
|
|
2437
|
-
'
|
|
2442
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nclient.tests.delete_test_case_definition(\n "test_case_definition_id",\n)',
|
|
2438
2443
|
},
|
|
2439
2444
|
typescript: {
|
|
2440
2445
|
method: 'client.tests.deleteTestCaseDefinition',
|
|
2441
2446
|
example:
|
|
2442
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2447
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tests.deleteTestCaseDefinition('test_case_definition_id');",
|
|
2443
2448
|
},
|
|
2444
2449
|
},
|
|
2445
2450
|
},
|
|
@@ -2462,17 +2467,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2462
2467
|
perLanguage: {
|
|
2463
2468
|
http: {
|
|
2464
2469
|
example:
|
|
2465
|
-
'curl https://api.retellai.com/create-batch-test \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $
|
|
2470
|
+
'curl https://api.retellai.com/create-batch-test \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $RETELL_API_KEY" \\\n -d \'{\n "response_engine": {\n "llm_id": "llm_id",\n "type": "retell-llm"\n },\n "test_case_definition_ids": [\n "string"\n ]\n }\'',
|
|
2466
2471
|
},
|
|
2467
2472
|
python: {
|
|
2468
2473
|
method: 'tests.create_batch_test',
|
|
2469
2474
|
example:
|
|
2470
|
-
'
|
|
2475
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nbatch_test_response = client.tests.create_batch_test(\n response_engine={\n "llm_id": "llm_id",\n "type": "retell-llm",\n },\n test_case_definition_ids=["string"],\n)\nprint(batch_test_response.test_case_batch_job_id)',
|
|
2471
2476
|
},
|
|
2472
2477
|
typescript: {
|
|
2473
2478
|
method: 'client.tests.createBatchTest',
|
|
2474
2479
|
example:
|
|
2475
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2480
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst batchTestResponse = await client.tests.createBatchTest({\n response_engine: { llm_id: 'llm_id', type: 'retell-llm' },\n test_case_definition_ids: ['string'],\n});\n\nconsole.log(batchTestResponse.test_case_batch_job_id);",
|
|
2476
2481
|
},
|
|
2477
2482
|
},
|
|
2478
2483
|
},
|
|
@@ -2492,17 +2497,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2492
2497
|
perLanguage: {
|
|
2493
2498
|
http: {
|
|
2494
2499
|
example:
|
|
2495
|
-
'curl https://api.retellai.com/get-batch-test/$TEST_CASE_BATCH_JOB_ID \\\n -H "Authorization: Bearer $
|
|
2500
|
+
'curl https://api.retellai.com/get-batch-test/$TEST_CASE_BATCH_JOB_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2496
2501
|
},
|
|
2497
2502
|
python: {
|
|
2498
2503
|
method: 'tests.get_batch_test',
|
|
2499
2504
|
example:
|
|
2500
|
-
'
|
|
2505
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nbatch_test_response = client.tests.get_batch_test(\n "test_case_batch_job_id",\n)\nprint(batch_test_response.test_case_batch_job_id)',
|
|
2501
2506
|
},
|
|
2502
2507
|
typescript: {
|
|
2503
2508
|
method: 'client.tests.getBatchTest',
|
|
2504
2509
|
example:
|
|
2505
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2510
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst batchTestResponse = await client.tests.getBatchTest('test_case_batch_job_id');\n\nconsole.log(batchTestResponse.test_case_batch_job_id);",
|
|
2506
2511
|
},
|
|
2507
2512
|
},
|
|
2508
2513
|
},
|
|
@@ -2526,17 +2531,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2526
2531
|
"## list-batch-tests\n\n`client.tests.listBatchTests(type: 'retell-llm' | 'conversation-flow', conversation_flow_id?: string, llm_id?: string, version?: number): object[]`\n\n**get** `/list-batch-tests`\n\nList batch test jobs for a response engine\n\n### Parameters\n\n- `type: 'retell-llm' | 'conversation-flow'`\n Type of response engine\n\n- `conversation_flow_id?: string`\n Conversation flow ID (required when type is conversation-flow)\n\n- `llm_id?: string`\n LLM ID (required when type is retell-llm)\n\n- `version?: number`\n Version of the response engine (defaults to latest)\n\n### Returns\n\n- `{ creation_timestamp: number; error_count: number; fail_count: number; pass_count: number; response_engine: { llm_id: string; type: 'retell-llm'; version?: number; } | { llm_websocket_url: string; type: 'custom-llm'; } | { conversation_flow_id: string; type: 'conversation-flow'; version?: number; }; status: 'in_progress' | 'complete'; test_case_batch_job_id: string; total_count: number; user_modified_timestamp: number; }[]`\n\n### Example\n\n```typescript\nimport Retell from 'retell-sdk';\n\nconst client = new Retell();\n\nconst batchTestResponses = await client.tests.listBatchTests({ type: 'retell-llm' });\n\nconsole.log(batchTestResponses);\n```",
|
|
2527
2532
|
perLanguage: {
|
|
2528
2533
|
http: {
|
|
2529
|
-
example:
|
|
2534
|
+
example:
|
|
2535
|
+
'curl https://api.retellai.com/list-batch-tests \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2530
2536
|
},
|
|
2531
2537
|
python: {
|
|
2532
2538
|
method: 'tests.list_batch_tests',
|
|
2533
2539
|
example:
|
|
2534
|
-
'
|
|
2540
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nbatch_test_responses = client.tests.list_batch_tests(\n type="retell-llm",\n)\nprint(batch_test_responses)',
|
|
2535
2541
|
},
|
|
2536
2542
|
typescript: {
|
|
2537
2543
|
method: 'client.tests.listBatchTests',
|
|
2538
2544
|
example:
|
|
2539
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2545
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst batchTestResponses = await client.tests.listBatchTests({ type: 'retell-llm' });\n\nconsole.log(batchTestResponses);",
|
|
2540
2546
|
},
|
|
2541
2547
|
},
|
|
2542
2548
|
},
|
|
@@ -2556,17 +2562,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2556
2562
|
perLanguage: {
|
|
2557
2563
|
http: {
|
|
2558
2564
|
example:
|
|
2559
|
-
'curl https://api.retellai.com/get-test-run/$TEST_CASE_JOB_ID \\\n -H "Authorization: Bearer $
|
|
2565
|
+
'curl https://api.retellai.com/get-test-run/$TEST_CASE_JOB_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2560
2566
|
},
|
|
2561
2567
|
python: {
|
|
2562
2568
|
method: 'tests.get_test_run',
|
|
2563
2569
|
example:
|
|
2564
|
-
'
|
|
2570
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_job_response = client.tests.get_test_run(\n "test_case_job_id",\n)\nprint(test_case_job_response.test_case_definition_id)',
|
|
2565
2571
|
},
|
|
2566
2572
|
typescript: {
|
|
2567
2573
|
method: 'client.tests.getTestRun',
|
|
2568
2574
|
example:
|
|
2569
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2575
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseJobResponse = await client.tests.getTestRun('test_case_job_id');\n\nconsole.log(testCaseJobResponse.test_case_definition_id);",
|
|
2570
2576
|
},
|
|
2571
2577
|
},
|
|
2572
2578
|
},
|
|
@@ -2586,17 +2592,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2586
2592
|
perLanguage: {
|
|
2587
2593
|
http: {
|
|
2588
2594
|
example:
|
|
2589
|
-
'curl https://api.retellai.com/list-test-runs/$TEST_CASE_BATCH_JOB_ID \\\n -H "Authorization: Bearer $
|
|
2595
|
+
'curl https://api.retellai.com/list-test-runs/$TEST_CASE_BATCH_JOB_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2590
2596
|
},
|
|
2591
2597
|
python: {
|
|
2592
2598
|
method: 'tests.list_test_runs',
|
|
2593
2599
|
example:
|
|
2594
|
-
'
|
|
2600
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\ntest_case_job_responses = client.tests.list_test_runs(\n "test_case_batch_job_id",\n)\nprint(test_case_job_responses)',
|
|
2595
2601
|
},
|
|
2596
2602
|
typescript: {
|
|
2597
2603
|
method: 'client.tests.listTestRuns',
|
|
2598
2604
|
example:
|
|
2599
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2605
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst testCaseJobResponses = await client.tests.listTestRuns('test_case_batch_job_id');\n\nconsole.log(testCaseJobResponses);",
|
|
2600
2606
|
},
|
|
2601
2607
|
},
|
|
2602
2608
|
},
|
|
@@ -2615,17 +2621,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2615
2621
|
perLanguage: {
|
|
2616
2622
|
http: {
|
|
2617
2623
|
example:
|
|
2618
|
-
'curl https://api.retellai.com/get-mcp-tools/$AGENT_ID \\\n -H "Authorization: Bearer $
|
|
2624
|
+
'curl https://api.retellai.com/get-mcp-tools/$AGENT_ID \\\n -H "Authorization: Bearer $RETELL_API_KEY"',
|
|
2619
2625
|
},
|
|
2620
2626
|
python: {
|
|
2621
2627
|
method: 'mcp_tool.get_mcp_tools',
|
|
2622
2628
|
example:
|
|
2623
|
-
'
|
|
2629
|
+
'import os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\nmcp_tool_definitions = client.mcp_tool.get_mcp_tools(\n agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",\n mcp_id="mcp-server-1",\n)\nprint(mcp_tool_definitions)',
|
|
2624
2630
|
},
|
|
2625
2631
|
typescript: {
|
|
2626
2632
|
method: 'client.mcpTool.getMcpTools',
|
|
2627
2633
|
example:
|
|
2628
|
-
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: '
|
|
2634
|
+
"import Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst mcpToolDefinitions = await client.mcpTool.getMcpTools('oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD', {\n mcp_id: 'mcp-server-1',\n});\n\nconsole.log(mcpToolDefinitions);",
|
|
2629
2635
|
},
|
|
2630
2636
|
},
|
|
2631
2637
|
},
|
|
@@ -2635,12 +2641,12 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
|
|
|
2635
2641
|
{
|
|
2636
2642
|
language: 'python',
|
|
2637
2643
|
content:
|
|
2638
|
-
'# Retell Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/retell-sdk/)\n\nThe Retell Python library provides convenient access to the Retell REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Retell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40retell-ai%2Fmcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByZXRlbGwtYWkvbWNwLXNlcnZlciJdLCJlbnYiOnsiUkVURUxMX0FQSV9LRVkiOiJZT1VSX1JFVEVMTF9BUElfS0VZIn19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40retell-ai%2Fmcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40retell-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22RETELL_API_KEY%22%3A%22YOUR_RETELL_API_KEY%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.retellai.com](https://docs.retellai.com/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install retell-sdk\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nfrom retell import Retell\n\nclient = Retell(\n api_key="YOUR_RETELL_API_KEY",\n)\n\nagent_response = client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\nprint(agent_response.agent_id)\n```\n\n\n\n## Async usage\n\nSimply import `AsyncRetell` instead of `Retell` and use `await` with each API call:\n\n```python\nimport asyncio\nfrom retell import AsyncRetell\n\nclient = AsyncRetell(\n api_key="YOUR_RETELL_API_KEY",\n)\n\nasync def main() -> None:\n agent_response = await client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\n print(agent_response.agent_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install retell-sdk[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport asyncio\nfrom retell import DefaultAioHttpClient\nfrom retell import AsyncRetell\n\nasync def main() -> None:\n async with AsyncRetell(\n api_key="YOUR_RETELL_API_KEY",\n http_client=DefaultAioHttpClient(),\n) as client:\n agent_response = await client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\n print(agent_response.agent_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom retell import Retell\n\nclient = Retell()\n\nagent_response = client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n custom_stt_config={\n "endpointing_ms": 0,\n "provider": "azure",\n },\n)\nprint(agent_response.custom_stt_config)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `retell.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `retell.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `retell.APIError`.\n\n```python\nimport retell\nfrom retell import Retell\n\nclient = Retell()\n\ntry:\n client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\nexcept retell.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept retell.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept retell.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom retell import Retell\n\n# Configure the default for all requests:\nclient = Retell(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom retell import Retell\n\n# Configure the default for all requests:\nclient = Retell(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Retell(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `RETELL_LOG` to `info`.\n\n```shell\n$ export RETELL_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom retell import Retell\n\nclient = Retell()\nresponse = client.agent.with_raw_response.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nagent = response.parse() # get the object that `agent.create()` would have returned\nprint(agent.agent_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/RetellAI/retell-python-sdk/tree/main/src/retell/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/RetellAI/retell-python-sdk/tree/main/src/retell/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.agent.with_streaming_response.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom retell import Retell, DefaultHttpxClient\n\nclient = Retell(\n # Or use the `RETELL_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom retell import Retell\n\nwith Retell() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/RetellAI/retell-python-sdk/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport retell\nprint(retell.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
2644
|
+
'# Retell Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/retell-sdk/)\n\nThe Retell Python library provides convenient access to the Retell REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Retell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40retell-ai%2Fmcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByZXRlbGwtYWkvbWNwLXNlcnZlciJdLCJlbnYiOnsiUkVURUxMX0FQSV9LRVkiOiJZT1VSX1JFVEVMTF9BUElfS0VZIn19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40retell-ai%2Fmcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40retell-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22RETELL_API_KEY%22%3A%22YOUR_RETELL_API_KEY%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.retellai.com](https://docs.retellai.com/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install retell-sdk\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom retell import Retell\n\nclient = Retell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\n\nagent_response = client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\nprint(agent_response.agent_id)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `RETELL_API_KEY="YOUR_RETELL_API_KEY"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncRetell` instead of `Retell` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom retell import AsyncRetell\n\nclient = AsyncRetell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n agent_response = await client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\n print(agent_response.agent_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install retell-sdk[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom retell import DefaultAioHttpClient\nfrom retell import AsyncRetell\n\nasync def main() -> None:\n async with AsyncRetell(\n api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n agent_response = await client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\n print(agent_response.agent_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom retell import Retell\n\nclient = Retell()\n\nagent_response = client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n custom_stt_config={\n "endpointing_ms": 0,\n "provider": "azure",\n },\n)\nprint(agent_response.custom_stt_config)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `retell.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `retell.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `retell.APIError`.\n\n```python\nimport retell\nfrom retell import Retell\n\nclient = Retell()\n\ntry:\n client.agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n )\nexcept retell.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept retell.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept retell.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom retell import Retell\n\n# Configure the default for all requests:\nclient = Retell(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom retell import Retell\n\n# Configure the default for all requests:\nclient = Retell(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Retell(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).agent.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `RETELL_LOG` to `info`.\n\n```shell\n$ export RETELL_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom retell import Retell\n\nclient = Retell()\nresponse = client.agent.with_raw_response.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nagent = response.parse() # get the object that `agent.create()` would have returned\nprint(agent.agent_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/RetellAI/retell-python-sdk/tree/main/src/retell/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/RetellAI/retell-python-sdk/tree/main/src/retell/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.agent.with_streaming_response.create(\n response_engine={\n "llm_id": "llm_234sdertfsdsfsdf",\n "type": "retell-llm",\n },\n voice_id="retell-Cimo",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom retell import Retell, DefaultHttpxClient\n\nclient = Retell(\n # Or use the `RETELL_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom retell import Retell\n\nwith Retell() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/RetellAI/retell-python-sdk/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport retell\nprint(retell.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
2639
2645
|
},
|
|
2640
2646
|
{
|
|
2641
2647
|
language: 'typescript',
|
|
2642
2648
|
content:
|
|
2643
|
-
"# Retell TypeScript API Library\n\n[)](https://npmjs.org/package/retell-sdk) \n\nThis library provides convenient access to the Retell REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.retellai.com](https://docs.retellai.com/). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Retell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40retell-ai%2Fmcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByZXRlbGwtYWkvbWNwLXNlcnZlciJdLCJlbnYiOnsiUkVURUxMX0FQSV9LRVkiOiJZT1VSX1JFVEVMTF9BUElfS0VZIn19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40retell-ai%2Fmcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40retell-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22RETELL_API_KEY%22%3A%22YOUR_RETELL_API_KEY%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install retell-sdk\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: 'YOUR_RETELL_API_KEY',\n});\n\nconst agentResponse = await client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n});\n\nconsole.log(agentResponse.agent_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: 'YOUR_RETELL_API_KEY',\n});\n\nconst params: Retell.AgentCreateParams = {\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n};\nconst agentResponse: Retell.AgentResponse = await client.agent.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst agentResponse = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .catch(async (err) => {\n if (err instanceof Retell.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new Retell({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new Retell({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new Retell();\n\nconst response = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: agentResponse, response: raw } = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(agentResponse.agent_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `RETELL_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Retell from 'retell-sdk';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Retell({\n logger: logger.child({ name: 'Retell' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.agent.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Retell from 'retell-sdk';\nimport fetch from 'my-fetch';\n\nconst client = new Retell({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport Retell from 'retell-sdk';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Retell({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport Retell from 'npm:retell-sdk';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Retell({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/RetellAI/retell-typescript-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
2649
|
+
"# Retell TypeScript API Library\n\n[)](https://npmjs.org/package/retell-sdk) \n\nThis library provides convenient access to the Retell REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.retellai.com](https://docs.retellai.com/). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Retell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40retell-ai%2Fmcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkByZXRlbGwtYWkvbWNwLXNlcnZlciJdLCJlbnYiOnsiUkVURUxMX0FQSV9LRVkiOiJZT1VSX1JFVEVMTF9BUElfS0VZIn19)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40retell-ai%2Fmcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40retell-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22RETELL_API_KEY%22%3A%22YOUR_RETELL_API_KEY%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install retell-sdk\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst agentResponse = await client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n});\n\nconsole.log(agentResponse.agent_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: Retell.AgentCreateParams = {\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n};\nconst agentResponse: Retell.AgentResponse = await client.agent.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst agentResponse = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .catch(async (err) => {\n if (err instanceof Retell.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new Retell({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n}, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new Retell({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.agent.create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n}, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new Retell();\n\nconst response = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: agentResponse, response: raw } = await client.agent\n .create({\n response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },\n voice_id: 'retell-Cimo',\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(agentResponse.agent_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `RETELL_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Retell from 'retell-sdk';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Retell({\n logger: logger.child({ name: 'Retell' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.agent.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Retell from 'retell-sdk';\nimport fetch from 'my-fetch';\n\nconst client = new Retell({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport Retell from 'retell-sdk';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Retell({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport Retell from 'retell-sdk';\n\nconst client = new Retell({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport Retell from 'npm:retell-sdk';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Retell({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/RetellAI/retell-typescript-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
2644
2650
|
},
|
|
2645
2651
|
];
|
|
2646
2652
|
|