Overview
This API provides access to the same pharmacokinetic engine powering the TRT.GE simulator. All results are educational estimates only and should not replace clinical judgment or laboratory testing.
Base URL
https://api.trt.ge/v1
Engine Version
Current engine version: v21.1.0
Capabilities
- Simulate — Run single TRT/E2 simulations with full parameter control
- Batch — Run up to 100 simulations in parallel (Pro+ tiers)
- Calibrate — Compute personalized response factors from lab results
- Meta — Query supported esters, bounds, and API capabilities
- Health — Uptime and status monitoring
Authentication
All API endpoints require authentication via Bearer token in the Authorization header.
API Key Format
Authorization: Bearer trt_live_<32_hex_chars> # Production
Authorization: Bearer trt_test_<32_hex_chars> # Sandbox
Authorization: Bearer trt_live_pro_<32_hex_chars> # Pro tier
Authorization: Bearer trt_live_clinic_<32_hex> # Clinic tier
Rate Limits & Tiers
| Tier | Rate Limit | Batch | Price |
|---|---|---|---|
| Free | 10 RPM | — | Free |
| Pro | 100 RPM | Up to 10/batch | Contact us |
| Clinic | 1,000 RPM | Up to 100/batch | Contact us |
Rate Limit Headers
All responses include rate limit information:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1708368000
Endpoints
POST /simulate
Run a single TRT/E2 simulation with the provided parameters.
Request Body
{
"sex": "male",
"injectionMethod": "im",
"dose": 120,
"freq": 3.5,
"duration": 84,
"weight": 80,
"activeEster": "cypionate",
"hcg": { "enabled": false, "dose": 250, "freq": 3.5 },
"fat": 18,
"genes": { "cyp": "slow", "shbg": "high" },
"geneMult": 1.0,
"aiMult": 1.0,
"responderManual": 1.0,
"compounds": {
"primo": { "enabled": false, "dose": 200 },
"mast": { "enabled": false, "dose": 200 },
"eq": { "enabled": false, "dose": 200 }
}
}
Response
{
"engineVersion": "v21.1.0",
"tCurve": [{ "x": 0, "y": 450 }, ...],
"e2Curve": [{ "x": 0, "y": 28 }, ...],
"tBand": { "lower": [...], "upper": [...] },
"e2Band": { "lower": [...], "upper": [...] },
"summary": {
"peakT": 1250,
"troughT": 680,
"avgT": 920,
"peakE2": 52,
"avgE2": 38,
"riskBand": "Optimal",
"weeklyLoadMg": 240,
"weeklyActiveMg": 168
},
"warnings": [],
"requestId": "req_abc123"
}
POST /simulate/batch
Run multiple simulations in parallel. Requires Pro+ tier.
{
"items": [
{ "id": "scenario-1", "input": { ... } },
{ "id": "scenario-2", "input": { ... } }
]
}
POST /calibrate
Compute personalized calibration factors from lab measurements.
{
"dose": 120,
"freq": 7,
"ester": "cypionate",
"weight": 80,
"labTiming": 1.0,
"labT": 650,
"labE2": 32,
"labFat": 18,
"injectionMethod": "im",
"hcg": { "enabled": false, "dose": 0, "freq": 3.5 }
}
Response
{
"factors": {
"tResponse": 1.15,
"baseE2Ratio": 0.049,
"baselineFatMod": 1.04,
"baselineGeneMult": 1.0,
"hcgTMax": 150,
"hcgED50": 400
},
"clamped": false,
"requestId": "req_def456"
}
GET /meta
Query supported esters, bounds, and API capabilities.
GET /health
Uptime and status monitoring. No authentication required.
{
"status": "ok",
"engineVersion": "v21.1.0",
"timestamp": "2026-02-19T12:00:00Z",
"uptime": 86400
}
Code Examples
Simulate
const response = await fetch('https://api.trt.ge/v1/simulate', {
method: 'POST',
headers: {
'Authorization': 'Bearer trt_live_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sex: 'male',
injectionMethod: 'im',
dose: 120,
freq: 3.5,
duration: 84,
weight: 80,
activeEster: 'cypionate',
fat: 18,
genes: { cyp: 'slow', shbg: 'high' },
aiMult: 1.0,
responderManual: 1.0
})
});
const data = await response.json();
console.log(`Peak T: ${data.summary.peakT} ng/dL`);
console.log(`Avg E2: ${data.summary.avgE2} pg/mL`);
Calibrate
const response = await fetch('https://api.trt.ge/v1/calibrate', {
method: 'POST',
headers: {
'Authorization': 'Bearer trt_live_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
dose: 120,
freq: 7,
ester: 'cypionate',
labTiming: 1.0,
labT: 650,
labE2: 32,
labFat: 18
})
});
const { factors } = await response.json();
// Use factors.tResponse and factors.baseE2Ratio in subsequent simulations
Simulate
import requests
response = requests.post(
'https://api.trt.ge/v1/simulate',
headers={
'Authorization': 'Bearer trt_live_your_key_here',
'Content-Type': 'application/json'
},
json={
'sex': 'male',
'injectionMethod': 'im',
'dose': 120,
'freq': 3.5,
'duration': 84,
'weight': 80,
'activeEster': 'cypionate',
'fat': 18,
'genes': {'cyp': 'slow', 'shbg': 'high'},
'aiMult': 1.0,
'responderManual': 1.0
}
)
data = response.json()
print(f"Peak T: {data['summary']['peakT']} ng/dL")
print(f"Avg E2: {data['summary']['avgE2']} pg/mL")
Batch Processing
scenarios = [
{'id': 'e3d', 'input': {'dose': 40, 'freq': 3.5, ...}},
{'id': 'eod', 'input': {'dose': 30, 'freq': 2, ...}},
{'id': 'daily', 'input': {'dose': 17, 'freq': 1, ...}}
]
response = requests.post(
'https://api.trt.ge/v1/simulate/batch',
headers={'Authorization': 'Bearer trt_live_pro_your_key'},
json={'items': scenarios}
)
results = response.json()
for r in results['results']:
print(f"{r['id']}: Peak={r['result']['summary']['peakT']}")
Simulate
curl -X POST https://api.trt.ge/v1/simulate \
-H "Authorization: Bearer trt_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"sex": "male",
"injectionMethod": "im",
"dose": 120,
"freq": 3.5,
"duration": 84,
"weight": 80,
"activeEster": "cypionate",
"fat": 18,
"genes": {"cyp": "slow", "shbg": "high"},
"aiMult": 1.0
}'
Health Check
curl https://api.trt.ge/v1/health
Meta
curl -H "Authorization: Bearer trt_live_your_key_here" \
https://api.trt.ge/v1/meta
Error Handling
| Status | Meaning | Resolution |
|---|---|---|
400 |
Validation error | Check request body against schema |
401 |
Unauthorized | Verify API key is valid and in header |
403 |
Forbidden (tier limit) | Upgrade to access batch endpoint |
429 |
Rate limit exceeded | Wait for reset or upgrade tier |
Error Response Format
{
"error": "validation_error",
"message": "Invalid input parameters",
"details": [
{ "field": "dose", "message": "must be between 0 and 2000" }
]
}
Get API Access
Request Your API Key
Ready to integrate TRT.GE simulations into your application? Contact us to get your API credentials and tier information.
hello@trt.geWhat to Include
When requesting access, please provide:
- Your name and organization
- Intended use case (research, clinical tool, personal app, etc.)
- Expected request volume (RPM)
- Do you need batch processing?
OpenAPI Specification
Download the complete OpenAPI 3.1 specification for auto-generated clients: openapi.yaml
© trt.ge. API usage subject to terms of service. Educational model only—not medical advice.