Skip to content

Commit

Permalink
Update: GQL uses API Key in Authorization Header
Browse files Browse the repository at this point in the history
  • Loading branch information
deanq committed Jan 7, 2025
1 parent 9c5918e commit 4ba02fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runpod/api/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ def run_graphql_query(query: str) -> Dict[str, Any]:
from runpod import api_key # pylint: disable=import-outside-toplevel, cyclic-import

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

headers = {
"Content-Type": "application/json",
"User-Agent": USER_AGENT,
"Authorization": f"Bearer {api_key}",
}

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

0 comments on commit 4ba02fb

Please sign in to comment.