Catalog/llm-logprob-confidence

LLM

Confidence from logprobs API

Turns per-token logprobs into interpretable confidence metrics: sequence perplexity, mean and minimum token probability, the list of low-confidence tokens, and a 0-1 confidence score (geometric-mean probability). Answers 'how confident was the model in this output?', 'which tokens were the model unsure about?'.

Price$0.03per request
MethodPOST
Route/v1/llm/logprob-confidence
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
llmlogprobsconfidenceperplexityuncertaintycalibrationprobabilityagent
API URLhttps://x402.hexl.dev/v1/llm/logprob-confidence
Integration docs
Example request
{
  "logprobs": [
    -0.1,
    -0.2,
    -2.5,
    -0.05
  ]
}
Example response
{
  "meanLogprob": -0.7125,
  "perplexity": 2.0391,
  "meanProbability": 0.6892,
  "minTokenProbability": 0.0821,
  "lowConfidenceTokens": [
    {
      "index": 2,
      "probability": 0.0821
    }
  ],
  "confidence": 0.4904
}
Input schema
{
  "type": "object",
  "required": [
    "logprobs"
  ],
  "properties": {
    "logprobs": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "Natural-log token probabilities.",
      "examples": [
        [
          -0.1,
          -0.2,
          -2.5,
          -0.05
        ]
      ]
    },
    "lowThreshold": {
      "type": "number",
      "default": 0.5
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}