curl --request GET \
--url https://api.trulayer.ai/v1/control/actions/{id}/diff \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/control/actions/{id}/diff"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trulayer.ai/v1/control/actions/{id}/diff', 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://api.trulayer.ai/v1/control/actions/{id}/diff",
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://api.trulayer.ai/v1/control/actions/{id}/diff"
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://api.trulayer.ai/v1/control/actions/{id}/diff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/control/actions/{id}/diff")
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{
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"original_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remediated_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_length_delta": 123,
"latency_delta_ms": 123,
"embedding_similarity": 123,
"score_deltas": [
{
"eval_rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"original_score": 123,
"remediated_score": 123,
"delta": 123
}
],
"summary": "<string>",
"citation_density_delta": 123
}{
"status": "pending",
"reason": "evaluation_incomplete"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"reason": "no_remediated_span"
}Get the per-trace remediation diff for a control action
Returns a comparison of the original LLM span against the
remediated span produced by a retry control action — token
length delta, latency delta, Claude-rated similarity, and
per-rule eval score deltas. Lazy-computed on first GET and
cached for subsequent requests. TRU-363.
Status codes:
- 200 — diff available (cached or just computed)
- 202 —
evaluation_incomplete: caller should poll - 404 — action not found / cross-tenant
- 422 —
no_remediated_span: action type cannot produce a diff (currentlyfallback_modelandprompt_modification)
curl --request GET \
--url https://api.trulayer.ai/v1/control/actions/{id}/diff \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/control/actions/{id}/diff"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.trulayer.ai/v1/control/actions/{id}/diff', 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://api.trulayer.ai/v1/control/actions/{id}/diff",
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://api.trulayer.ai/v1/control/actions/{id}/diff"
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://api.trulayer.ai/v1/control/actions/{id}/diff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/control/actions/{id}/diff")
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{
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"original_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remediated_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_length_delta": 123,
"latency_delta_ms": 123,
"embedding_similarity": 123,
"score_deltas": [
{
"eval_rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"original_score": 123,
"remediated_score": 123,
"delta": 123
}
],
"summary": "<string>",
"citation_density_delta": 123
}{
"status": "pending",
"reason": "evaluation_incomplete"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"reason": "no_remediated_span"
}Authorizations
SDK API key (tl_...) or Clerk session JWT
Path Parameters
Response
Remediation diff
Per-trace remediation diff for a retry control action. Lazy-
computed on first GET and cached. embedding_similarity is a
0..1 score from a Claude similarity rating, with the sentinel
-1.0 when the rater call failed. TRU-363.
remediated_tokens - original_tokens (sum of prompt + completion).
remediated_latency_ms - original_latency_ms.
0..1 similarity, or -1.0 when the rater call failed.
Show child attributes
Show child attributes
citations_per_1k_chars(remediated) - citations_per_1k_chars(original). Null for diffs computed before TRU-373 (column nullable, no backfill) and when both outputs are empty. TRU-373.