SDK reference · Node SDK
prov.trace.traces.inferences
prov.trace.traces.inferences in Node SDK.
Signature
prov.trace.traces.inferences(limit?: unknown): Promise<Record<string, unknown>[]>Parameters
limitunknown
Request fields
limitintegerquery- The most items to return, from 1 to 100. The default is 20.
qstringquery- Only inferences whose trace ID, prompt key or model version contains this text (not case-sensitive).
model_versionstringquery- Only inferences on these model versions, as a comma-separated list.
canaryenumquerytrippedfor inferences where a canary family tripped,clearfor the rest. One oftripped,clear.created_gtetimestampquery- Only inferences created at or after this time.
created_ltetimestampquery- Only inferences created at or before this time.
Returns
Promise<Record<string, unknown>[]> The traced inferences, newest first.
HTTP operation
GET /v1/trace/inferences: List traced inferences
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/chat/completions`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"model": "qwen2.5-0.5b-instruct",
"max_tokens": 40,
"temperature": 0,
"messages": [
{
"role": "system",
"content": "You are a payments assistant for Northwind. Be brief."
},
{
"role": "user",
"content": "Summarize this vendor email: 'Hi team, the October invoice is attached. The total is $1,240 and payment terms are net 30.'"
}
],
"provenance": {
"retain": true
}
}),
})).json();
const traceId = step1.provenance.trace_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/trace/inferences?limit=1`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/trace/chat/completions", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"model": "qwen2.5-0.5b-instruct",
"max_tokens": 40,
"temperature": 0,
"messages": [
{
"role": "system",
"content": "You are a payments assistant for Northwind. Be brief."
},
{
"role": "user",
"content": "Summarize this vendor email: 'Hi team, the October invoice is attached. The total is $1,240 and payment terms are net 30.'"
}
],
"provenance": {
"retain": True
}
}).json()
trace_id = step1["provenance"]["trace_id"]
data = httpx.get(f"{api}/v1/trace/inferences?limit=1", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()