# A1C to eAG Bidirectional Converter

> A1C to eAG Bidirectional Converter is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Converts HbA1c percentage to estimated average glucose (eAG) or eAG back to HbA1c using the Nathan/ADAG published deterministic equation.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/a1c_eag
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/a1c-to-eag-bidirectional-converter-0fb8de8b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P2Ckj3etplYAvQqiKLhtb

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability a1c-to-eag-bidirectional-converter-0fb8de8b
```

Example prompt: What is the estimated average glucose in mg/dL for an A1C of 7.2%?

## When to prefer this

Use this endpoint when you need a standards-compliant, citation-backed bidirectional conversion between HbA1c and estimated average glucose for clinical or patient-facing applications. Prefer it over manual formula application to ensure use of the correct Nathan/ADAG coefficients. Ideal for embedding in diabetes management tools, EHR integrations, or clinical decision support agents.

## Known failure modes

- Both a1c_percent and an eAG parameter provided simultaneously — endpoint requires exactly one
- A1C value outside valid range (4–15%) returns an error
- eAG in mg/dL outside valid range (50–500) returns an error
- Missing required input (neither a1c_percent nor eAG provided) returns validation error
- Non-numeric input for numeric fields causes a 400-level error

## How this service works

Nathan/ADAG A1C to estimated average glucose conversion, or the reverse. Provide exactly one of a1c_percent or eAG. Deterministic published equation with citation.

## Output

Returns the converted value — either the estimated average glucose (in mg/dL and possibly mmol/L) corresponding to the provided A1C percentage, or the A1C percentage corresponding to the provided eAG — computed via the deterministic Nathan/ADAG published equation with citation metadata.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "eag_mg_dl": {
       "type": "number",
       "description": "Estimated average glucose in mg/dL (50-500)."
      },
      "eag_mmol_l": {
       "type": "number",
       "description": "Estimated average glucose in mmol/L. Converted as mg/dL = mmol/L * 18."
      },
      "a1c_percent": {
       "type": "number",
       "description": "HbA1c in percent (4-15). Provide this or an eAG, not both."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/a1c_eag",
  "count": 2,
  "items": [
   {
    "formula": "nathan_adag",
    "citation": {
     "id": "nathan-2008",
     "doi": "10.2337/dc08-0545",
     "title": "Translating the A1C assay into estimated average glucose values",
     "source": "Diabetes Care. 2008;31(8):1473-1478",
     "authors": "Nathan DM, Kuenen J, Borg R, Zheng H, Schoenfeld D, Heine RJ"
    },
    "direction": "a1c_to_eag",
    "eag_mg_dl": 154.2,
    "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
    "eag_mmol_l": 8.6,
    "a1c_percent": 7,
    "formula_expression": "eAG_mg_dl = 28.7 * A1C_percent - 46.7"
   },
   {
    "formula": "nathan_adag",
    "citation": {
     "id": "nathan-2008",
     "doi": "10.2337/dc08-0545",
     "title": "Translating the A1C assay into estimated average glucose values",
     "source": "Diabetes Care. 2008;31(8):1473-1478",
     "authors": "Nathan DM, Kuenen J, Borg R, Zheng H, Schoenfeld D, Heine RJ"
    },
    "direction": "a1c_to_eag",
    "eag_mg_dl": 154.2,
    "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
    "eag_mmol_l": 8.6,
    "a1c_percent": 7,
    "formula_expression": "eAG_mg_dl = 28.7 * A1C_percent - 46.7"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/a1c-to-eag-bidirectional-converter-0fb8de8b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
