Common status codes
Handling errors
- Branch on
error_code, not the message text. - Log the HTTP status,
error_code, and request correlation data without logging API keys. - Retry transient
5xxand rate-limit responses with exponential backoff and jitter. - Fix
4xxrequest errors before retrying. - Treat task-not-found responses as non-disclosing. The retrieve endpoint does not reveal tasks that are inaccessible to the current API key.
Provider error codes
When a response includes a BytePlus ModelArk error code, search the provider error reference for its description. Continue to use the GENGENerror_code and HTTP status as the stable values in application logic.