https://retellai.com/?utm_source=discord&utm_medium=seo logo
i am using api to control the calls and everything...
# ❓・ai-evy-support
r
@AI Evy i am using api to control the calls and everything for retell. as the payment is pay as you go, is there a way to restrict an agent for a particular amount of time like 100 minutes?
a
Thanks for tagging me @razazagoyal. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Update Agent](https://docs.retellai.com/api-references/update-agent) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Get Call](https://docs.retellai.com/api-references/get-call) ​
### Answer Based on the available documentation, Retell AI doesn't provide a built-in feature to restrict an agent's total usage to a specific amount of time like 100 minutes across multiple calls. However, there are call-level duration controls available. You can set maximum call duration limits per individual call using the
max_call_duration_ms
parameter [(1) ]() [(2) ]() . The minimum value allowed is 60,000 ms (1 min) , and maximum value allowed is 7,200,000 ms (2 hours) , with a default of 3,600,000 ms (1 hour) .
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
[(2) ]() For implementing a cumulative time limit across multiple calls (like your 100-minute requirement) , you would need to build this logic into your application by: - Tracking call durations using the call details from the Get Call endpoint [(3) ]() - Implementing your own usage tracking system - Preventing new calls when the limit is reached The API provides call cost and duration information through the Get Call endpoint , which you could use to monitor total usage and implement custom restrictions in your application logic.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.