Skip to content

somagraph/somagraph-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Somagraph API

Developer SDK & Integration Guide

npm Docs License: MIT


Overview

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.

Authentication

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"}'

Quick Start

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..."

Rate Limits

Tier Requests/min Analyses/day
Free (1 per wallet) 5 1
Holder 30 50
Enterprise 100 1,000

Documentation


Somagraph API · V1 · somagraph.bio

About

TypeScript SDK, endpoint reference, and integration examples for the Somagraph biological age analysis API on Solana.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors