Leonardo.ai API Errors: Authorization, Invalid Dimensions and More
Quick answer
Most Leonardo.ai API errors are request mistakes: key not sent as a Bearer header, size not a multiple of 8, prompt over 1,500 characters, wrong image ID parameter.
Most likely fix: Authentication
How to fix it
Try these in order — the most common fix is first.
1. Authentication
- Send authorization: Bearer <your-key> with a valid UUID key
- Invalid response from authorization hook or Authentication hook unauthorized this request means key missing or wrong
Did this fix it?2. Request body
- Use exact names such as sd_version
- Send true and false unquoted
- Set height and width between 32 and 1024 in multiples of 8
- Keep prompts under 1,500 characters
- Lower num_images on 400 Too many images
Did this fix it?3. Image IDs and uploads
- Use init_image_id for uploads and init_generation_image_id for Leonardo images
- 204 from the presigned upload is success; take the ID from uploadInitImage.id
- Remove auth headers from the presigned upload request
- For Motion SVD use the image ID from Get a Single Generation, not the generation ID
Did this fix it?4. Webhooks
- Key Creation Error Occurred means the callback URL is not https
Did this fix it?
Symptoms
The API returns errors such as Invalid response from authorization hook, invalid dimensions, Invalid init image id or couldn't access image.
Why it happens
- API key missing or not sent as authorization: Bearer <key>
- Width or height outside 32-1024 or not a multiple of 8
- Prompt over 1,500 characters (200 for Improve Prompt)
- Parameter names are case-sensitive; booleans sent as strings
- Variation endpoints need a Leonardo-generated image ID, not an upload
- Auth headers sent to the presigned upload URL cause 403
- Webhook URL must be https
This guide also covers
- leonardo ai api error
- leonardo ai invalid response from authorization hook
- leonardo ai api invalid dimensions
- leonardo ai api service error
Still not working?
If Leonardo.ai keeps failing, you're not alone. See every Leonardo.ai problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All ai & editing tools not working guides →
Stable Diffusion Black Images and NaN Error (Stable Diffusion)
Other Leonardo.ai errors
- Leonardo.ai Tokens Ran Out: Why and What to Do
- Leonardo.ai Premium Features or Tokens Missing After Login
- Leonardo.ai Password Reset Email or Verification Code Not Received
- Leonardo.ai ERR_CONNECTION_TIMED_OUT Error
- Leonardo.ai Prompt Blocked: Content Moderation Filter
- Leonardo.ai Generation Failed or Stuck
- Leonardo.ai Payment Error: Check-plan-subscription-status Subscription Count
- How to Cancel Leonardo.ai Subscription