{"openapi":"3.1.0","info":{"title":"Combinatorics API","version":"1.0.0","description":"Combinatorics maths as an API, computed locally and deterministically with exact arbitrary-precision integers. The factorial endpoint computes n! = 1·2·3···n (with 0! = 1) and returns it exactly as a string together with its digit count, so even very large factorials stay precise. The permutations endpoint counts ordered arrangements: without repetition nPr = n!/(n−r)! arrangements of r items chosen from n, and with repetition n^r, where each of the r positions may be any of the n items. The combinations endpoint counts unordered selections: without repetition the binomial coefficient nCr = n!/(r!·(n−r)!), and with repetition (multisets) C(n+r−1, r), where repeats are allowed. All results are computed with BigInt so they are exact no matter how large, returned as a string with the number of digits and a floating-point approximation when it fits. n and r are non-negative integers up to 100000. Everything is computed locally and deterministically, so it is instant and private. Ideal for probability, statistics, lottery, game-design, cryptography and education app developers, counting and odds tools, and discrete-maths teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is counting combinatorics; for modular arithmetic use a modular API and for descriptive statistics a statistics API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/combinatorics-api","description":"oanor gateway"}],"tags":[{"name":"Combinatorics"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/combinations":{"get":{"operationId":"get_v1_combinations","tags":["Combinatorics"],"summary":"Combinations","description":"","parameters":[{"name":"n","in":"query","required":true,"description":"Total items n","schema":{"type":"string"},"example":"10"},{"name":"r","in":"query","required":true,"description":"Chosen r","schema":{"type":"string"},"example":"3"},{"name":"repetition","in":"query","required":false,"description":"Allow repetition (true/false)","schema":{"type":"string"},"example":"false"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Combinations without repetition: the binomial coefficient nCr = n!/(r!·(n−r)!) unordered selections.","inputs":{"n":10,"r":3,"repetition":false},"formula":"n! / (r!·(n − r)!)","combinations":{"exact":"120","digits":3,"approximate":120}},"meta":{"timestamp":"2026-06-05T11:30:31.938Z","request_id":"433627c2-5c4a-4e47-825a-c891aea78961"},"status":"ok","message":"Combinations","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/factorial":{"get":{"operationId":"get_v1_factorial","tags":["Combinatorics"],"summary":"Factorial","description":"","parameters":[{"name":"n","in":"query","required":true,"description":"Non-negative integer","schema":{"type":"string"},"example":"10"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"n! = 1·2·3···n (0! = 1). Returned exactly as a string; the floating-point approximation is null once it exceeds ~1.8×10^308.","inputs":{"n":10},"factorial":{"exact":"3628800","digits":7,"approximate":3628800}},"meta":{"timestamp":"2026-06-05T11:30:32.029Z","request_id":"63d6cf92-61b6-4ef3-92ec-a2cb169b92c2"},"status":"ok","message":"Factorial","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/permutations":{"get":{"operationId":"get_v1_permutations","tags":["Combinatorics"],"summary":"Permutations","description":"","parameters":[{"name":"n","in":"query","required":true,"description":"Total items n","schema":{"type":"string"},"example":"10"},{"name":"r","in":"query","required":true,"description":"Chosen r","schema":{"type":"string"},"example":"3"},{"name":"repetition","in":"query","required":false,"description":"Allow repetition (true/false)","schema":{"type":"string"},"example":"false"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Permutations without repetition: nPr = n!/(n−r)! ordered arrangements of r items from n.","inputs":{"n":10,"r":3,"repetition":false},"formula":"n! / (n − r)!","permutations":{"exact":"720","digits":3,"approximate":720}},"meta":{"timestamp":"2026-06-05T11:30:32.128Z","request_id":"72a4365b-f917-4e8e-bb7d-2f2a9604776c"},"status":"ok","message":"Permutations","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"n and r are non-negative integers up to 100000. Results are exact (BigInt) and returned as a string with the digit count; a float approximation is included when it fits.","service":"combinatorics-api","formulae":{"combinations":"nCr = n!/(r!(n−r)!) ; with repetition C(n+r−1, r)","permutations":"nPr = n!/(n−r)! ; with repetition n^r"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/factorial":"n! as an exact integer with its digit count.","GET /v1/combinations":"nCr (binomial) unordered selections, with or without repetition.","GET /v1/permutations":"nPr ordered arrangements, with or without repetition."},"description":"Combinatorics calculator: factorial, permutations and combinations with or without repetition, computed exactly with arbitrary-precision integers."},"meta":{"timestamp":"2026-06-05T11:30:32.244Z","request_id":"f571f840-2261-4745-8ddf-20657a6966a7"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4200,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":44000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1300,"monthly_call_quota":222000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4200,"monthly_call_quota":1310000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/combinatorics-api"}