HeyGen insufficient_credit vs Sume insufficient_credits (402)

HeyGen returns code insufficient_credit with HTTP 402. Sume returns insufficient_credits, plural, also 402. Match on the exact string and the status.

4 min readSume
All posts

HeyGen's code is insufficient_credit (singular) with HTTP 402; Sume's is insufficient_credits (plural), also 402. They are different strings, so a handler written for one will not match the other if it compares the code. Matching on the 402 status works for both.

HeyGen details are from its error-codes page and Sume details from Errors and rate limits and Generation admission, all read 2026-10-01.

What does the HeyGen error look like?

HeyGen's example response has an error object with code set to insufficient_credit, a message that names the balance against the credits the video needs ("Your account has 5 credits but this video requires 10 credits."), and a doc_url that links to the matching section of its error page. Its status table describes 402 as a request that needs additional credits or a plan upgrade.

What does the Sume error look like?

Sume's error table lists 402 with code insufficient_credits: the balance is not sufficient for the requested generation. Error bodies use an error object with code, message, request_id and details; the docs show the shape with invalid_request as the example code. Include the request_id when you report an issue.

The check runs at submit. Generation admission says a submit fails with 402 insufficient_credits before provider work starts, so a 402 means nothing was started for that request.

How do the two compare?

Insufficient-balance errors as documented, read 2026-10-01.
FieldHeyGenSume
HTTP status402402
Code stringinsufficient_creditinsufficient_credits
Fields in the examplecode, message, doc_url (and param for field errors)code, message, request_id, details
Message names balance vs needYes, in the example messageNot stated in the docs

How should I handle it in code?

Branch on the status first, then on the code string, and keep the two spellings in separate adapters rather than one shared constant. For a failed Sume job, the quota error category's documented next action is to add funds or lower the request cost. Because a 402 is returned before provider work starts, nothing was started for that request. See also insufficient credits 402: add funds.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume