Compare metrics across two windows
curl --request GET \
--url https://api.outerlayer.ai/v1/metrics/compare \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/metrics/compare"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/metrics/compare', 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.outerlayer.ai/v1/metrics/compare",
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>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/metrics/compare"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/metrics/compare")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/metrics/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"windowA": {
"from": "<string>",
"metrics": {
"activeActors": 123,
"autoApprovedRate": 123,
"cleanSessionRate": 123,
"handsOnRate": 123,
"modelMix": [
{
"model": "<string>",
"sessions": 1
}
],
"sessions": 123,
"toolDenialRate": 123,
"toolErrorRate": 123,
"totalCost": 123,
"unpricedSessions": 123
},
"to": "<string>"
},
"windowB": {
"from": "<string>",
"metrics": {
"activeActors": 123,
"autoApprovedRate": 123,
"cleanSessionRate": 123,
"handsOnRate": 123,
"modelMix": [
{
"model": "<string>",
"sessions": 1
}
],
"sessions": 123,
"toolDenialRate": 123,
"toolErrorRate": 123,
"totalCost": 123,
"unpricedSessions": 123
},
"to": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Metrics
Compare metrics across two windows
Correlational comparison — not causal attribution: returns fleet-behavior tiles for two EXPLICIT, caller-chosen windows (a, b; UTC calendar dates), side by side. Neither window defaults — this is for “before vs. after a specific change” (e.g. either side of a context sync from GET /v1/context/changes), not a rolling comparison.
GET
/
v1
/
metrics
/
compare
Compare metrics across two windows
curl --request GET \
--url https://api.outerlayer.ai/v1/metrics/compare \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/metrics/compare"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/metrics/compare', 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.outerlayer.ai/v1/metrics/compare",
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>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/metrics/compare"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/metrics/compare")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/metrics/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"windowA": {
"from": "<string>",
"metrics": {
"activeActors": 123,
"autoApprovedRate": 123,
"cleanSessionRate": 123,
"handsOnRate": 123,
"modelMix": [
{
"model": "<string>",
"sessions": 1
}
],
"sessions": 123,
"toolDenialRate": 123,
"toolErrorRate": 123,
"totalCost": 123,
"unpricedSessions": 123
},
"to": "<string>"
},
"windowB": {
"from": "<string>",
"metrics": {
"activeActors": 123,
"autoApprovedRate": 123,
"cleanSessionRate": 123,
"handsOnRate": 123,
"modelMix": [
{
"model": "<string>",
"sessions": 1
}
],
"sessions": 123,
"toolDenialRate": 123,
"toolErrorRate": 123,
"totalCost": 123,
"unpricedSessions": 123
},
"to": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Factory id the request is scoped to.
API key (sk_outerlayer_*)
Query Parameters
Response
Fleet metrics for both windows.
Show child attributes
Show child attributes