# Matrix Multiplication API

> Matrix Multiplication API is a paid API for AI agents from matrix.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-15).

Multiplies two matrices A and B (A·B), requiring compatible inner dimensions, and returns the resulting product matrix.

## Facts

- Endpoint: POST https://matrix.openverbs.com/v1/multiply
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/matrix-multiplication-api-a346888a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IUVINprVby8nN2tSGIL61

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 matrix-multiplication-api-a346888a -d '<json body>'
```

Example prompt: Multiply matrix A = [[1,2],[3,4],[5,6]] by matrix B = [[7,8,9],[10,11,12]] and give me the resulting product matrix.

## When to prefer this

Choose this endpoint when you need a simple, reliable, pay-per-call matrix multiplication with strict input validation and clean error responses. Ideal for agents that need ad-hoc linear algebra without spinning up a compute environment, and when you want guaranteed 400s for bad inputs rather than silent errors or undefined behavior.

## Known failure modes

- 400 if columns of A do not equal rows of B (dimension mismatch)
- 400 if either matrix is ragged (rows of unequal length)
- 400 if either matrix is empty
- Numeric precision errors for very large or very small floating-point values

## How this service works

Multiply two matrices A·B. The inner dimensions must agree (columns of A equal rows of B); a mismatch or a ragged/empty matrix is a clean 400.

## Output

Returns the product matrix resulting from A·B as a 2D array of numbers with dimensions m×p, where A is m×n and B is n×p. Returns a clean HTTP 400 error if inner dimensions are mismatched, or if either matrix is ragged or empty.

## 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": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "array",
       "items": {
        "type": "array",
        "items": {
         "type": "number"
        },
        "minItems": 1
       },
       "minItems": 1,
       "description": "Left matrix (m×n)."
      },
      "b": {
       "type": "array",
       "items": {
        "type": "array",
        "items": {
         "type": "number"
        },
        "minItems": 1
       },
       "minItems": 1,
       "description": "Right matrix (n×p)."
      }
     },
     "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/matrix-multiplication-api-a346888a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from matrix.openverbs.com](https://www.zero.xyz/host/matrix.openverbs.com/llms.txt)
