API Reference
Calibrated confidence scoring for LLM outputs. One endpoint. Instant integration.
Base URL
https://api.confiscore.io/v1/scorePOST
/v1/scoreReturns a calibrated confidence score for an LLM-generated statement.
Request
Send as JSON body with Content-Type: application/json
Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Body Parameters
statement*
string
The LLM output to evaluate
The full text statement or claim generated by the LLM
context*
string
The generation context
The prompt, system message, documents, or knowledge base used to generate the statement
temperature
number
optional
Sampling temperature used
Value from 0 to 2. Used for Platt scaling calibration. Defaults to 0.7 if omitted.
platt_a
number
optional
Platt scaling parameter a
If you have calibrated your LLM, provide the Platt scaling coefficient. Improves accuracy if provided.
platt_b
number
optional
Platt scaling parameter b
Platt scaling bias term. Pair with platt_a for best results.
Example Request
curl -X POST https://api.confiscore.io/v1/score \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"statement": "The capital of France is Paris.",
"context": "User asked: What is the capital of France?\nWikipedia: France is a country in Western Europe...",
"temperature": 0.7
}'Response
Returns a JSON object with the confidence score and metadata
Response Fields
confidence number
Calibrated confidence score
Float between 0 and 1. Higher = more confident. Use thresholds appropriate for your use case.
ece number
Expected Calibration Error
How well-calibrated this specific score is. Lower is better. Typical values: 0.01–0.1.
model string
Model identifier
Echoed from your request or set to "default" if not specified.
Example Response
{
"confidence": 0.923,
"ece": 0.031,
"model": "gpt-4",
"request_id": "req_8f3d2a1b"
}Status Codes
200Success — confidence score returned
400Bad request — missing required fields
401Unauthorized — invalid or missing API key
429Rate limit exceeded — upgrade your plan
500Server error — contact support
SDKs & Libraries
Pythonpip install confiscore
Coming soonJavaScript / TypeScriptnpm install confiscore-js
Coming soonREST APIAny HTTP client
Available now