{"uid":"cap_e6hgcypYNWX8UaTkHZCbh","slug":"factorial-for-agents-7bb01dec","name":"Factorial for Agents","description":"Factorial (n≤20). Call for combinatorics demos and small counting problems with an explicit n cap. Returns n! for n up to 20; larger n returns a structured error. $0.001 USDC per successful call via x402 on Base—deterministic first-party JSON, no API key, no subscription, and nothing is billed on structured validation errors.","url":"https://api.delx.ai/api/v1/x402/factorial","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer","description":"Integer input (see tool summary for allowed range)."}}},"responseSchema":{"type":"json","example":{"n":12,"value":479001600,"schema":"delx/factorial/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7Wj-fi1LJOxS5ftYmgwCK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes n! (factorial) for integer n up to 20, returning the exact result or a structured error for out-of-range inputs, billed at $0.001 USDC per successful call via x402 on Base.","exampleAgentPrompt":"What is the factorial of 12?","exampleUseCases":[{"title":"Combinatorics calculation in a pipeline","prompt":"I need to know how many ways I can arrange 8 items — can you compute 8 factorial for me?"},{"title":"Education demo for permutations","prompt":"Show me the factorial of 5 so I can explain permutations to my students."},{"title":"Sanity check fixture in test suite","prompt":"Give me the exact value of 20 factorial so I can use it as a test fixture to verify my own math library."}],"resultDescription":"Returns a JSON object containing the computed factorial value (n!) as an integer for valid inputs (0 ≤ n ≤ 20). For n > 20 or invalid inputs, returns a structured JSON error indicating the out-of-range condition. Successful calls are billed $0.001 USDC; structured validation errors are not billed.","failureModes":["n > 20: returns a structured error indicating n exceeds the allowed cap, no charge","n < 0: returns a structured validation error for negative input","non-integer n: schema validation error, not billed","missing n field: structured validation error, not billed","payment failure: x402 payment rejected, call not executed"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, first-party factorial computation without shipping a math library or managing dependencies. Ideal for agentic pipelines, combinatorics demos, test fixtures, or educational tools where n is guaranteed to be 20 or below and you want a pay-per-call model with no API key or subscription overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:32.376Z","isFirstParty":false}