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.

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?
| Field | HeyGen | Sume |
|---|---|---|
| HTTP status | 402 | 402 |
| Code string | insufficient_credit | insufficient_credits |
| Fields in the example | code, message, doc_url (and param for field errors) | code, message, request_id, details |
| Message names balance vs need | Yes, in the example message | Not 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
- HeyGen create avatar from a text prompt API vs Sume
HeyGen POST /v3/avatars type prompt takes up to 1000 characters and an aspect_ratio. Sume creates a text-only avatar with a Prompt input on avatar-1.0/generate.
- HeyGen Stripe Projects API key vs how you get a Sume key
HeyGen lets an agent provision a key with stripe projects add heygen/api. Sume keys are created in the dashboard, workspace-scoped and shown once.
- HeyGen studio video scene limit: 50 scenes, and Sume's 4-60 s plan
HeyGen studio videos allow 50 scenes and 30 minutes per scene. Sume multi-scene video_inputs share one 4-60 second window and one resolved avatar.
- Luma API 429 requests per minute: sliding window vs Sume
Luma counts requests in a sliding 60-second window and returns 429 if RPM or concurrent jobs fails. Sume returns 429 rate_limited: back off, reuse the key.
Written by Sume