# Number Theory GCD

> Number Theory GCD is a paid API for AI agents from numtheory.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Computes the Greatest Common Divisor (GCD) of two or more non-negative integers supplied as decimal strings.

## Facts

- Endpoint: POST https://numtheory.openverbs.com/v1/gcd
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/number-theory-gcd-7f4cf1be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3I_6c5txcy8avrll8rdJl

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 number-theory-gcd-7f4cf1be -d '<json body>'
```

Example prompt: Can you find the greatest common divisor of 252, 180, and 48?

## When to prefer this

Choose this endpoint when you need a reliable, hosted computation of the GCD for 2–256 non-negative integers, especially in agent workflows requiring number-theory operations without spinning up local math libraries. Useful for fraction simplification, scheduling period calculations, and coprimality checks in cryptographic contexts.

## Known failure modes

- Fewer than 2 values provided — validation error
- Non-numeric or non-decimal-string values — schema validation failure
- Values exceeding 256 items in the array — rejected by maxItems constraint
- Negative integers or non-integer strings — pattern mismatch rejection
- Network or payment authorization failure via x402 protocol

## How this service works

Greatest common divisor of two or more non-negative integers (arbitrary precision).

## Output

Returns the computed GCD as a single non-negative integer — the largest integer that divides all provided input values without remainder. Accepts between 2 and 256 integers passed as decimal strings.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "values"
     ],
     "properties": {
      "values": {
       "type": "array",
       "items": {
        "type": "string",
        "pattern": "^\\d+$"
       },
       "maxItems": 256,
       "minItems": 2,
       "description": "Two or more non-negative integers as decimal strings."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/number-theory-gcd-7f4cf1be/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from numtheory.openverbs.com](https://www.zero.xyz/host/numtheory.openverbs.com/llms.txt)
