curl --request GET \
--url https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace \
--header 'Authorization: Bearer <token>'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"availability": "stored",
"attempts": [
{
"attempt": 2,
"stored": true
}
],
"items": [
{
"attempt": 2,
"seq": 2,
"at": "2023-11-07T05:31:56Z",
"kind": "prompt",
"preview": "<string>",
"preview_truncated": true,
"detail": {},
"text": "<string>"
}
],
"unplaced": [
{
"model_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attempt": 123,
"reason": "failed",
"response_id": "<string>",
"tool_call_ids": [
"<string>"
],
"status": "completed",
"input_tokens": 123,
"output_tokens": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"cost_usd": 123,
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
],
"unplaced_total": 1,
"unplaced_pagination": {
"after_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_more": true
},
"totals": {
"calls_started": 123,
"calls_finished": 123,
"input_tokens": 123,
"output_tokens": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"cost_usd": 123,
"unpriced_calls": 123
},
"pagination": {
"after_attempt": 123,
"after_seq": 123,
"has_more": true,
"limit": 123
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}Get Agent Picks run trace
Read one page of a project-owned run’s console trace: redacted prompt, setup, narration, tool calls and results, file edits and errors, ordered by attempt then seq. An attempt’s lines are available once that attempt finishes, so a running attempt has none yet; an attempt whose transcript could not be read has one error line, Trace unavailable for this attempt. availability says whether the run has stored lines, has none yet (pending: it is still running or finished within the last hour), or has none and none is expected (not_retained: it finished over an hour ago, as every run before traces were kept did), and attempts marks each attempt stored or not. A model_call item follows the first line of its attempt carrying its provider response id, else one of its tool-call ids, with tokens, cost and the running total of placed calls. Calls that match no line are in unplaced, 200 at a time in finish order: the first page (cursor 0, 0) carries the first 200 with unplaced_total, and passing unplaced_pagination.after_id as after_unplaced returns the next 200; other pages carry none. Each has a reason: failed, no_ids, pending while the run is running, or unmatched. Codex reports no ids, so its calls are never placed. totals counts every model proxy call. Each line carries preview, its first 65,536 characters, with preview_truncated when the stored text is longer; full=true with limit=1 returns one line’s whole stored text (up to 1 MiB, detail.truncated beyond). Pass pagination.after_attempt and after_seq back until has_more is false. limit defaults to 50, maximum 100; a page also stops once 256 KiB of lines are included and always holds at least one line. Requires Agent Picks and visibility.read.
curl --request GET \
--url https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace \
--header 'Authorization: Bearer <token>'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/agent-picks/runs/{runId}/trace")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"availability": "stored",
"attempts": [
{
"attempt": 2,
"stored": true
}
],
"items": [
{
"attempt": 2,
"seq": 2,
"at": "2023-11-07T05:31:56Z",
"kind": "prompt",
"preview": "<string>",
"preview_truncated": true,
"detail": {},
"text": "<string>"
}
],
"unplaced": [
{
"model_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attempt": 123,
"reason": "failed",
"response_id": "<string>",
"tool_call_ids": [
"<string>"
],
"status": "completed",
"input_tokens": 123,
"output_tokens": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"cost_usd": 123,
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
],
"unplaced_total": 1,
"unplaced_pagination": {
"after_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_more": true
},
"totals": {
"calls_started": 123,
"calls_finished": 123,
"input_tokens": 123,
"output_tokens": 123,
"cache_read_tokens": 123,
"cache_write_tokens": 123,
"cost_usd": 123,
"unpriced_calls": 123
},
"pagination": {
"after_attempt": 123,
"after_seq": 123,
"has_more": true,
"limit": 123
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}Authorizations
API key with dtk_live_ prefix. Obtain it from API Keys in the account sidebar. New keys start with all supported scopes selected for the chosen project, and you can narrow them to specific read/write scopes as needed.
Query Parameters
0 <= x <= 21474836470 <= x <= 21474836471 <= x <= 100Adds each line's whole stored text as text. Only with limit=1: pass the line's attempt and its seq minus one as the cursor.
The unplaced_pagination.after_id of the previous page; returns the next 200 unplaced calls.