Skip to content

Record calls answered elsewhere

POST
/v1/captures
curl --request POST \
--url https://api.pensievelabs.co/v1/captures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "grade-audit", "calls": [ { "input": { "task": "rust-2291", "grade": "pass" }, "answer": "grade_holds", "source": "frontier", "provider_model": "frontier-large", "latency_ms": 2140, "key": "rust-2291" } ] }'

Calls your own code answered, usually a frontier model, recorded so Pensieve can build the test and training data from real traffic. The SDK’s capture sends these for you.

Idempotency-Key
string
<= 255 characters

Any unique string. Sending it again within 24 hours returns the first response.

Media typeapplication/json
object
model
required
string
calls
required
Array<object>
>= 1 items <= 1000 items
object
id

A cl_ id you made, so you can send outcomes before this arrives.

string
decision_id

The id of the decision this call follows, when Pensieve routed the case to your code. Your code’s answer is recorded on that call instead of a new one. Don’t send id with it.

string
key
string
input
required
One of:
object
key
additional properties
any
answer
required
string
confidence
number
source

What answered, such as frontier, rules or human.

string
default: frontier
provider_model
string
latency_ms
integer
created_at
string format: date-time

Example

{
"model": "grade-audit",
"calls": [
{
"input": {
"task": "rust-2291",
"grade": "pass"
},
"answer": "grade_holds",
"source": "frontier",
"provider_model": "frontier-large",
"latency_ms": 2140,
"key": "rust-2291"
}
]
}

The ids given to the recorded calls.

Media typeapplication/json
object
object
required
Allowed value: receipt
received
required

How many items were recorded.

integer
ids
required

For each item in order, the call or test case it was recorded as (for a capture with decision_id, that decision’s call). For an outcome, the call it was matched to, or null while it waits for its call: it is matched when a call with that id, or that model and key, is recorded.

Array<string | null>

Example

{
"object": "receipt"
}

Something went wrong; error.type says what.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request authentication permission not_found conflict rate_limit not_available server
message
required
string
param

The request field the error is about.

string | null
request_id
required
string

Example

{
"error": {
"type": "invalid_request"
}
}