402/screenshot, /animate

insufficient_credits

How to fix the Scrnpix API 402 error when your account has run out of credits for screenshot or animation requests.

When Does This Happen?

This error occurs when your account's credit balance has reached zero. Each screenshot costs 1 credit, and GIF animations cost 1 credit per second of duration (minimum 1). You need to upgrade your plan or wait for your monthly credit refresh to continue.

Reproduce This Error

curl -H "X-KEY: your-api-key" \
  "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com"
{"error": "insufficient_credits", "message": "You have no credits remaining. Please upgrade your plan.", "credits_remaining": 0}

How to Fix

  1. 1Check your current credit balance in the Scrnpix dashboard
  2. 2Upgrade to a higher plan for more monthly credits
  3. 3Wait for your monthly credit refresh if on an active plan
  4. 4Optimize GIF animations with shorter durations to reduce credit consumption

Correct Request

curl -H "X-KEY: your-api-key" \
  "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com" \
  --output screenshot.png
200 OK — returns the screenshot (1 credit deducted)

Related Errors

Frequently Asked Questions

How are credits calculated for GIF animations?

GIF animations cost 1 credit per second of total duration, with a minimum of 1 credit. The duration is calculated as frames multiplied by frame_delay. For example, a 30-frame animation with 100ms frame delay (3 seconds total) costs 3 credits.

Do cached responses consume credits?

Cached responses (served from the 60-second KV cache) still report the original credit cost in the X-Credit-Cost header, but credits are only consumed on the initial request that populates the cache.

Still Having Issues?

Check your API key and subscription status in the dashboard, or explore our language guides for integration examples.

Go to Dashboard