The Somagraph API enables developers to integrate biological age analysis into their own applications. Submit biomarker panels, receive PhenoAge scores, longevity scores, and AI-generated narratives programmatically.
Status: V1 API ships in Month 3-4. This repository contains the specification, TypeScript SDK skeleton, and usage examples for early integrators.
All API requests require a Bearer token obtained by signing a challenge message with your Solana wallet.
# Step 1: Request a challenge nonce
curl -X POST https://api.somagraph.bio/v1/auth/challenge \
-H "Content-Type: application/json" \
-d '{"wallet": "YourSolanaWalletAddress"}'
# Step 2: Sign the nonce with your wallet, then exchange for a JWT
curl -X POST https://api.somagraph.bio/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"wallet": "YourSolanaWalletAddress", "signature": "base58_signature", "nonce": "returned_nonce"}'import { SomagraphClient } from '@somagraph/sdk';
const client = new SomagraphClient({
apiKey: 'your-jwt-token',
network: 'mainnet',
});
const result = await client.analyze({
markers: [
{ name: 'Albumin', value: 4.3, unit: 'g/dL' },
{ name: 'Glucose, fasting', value: 94, unit: 'mg/dL' },
// ... additional markers
],
chronologicalAge: 35,
sex: 'male',
});
console.log(result.phenoAge); // 33.7
console.log(result.longevityScore); // 82
console.log(result.narrative); // "Your metabolic markers suggest..."| Tier | Requests/min | Analyses/day |
|---|---|---|
| Free (1 per wallet) | 5 | 1 |
| Holder | 30 | 50 |
| Enterprise | 100 | 1,000 |
- ENDPOINTS.md — Full API reference with request/response schemas
- sdk/typescript/ — TypeScript SDK source
- examples/ — Integration examples