Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

How do I get detailed error messages when I overspend my budget?

2025-08-19 223

When the budget is overrun and the protection mode is set to throw When it does, AgentGuard throws an error with detailed information. Developers can catch the error with a try-catch and access the error.agentGuardData Get the data at the time of the overrun. Example:

try { const response = await openai.chat.completions.create({...}); } catch (error) { if (error.message.includes('AGENTGUARD_LIMIT_EXCEEDED')) { console.log('预算超支:', error.agentGuardData); } }

Error messages include current total spend, budget cap, percentage overspend, etc., making it easy for developers to adjust tasks or switch to low-cost models.

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish