For Developers

aafinomics is built as an open pipeline: a streaming chat API, a public REST API with a Python SDK, a compute runner protocol for external execution, and an HPC worker for Evo 2 variant scoring.

Chat API

POST /api/chat streams Server-Sent Events. Send an OpenAI-style message array; receive token deltas and tool-call results (PharmGKB, KEGG, cBioPortal, GDC, AlphaFold) as they resolve.

curl -N -X POST https://genrox.aafiyet.com/api/chat \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"CYP2D6 *4/*4 on codeine"}]}'

REST API & SDK

POST /api/public/v1/chat is the authenticated, API-key-based equivalent of the chat API for external integrations. Pass your key as a Bearer token; the same tool-augmented streaming response is returned.

API access is part of aafinomics Pro. API calls share your Pro allowance with the website: 50 questions per rolling 5 hours, then pay-as-you-go credits. Each response carries X-Quota-Used and X-Quota-Limit headers; a 429 means the window and credits are used up, and a 403 means the key's account is not on Pro.

curl -N -X POST https://genrox.aafiyet.com/api/public/v1/chat \
  -H "Authorization: Bearer grx_..." \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"What is CYP2D6 *4?"}]}'

Python SDK (requests, stdlib-friendly):

import requests

API_KEY = "grx_..."

resp = requests.post(
    "https://genrox.aafiyet.com/api/public/v1/chat",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"messages": [{"role": "user", "content": "What is CYP2D6 *4?"}]},
    stream=True,
)

for chunk in resp.iter_content(chunk_size=None, decode_unicode=True):
    if chunk:
        print(chunk, end="")

For scripted, bulk queries against a CSV/TSV of prompts, download the dependency-free batch CLI:

API keys

Create and manage API keys for the public REST API. Keys require an active Pro plan.

Compute runner protocol

Run generated code on infrastructure you control. The runner long-polls POST /api/ngs-submit to claim jobs and posts results back, authenticated with a node key. POST /api/compute-ping validates connectivity from the Compute setup dialog.

# Poll for and execute compute jobs
python runner.py --endpoint https://your-host/api/ngs-submit \
  --key $GENROX_NODE_KEY

Evo 2 HPC worker

hpc/hpc_evo2_worker.py is a persistent daemon that loads Evo 2 in bfloat16 with FlashAttention, pins weights in VRAM for the allocation window, and long-polls the orchestrator for scoring jobs — outbound only, so firewalled compute nodes need no inbound access. Launch it with hpc/launch_slurm_worker.sh (1 node, A100/H100 80GB, 16 CPUs, 64GB RAM, 8h wall time) via SLURM with graceful SIGTERM drain.

Orchestrator

backend/main.py is a FastAPI + Redis reference orchestrator: a cached star-allele fast path, a reliable job queue with lease reaping, authenticated claim/complete/heartbeat endpoints, and a WebSocket status stream (Queued → Assigned → Scoring in VRAM → Complete).