R
RunPod3d ago
Marvin

Unable to create pod with GraphQL

Hi I tried to use following command to create a pod to test.
curl --request POST \
--url https://api.runpod.io/graphql \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"mutation { podFindAndDeployOnDemand(input: { cloudType: SECURE gpuCount: 1 gpuTypeId: \"NVIDIA A40\" name: \"A40 Pod\" imageName: \"runpod/pytorch\" containerDiskInGb: 40 volumeInGb: 40 }) { id imageName machineId } }"}'
curl --request POST \
--url https://api.runpod.io/graphql \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"mutation { podFindAndDeployOnDemand(input: { cloudType: SECURE gpuCount: 1 gpuTypeId: \"NVIDIA A40\" name: \"A40 Pod\" imageName: \"runpod/pytorch\" containerDiskInGb: 40 volumeInGb: 40 }) { id imageName machineId } }"}'
My API_key is with right permissions. I got 500: Internal Server Error. Anyone know why this happens?
2 Replies
Marvin
MarvinOP3d ago
turns out Bearer authorization is not supported. should use url?api_key... instead. Shouldn't here be security problems in this approach?
flash-singh
flash-singh2d ago
use the api_key, i will get eng to support auth header its not a security concern since https, someone can't sniff the urls but they will see domain, regardless we will plan to support header as well
Want results from more Discord servers?
Add your server