Live spec
Interactive Reference
Search operations, inspect schemas, and run requests directly against the live API.
Start here
Begin with a POST to https://api.which-llm.com/decision/optimize. If payment is required, the response body tells you the exact amount, supported chains, and receiver address to use before retrying the same request.
- 1. Call optimize Use a stable Idempotency-Key when you want safe retries.
- 2. Read the 402 body Use required_amount, accepts[].chain, and accepts[].pay_to.
- 3. Retry with proof Send payment proof headers after the on-chain transfer settles.
Core endpoints
Most integrations only need one paid decision call and one follow-up reporting call.
- https://api.which-llm.com/decision/optimize Returns the recommended model, expected tradeoffs, fallback options, and explainability.
- https://api.which-llm.com/decision/outcome Records actual execution results and may return a credit token for a later paid call.
- https://api.which-llm.com/capabilities Machine-readable discovery for capabilities, pricing model, and available endpoints.
Payment retry headers
After a successful payment, retry the exact request with the headers below. The amount must match the required value exactly.
- X-Payment-Chain Required on the paid retry request.
- X-Payment-Tx Required on the paid retry request.
- X-Payer Required on the paid retry request.
- X-Payment-Amount Required on the paid retry request.
- X-Payment-Asset Required on the paid retry request.