Skip to content

Commit 2c62255

Browse files
authored
Update: GQL uses API Key in Authorization Header (#394)
1 parent 9c5918e commit 2c62255

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runpod/api/graphql.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ def run_graphql_query(query: str) -> Dict[str, Any]:
2121
from runpod import api_key # pylint: disable=import-outside-toplevel, cyclic-import
2222

2323
api_url_base = os.environ.get("RUNPOD_API_BASE_URL", "https://api.runpod.io")
24-
url = f"{api_url_base}/graphql?api_key={api_key}"
24+
url = f"{api_url_base}/graphql"
2525

2626
headers = {
2727
"Content-Type": "application/json",
2828
"User-Agent": USER_AGENT,
29+
"Authorization": f"Bearer {api_key}",
2930
}
3031

3132
data = json.dumps({"query": query})

0 commit comments

Comments
 (0)