Trying to run an API call to alphagenome and keep getting this

I’m running this code:

#@title AlphaGenome REST scoring (robust hostname fallback)
import pandas as pd, pathlib, re, time, json, requests, itertools

API_KEY = “–redacted–” # your real key

HOSTS = [
https://api.genomics.deepmind.com/v1beta/predict_variant”, # current prod
https://api.alphagenome.ai/v1beta/predict_variant” # legacy
]

------------------------------------------------------------------

snps_file = ‘/content/drive/MyDrive/SOX17_IA_Project/data/SOX17_SNPs_for_AlphaGenome.tsv’
ld_file = ‘/content/drive/MyDrive/SOX17_IA_Project/data/SOX17_LDblock_r2_0.8.tsv’
snps = pd.read_csv(snps_file, sep=“\t”)
ld = pd.read_csv(ld_file, sep=“\t”)
df = snps.merge(ld[[‘rsid’,‘alleles’]], on=‘rsid’)

def alleles(a): return re.sub(r’[() ]‘, ‘’, a).split(’/')

def call_api(payload):
for host in HOSTS:
try:
r = requests.post(
host,
headers={“Content-Type”:“application/json”,
“Authorization”:f"Bearer {API_KEY}"},
data=json.dumps(payload),
timeout=20
)
if r.ok:
return r.json()
except requests.exceptions.RequestException:
continue # try next host
raise RuntimeError(“All AlphaGenome hosts unreachable”)

------------------------------------------------------------------

rows =
for , row in df.iterrows():
ref, alt = alleles(row[‘alleles’])
pos1, chr
= int(row[‘end’]), row[‘chr’]
payload = {
“interval”: f"{chr_}:{max(1,pos1-500000)}-{pos1+500000}“,
“variant”: f”{chr_}:{pos1}{ref}>{alt}",
“tissues”: [“UBERON:0001980”],
“outputs”: [“expression”]
}
try:
delta = call_api(payload)[“delta”][“expression”].get(“SOX17”, 0)
except Exception as e:
print(“:warning: API call failed for”, row[‘rsid’], “→”, e)
delta = None
rows.append({**row, “delta_SOX17_expr”: delta})
time.sleep(0.25)

out_df = pd.DataFrame(rows)
out_dir = pathlib.Path(‘/content/drive/MyDrive/SOX17_IA_Project/results’)
out_dir.mkdir(exist_ok=True, parents=True)
out_file = out_dir / ‘AlphaGenome_SO17_scores.tsv’
out_df.to_csv(out_file, sep=“\t”, index=False)
print(“\n✅ Scoring complete — saved to”, out_file)
out_df.head()

And getting this error:

:warning: API call failed for rs59436218 → All AlphaGenome hosts unreachable
:warning: API call failed for rs57780081 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13281003 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13266258 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13251118 → All AlphaGenome hosts unreachable
:warning: API call failed for rs11782075 → All AlphaGenome hosts unreachable
:warning: API call failed for rs6473940 → All AlphaGenome hosts unreachable
:warning: API call failed for rs17309487 → All AlphaGenome hosts unreachable
:warning: API call failed for rs17309437 → All AlphaGenome hosts unreachable
:warning: API call failed for rs78143933 → All AlphaGenome hosts unreachable
:warning: API call failed for rs17309381 → All AlphaGenome hosts unreachable
:warning: API call failed for rs59801813 → All AlphaGenome hosts unreachable
:warning: API call failed for rs17309332 → All AlphaGenome hosts unreachable
:warning: API call failed for rs60425352 → All AlphaGenome hosts unreachable
:warning: API call failed for rs56946204 → All AlphaGenome hosts unreachable
:warning: API call failed for rs17400452 → All AlphaGenome hosts unreachable
:warning: API call failed for rs4552881 → All AlphaGenome hosts unreachable
:warning: API call failed for rs1287158301 → All AlphaGenome hosts unreachable
:warning: API call failed for rs1458230350 → All AlphaGenome hosts unreachable
:warning: API call failed for rs66772979 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13276481 → All AlphaGenome hosts unreachable
:warning: API call failed for rs9643826 → All AlphaGenome hosts unreachable
:warning: API call failed for rs34198292 → All AlphaGenome hosts unreachable
:warning: API call failed for rs1804141449 → All AlphaGenome hosts unreachable
:warning: API call failed for . → All AlphaGenome hosts unreachable
:warning: API call failed for . → All AlphaGenome hosts unreachable
:warning: API call failed for rs62516551 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13260576 → All AlphaGenome hosts unreachable
:warning: API call failed for rs10435588 → All AlphaGenome hosts unreachable
:warning: API call failed for rs56464474 → All AlphaGenome hosts unreachable
:warning: API call failed for rs13254861 → All AlphaGenome hosts unreachable
:warning: API call failed for rs1554581843 → All AlphaGenome hosts unreachable
:warning: API call failed for rs58257652 → All AlphaGenome hosts unreachable
:warning: API call failed for rs59107330 → All AlphaGenome hosts unreachable
:warning: API call failed for rs34451891 → All AlphaGenome hosts unreachable
:warning: API call failed for rs374544251 → All AlphaGenome hosts unreachable
:warning: API call failed for rs111155379 → All AlphaGenome hosts unreachable
:warning: API call failed for rs66646286 → All AlphaGenome hosts unreachable
:warning: API call failed for rs796598635 → All AlphaGenome hosts unreachable
:warning: API call failed for . → All AlphaGenome hosts unreachable
:warning: API call failed for . → All AlphaGenome hosts unreachable
:warning: API call failed for rs62516550 → All AlphaGenome hosts unreachable
:warning: API call failed for rs7464406 → All AlphaGenome hosts unreachable

:white_check_mark: Scoring complete — saved to /content/drive/MyDrive/SOX17_IA_Project/results/AlphaGenome_SO17_scores.tsv
chr start end rsid alleles delta_SOX17_expr
0 chr8 54541945 54541946 rs59436218 (G/A) None
1 chr8 54540658 54540659 rs57780081 (C/T) None
2 chr8 54537710 54537711 rs13281003 (T/C) None
3 chr8 54531641 54531642 rs13266258 (A/G) None
4 chr8 54529937 54529938 rs13251118 (G/A) None