# Molar Mass Calculator API

> Molar Mass Calculator API is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13).

Computes the molecular weight (g/mol) of any chemical formula, returning total molar mass, atom counts, and per-element mass breakdown

## Facts

- Endpoint: POST https://x402.forgemesh.io/molar-mass
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/molar-mass-calculator-api-f65b1251
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_G8OXSrSdOKRcZPvm41pwv

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 molar-mass-calculator-api-f65b1251 -d '<json body>'
```

Example prompt: What's the molar mass of copper sulfate pentahydrate (CuSO4·5H2O)? I also want a breakdown of each element's percentage by mass.

## When to prefer this

Use this endpoint when you need fast, programmatic calculation of molecular weight for any chemical formula — especially when handling complex structures like nested parentheses (Ca(OH)2, Fe2(SO4)3) or hydrates (CuSO4·5H2O). Ideal for chemistry, pharma, lab automation, and education agents that need per-element mass composition alongside total molar mass.

## Known failure modes

- Invalid or unrecognized chemical formula returns an error response
- Malformed parentheses or unsupported formula notation may cause parsing failure
- Unknown element symbols (e.g. typos) will result in an error
- Empty or missing formula field returns validation error

## How this service works

Molar mass API: compute the molecular weight of any chemical formula in g/mol — handles nested parentheses (Ca(OH)2, Fe2(SO4)3) and hydrates (CuSO4·5H2O). Returns the total, atom count, and a per-element breakdown with mass percentages. For chemistry, lab, pharma, and education agents.

## Output

Returns the total molar mass in g/mol, the total atom count in the formula, and a per-element breakdown including each element's symbol, count, individual atomic mass contribution, and percentage of total molecular weight.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "formula": {
   "type": "string",
   "description": "chemical formula e.g. C6H12O6"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "atom_count": 3,
  "composition": [
   {
    "count": 2,
    "element": "H",
    "mass_percent": 11.19
   },
   {
    "count": 1,
    "element": "O",
    "mass_percent": 88.81
   }
  ],
  "molar_mass_g_per_mol": 18.015
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/molar-mass-calculator-api-f65b1251/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
