https://retellai.com/?utm_source=discord&utm_medium=seo logo
is there a way to set a limit for a specific agent...
# ❓・ai-evy-support
m
@AI Evy is there a way to set a limit for a specific agent, based on phone call minutes or something similar? I’m using retell for my clients and I want to avoid them going over a limit I set
a
Thanks for tagging me @Marlon. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, Retell AI provides a
max_call_duration_ms
setting that allows you to set a maximum duration limit for individual calls per agent [(1) ]() . This setting controls the maximum allowed length for each call and will force end the call if the limit is reached . The minimum value allowed is 60,000 ms (1 min) , and the maximum value allowed is 7,200,000 ms (2 hours) . By default, this is set to 3,600,000 ms (1 hour) . You can configure this when creating an agent:
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',
 max_call_duration_ms: 3600000
}) ;
However, this setting only controls individual call duration rather than cumulative minutes across multiple calls for a specific agent. For broader usage limits across multiple calls or clients, the available sources don't provide specific API parameters for setting such limits at the agent level. From community discussions, there was mention of setting daily usage limits on minutes to prevent potential misuse [(2) ]() , and the response indicated you can set a maximum call duration for each call with a current maximum of 2 hours .
m
@AI Evy this doesn’t answer my question unfortunately - i need to limit it on cumulative minutes (or some sort of other metric of usage) across multiple calls for an agent
a
Thanks for the follow-up, @Marlon. I'll get back to you soon.
### Answer I understand you're looking for cumulative usage limits across multiple calls for a specific agent, rather than per-call duration limits. Based on the available sources, I don't have information about built-in API parameters or settings that allow you to set cumulative minute limits or usage quotas at the agent level across multiple calls. The
max_call_duration_ms
setting I mentioned earlier only controls individual call duration. For implementing cumulative usage tracking and limits for your clients, you would likely need to build this functionality externally by: - Tracking call durations and usage through webhooks or call analytics - Implementing your own usage monitoring system - Potentially disabling or restricting agent access when limits are reached However, I don't have specific documentation on how to implement this type of usage control system. Would you like me to try to provide a general approach based on my knowledge instead? Alternatively, for more detailed guidance on usage management and billing controls, I'd recommend reaching out to the Retell team directly: - Visit [Contact Sales]() - Check [) They may have additional options or upcoming features for usage management that aren't documented in the current API references.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy what is your recommendation if I tracked it externally based on minutes?
a
Thanks for the follow-up, @Marlon. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific documentation about external usage tracking recommendations. However, the sources do show that you can configure
max_call_duration_ms
at the agent level to control individual call limits [(1) ]() [(2) ]() . For external tracking implementation, you would need to work with the available agent configuration options. The sources show you can update agent settings using the Update Agent API [(2) ]() , which could potentially be used to disable or modify agent behavior when usage limits are reached. The sources also indicate that Retell AI has concurrency limits - Pay-As-You-Go users get 20 concurrent calls by default [(3) ]() . This suggests the platform has built-in usage monitoring capabilities, though specific external tracking guidance isn't documented in the available sources. For detailed recommendations on implementing external usage tracking and limit enforcement, I'd suggest reaching out to Retell AI support directly: - Visit [Contact Sales]() - Visit [) Would you like me to try to provide a general approach based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] Update Agent](https://docs.retellai.com/api-references/update-agent) [[3] Understand concurrency & limits](https://docs.retellai.com/deploy/concurrency) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy yes try providing a general approach based on your knowledge instead
a
Thanks for the follow-up, @Marlon. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] Discord message from @pankajblt_61943 on 2025-01-22](https://discord.com/channels/1186424376300679209/1186462578310910112/1331558505890713620) ​
[(2) ]() 2. Database Usage Tracking Create a usage tracking system that: - Records call start/end times from webhook events - Calculates call duration in minutes - Maintains cumulative totals per agent/client - Tracks usage against predefined limits 3. Dynamic Agent Control When limits are reached, you can dynamically update the agent using the Update Agent API [(1) ]() . For example, you could: - Set
max_call_duration_ms
to a very low value (minimum 60,000 ms) - Update the agent's response engine or configuration to indicate service suspension - Implement a "quota exceeded" message 4. Preventive Measures Consider implementing: - Warning notifications at 80% usage - Graduated limits (reduce
max_call_duration_ms
as usage approaches limits) - Automatic reset schedules (daily/monthly) This approach leverages Retell's existing agent configuration capabilities [(1) ]() [(2) ]() while building the cumulative tracking logic externally.
### Answer ### General Approach for External Usage Tracking Since you'd like a general approach based on my knowledge, here's how you could implement external usage tracking for cumulative minutes across multiple calls: 1. Webhook-Based Call Tracking Set up webhooks to capture call events and durations [(1) ]() . You can configure this at the agent level using the
webhook_url
parameter :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { 
  webhook_url: '<https://your-tracking-endpoint.com/webhooks'>
}) ;
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Update Agent](https://docs.retellai.com/api-references/update-agent) [[2] Update Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.