CoAI Sandbox answers like E2B's API: the SDK raises an exception with the HTTP status code and our message. The table lists the errors that are specific to CoAI Sandbox accounts.
| Status | Message (shortened) | What it means | What to do |
|---|---|---|---|
| 402 | Insufficient balance. Add funds: … | Your balance and welcome credit do not cover your unpaid usage and a new sandbox | Add funds, or pay an unpaid settlement invoice |
| 403 | This account is not enabled for CoAI Sandbox yet | Your CoAI Sandbox account is not verified yet | Save a card ("Order CoAI Sandbox and verify your account") |
| 403 | This account is frozen | Your account is frozen, for example after a disputed payment or under the AUP | Open a support ticket |
| 429 | You have reached the maximum number of concurrent sandboxes (N) | Your level's limit of running sandboxes | Kill sandboxes you no longer need, or wait for them to end |
| 429 | You have reached the maximum number of sandboxes created today (N) | Your level's limit of new sandboxes per UTC day | Wait for the next UTC day |
| 429 | You have reached your spend cap … | Your daily or monthly spending cap, or your level's daily spending limit | Raise your cap in the console, or wait for the next day or month |
| 429 | You are creating sandboxes too fast … | Your level's rate of new sandboxes | The SDK waits and retries by itself |
| 400 | Timeout cannot be greater than … | The timeout you asked for is longer than your level allows | Use a shorter timeout |
| 503 | Billing is temporarily unavailable … | We could not check your balance for a while | The SDK retries; running sandboxes are not affected |
| 503 | CoAI Sandbox is under maintenance … | Planned maintenance | The SDK retries; running sandboxes are not affected |
| 401 | — | The API key is wrong, revoked or not a CoAI Sandbox key | Check E2B_API_KEY and E2B_DOMAIN |
The SDK does not retry 402, 403, 400 or a 429 without a wait time; it does retry a 429 that says when to try again and a 503.
A running sandbox stopped
A sandbox ends when its timeout passes, when it reaches the longest running time of your level, when your balance or a spending cap runs out (about a minute after), or when it is stopped under the AUP. The console shows each sandbox with the reason it ended, and you get an email notice when sandboxes are stopped because your balance or a cap ran out.