# Crypto Math: Chinese Remainder Theorem Solver

> Crypto Math: Chinese Remainder Theorem Solver is a paid API for AI agents from crypto-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Solves systems of simultaneous congruences (x ≡ a1 mod m1, x ≡ a2 mod m2, …) using the Chinese Remainder Theorem, supporting both coprime and non-coprime moduli.

## Facts

- Endpoint: GET https://crypto-math.x402tookit.com/crt?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/crypto-math-chinese-remainder-theorem-solver-a99fdc21
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kF4Pr2QbiQw_ehSmUJEGm

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 crypto-math-chinese-remainder-theorem-solver-a99fdc21
```

Example prompt: Use the CRT solver to find x satisfying the congruences 2:3, 3:5, 2:7 — tell me the solution x and the combined modulus.

## When to prefer this

Choose this endpoint when you need to solve a system of simultaneous modular congruences — especially when moduli may not be pairwise coprime and a generalized CRT is required. Ideal for cryptographic computations (e.g. RSA CRT optimization), number theory problems, and scheduling or calendar calculations based on modular cycles. Prefer over general-purpose CAS tools when you need a lightweight, paid-per-call API with structured output including solvability verdict and modulus.

## Known failure modes

- No solution exists when moduli are non-coprime and residues are incompatible — returns null x with reasons
- Malformed congruences string (wrong separator, non-integer values) causes a 400-style error
- Fewer than 2 or more than 12 congruence pairs may be rejected
- Overflow or extremely large integers may cause computation failure
- Missing required 'congruences' query parameter returns an error

## How this service works

Solve x = a1 (mod m1), x = a2 (mod m2), ... with the Chinese remainder theorem, coprime or not.

## Output

Returns the solution x (smallest non-negative integer satisfying all congruences), the combined modulus, a human-readable equation string, a summary of the computation, a verdict on whether a solution exists, and optional reasons if no solution is found. Also includes a degraded flag and disclaimer if relevant.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "congruences"
     ],
     "properties": {
      "congruences": {
       "type": "string",
       "description": "Comma-separated residue:modulus pairs, e.g. 2:3,3:5,2:7 (2 to 12 pairs)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "x": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "modulus": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "equation": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "equationCount": {
       "type": [
        "null",
        "number"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/crypto-math-chinese-remainder-theorem-solver-a99fdc21/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from crypto-math.x402tookit.com](https://www.zero.xyz/host/crypto-math.x402tookit.com/llms.txt)
