Question

Spawn GPU droplet via Python API: Size error

I’m trying to spawn a GPU droplet via Python and the API, I’m trying to use the “Create via API” information given when configuring a GPU droplet on the website.

I tried

“size_id”: 288 (provided by the DO website when clicking “create via API”) and

“size:”: “gpu-h100x1-80gb” (provided by https://slugs.do-api.dev/ )

but both result in

“azure.core.exceptions.HttpResponseError: (None) You specified an invalid size for Droplet creation. Code: None”

Any idea what’s wrong?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
March 31, 2025

Hello, @raminassadollahi

By default, only non-GPU Droplets are returned. To list only GPU Droplets, set the type query parameter to gpus. For example, /v2/droplets?type=gpus.

By default, only non-GPU Droplets are returned. To list only GPU Droplets, set the type query parameter to gpus. For example, /v2/droplets?type=gpus.

Check GPU Droplets

You can alos check our docs on how to create a droplet using the API

https://docs.digitalocean.com/products/droplets/how-to/create/#create-a-droplet-using-automation

Regards

Bobby Iliev
Site Moderator
Site Moderator badge
April 2, 2025

Hey Ramin 👋

Which region are you trying to deploy the GPU Droplet in? Not all GPU sizes are available in every region, so that could be the issue.

If everything looks good and you’re still hitting the error, I’d suggest reaching out to support here: https://do.co/support, they can check the exact availability and help debug the API call.

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.