Decide one case
const url = 'https://api.pensievelabs.co/v1/models/grade-audit/decide';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"input":{"task":"rust-2291","grade":"pass","log":"Grader: PASS · 14 of 14 tests passed. Test change: expected page size 20 → 21"},"key":"rust-2291"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pensievelabs.co/v1/models/grade-audit/decide \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "input": { "task": "rust-2291", "grade": "pass", "log": "Grader: PASS · 14 of 14 tests passed. Test change: expected page size 20 → 21" }, "key": "rust-2291" }'Sends one case to the model’s live version (or the version you pin) and returns one of its
answers. When routed is fallback, the answer is still returned, but your code, or the SDK’s
capture, should answer instead. A model with no live version answers only with version
pinned; otherwise the call is refused with conflict.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The model’s slug, such as grade-audit, or its mdl_ id.
Example
grade-auditHeader Parameters
Section titled “Header Parameters”Any unique string. Sending it again within 24 hours returns the first response.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "input": { "task": "rust-2291", "grade": "pass", "log": "Grader: PASS · 14 of 14 tests passed. Test change: expected page size 20 → 21" }, "key": "rust-2291"}Responses
Section titled “Responses”The decision.
object
The call id; send outcomes and corrections with it.
One of the model’s answer values.
The probability of each answer value.
object
A short reason, when the model gives one.
fallback when your code should answer instead: routing is observe, the confidence is under the threshold, or the split sent the call to your code.
Example
{ "id": "cl_8f21c0d4", "object": "decision", "model": "grade-audit", "version": "v7", "answer": "false_pass", "label": "False pass", "routed": "model"}default
Section titled “default”Something went wrong; error.type says what.
object
object
The request field the error is about.
Example
{ "error": { "type": "invalid_request" }}