{"uid":"cap_ska46QkXYn2pYpawY-2Il","slug":"matrix-inverse-via-gauss-jordan-elimination-ad7cd03d","name":"Matrix Inverse via Gauss-Jordan Elimination","description":"Invert a square matrix via Gauss-Jordan elimination. A non-square, ragged or empty matrix is a clean 400. A singular (non-invertible) matrix is NOT an error — it returns a successful { invertible:false, inverse:null }.","url":"https://matrix.openverbs.com/v1/inverse","method":"POST","headers":{},"bodySchema":{"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":["matrix"],"properties":{"matrix":{"type":"array","items":{"type":"array","items":{"type":"number"},"minItems":1},"minItems":1,"description":"Square matrix (n×n)."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jLAMrdmDt6-DfZpcGKsEP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the inverse of a square matrix using Gauss-Jordan elimination, returning the inverse matrix or indicating non-invertibility if the matrix is singular.","exampleAgentPrompt":"Can you find the inverse of this 3×3 matrix: [[2, 1, 0], [1, 3, 1], [0, 1, 2]]? If it turns out to be singular, just let me know it's not invertible.","exampleUseCases":[{"title":"Inverting a transformation matrix for graphics","prompt":"I have a 4×4 transformation matrix [[1,0,0,1],[0,1,0,2],[0,0,1,3],[0,0,0,1]] and I need its inverse to undo the transformation — can you compute that for me?"},{"title":"Checking if a covariance matrix is invertible","prompt":"I've got a 3×3 covariance matrix [[4,2,0],[2,3,1],[0,1,2]] that I need to invert for a statistics calculation — can you get me the inverse, or tell me if it's singular?"},{"title":"Solving for matrix inverse in robotics kinematics","prompt":"I need the inverse of this 2×2 Jacobian matrix [[0.5, -0.3],[0.2, 0.8]] so I can compute joint velocities from end-effector velocities — please compute it."}],"resultDescription":"Returns a JSON object with an `invertible` boolean and an `inverse` field containing the n×n inverse matrix as a 2D array of numbers, or `null` if the matrix is singular. Non-square, ragged, or empty matrices return a 400 error.","failureModes":["400 error if matrix is non-square (rows ≠ columns)","400 error if matrix rows have different lengths (ragged matrix)","400 error if the matrix or its rows are empty","Successful response with invertible:false and inverse:null for singular matrices (determinant = 0)","402 Payment Required if x402 payment is not provided"],"whenToPreferThis":"Use this endpoint when you need a numerically computed matrix inverse for a square matrix and want clean handling of singular cases without exceptions — ideal when you need to know whether a matrix is invertible as part of your logic, not just the inverse value itself. Prefer this over general linear solvers when the explicit inverse (not just a solution to Ax=b) is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:30:24.221Z","isFirstParty":false}