API
One endpoint, your wallet
Call the estimator from your own tools. Authenticate with an API key; a high-confidence estimate spends one credit from the same balance as the web app — low- and no-data reads are free.
Authentication
Pass your key as a bearer token (or the X-API-Key header).
Authorization: Bearer csk_your_key_here
POST /estimate
Body: title (string) and optional body (string).
curl -X POST https://estimate.codershack.com/estimate \
-H "Authorization: Bearer csk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"title": "Add rate limiting to the public API", "body": ""}'
const r = await fetch("https://estimate.codershack.com/estimate", {
method: "POST",
headers: {
"Authorization": "Bearer csk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({ title: "Add rate limiting to the public API", body: "" }),
});
const decision = await r.json();
Response
The raw decision: shape, route, escalate, judgment_score, forecast, rationale. The forecast carries cost_usd, success_prob, confidence (high / low / none) and support_n.
{
"shape": "build/small/docs",
"route": { "model": "", "reasoning": "", "why": "" },
"escalate": false,
"forecast": {
"cost_usd": 0.12,
"success_prob": 0.83,
"confidence": "high",
"support_n": 6
},
"rationale": "routed default; forecast from build/small/docs (n=6, high confidence)"
}
Credits & limits
A request is billed one credit only when confidence is high. low and none are always free. Out of credits on a high-confidence call returns 402 insufficient_credits. An invalid or revoked key returns 401 invalid_api_key.