Thanks Navi.
I wrote a script to attach GPU with your API reference and it works for attaching a GPU, thanks.
Do you know any way to detach the GPU from a API request. Surfed the documentation but could not find anything. I tried adding 0 to "acceleratorCount" parameter but it says
"Invalid value for field 'guestAccelerators[0].acceleratorCount': '0'. Number of accelerator cards attached to an instance must be one of [1, 2, 4, 8]."