Get a observation
curl --request GET \
--url https://api.example.com/api/public/observations/{observationId}import requests
url = "https://api.example.com/api/public/observations/{observationId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/public/observations/{observationId}', 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.example.com/api/public/observations/{observationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/public/observations/{observationId}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/public/observations/{observationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/public/observations/{observationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"traceId": "<string>",
"type": "<string>",
"name": "<string>",
"startTime": {},
"endTime": {},
"completionStartTime": {},
"model": "<string>",
"modelParameters": {
"property1": "<string>",
"property2": "<string>"
},
"input": null,
"version": "<string>",
"metadata": null,
"output": null,
"usage": {
"input": 123,
"output": 123,
"total": 123,
"unit": "<string>",
"inputCost": 123,
"outputCost": 123,
"totalCost": 123
},
"level": "<string>",
"statusMessage": "<string>",
"parentObservationId": "<string>",
"promptId": "<string>",
"usageDetails": {
"property1": 123,
"property2": 123
},
"costDetails": {
"property1": 123,
"property2": 123
},
"promptName": "<string>",
"promptVersion": 123,
"modelId": "<string>",
"inputPrice": 123,
"outputPrice": 123,
"totalPrice": 123,
"calculatedInputCost": 123,
"calculatedOutputCost": 123,
"calculatedTotalCost": 123,
"latency": 123,
"timeToFirstToken": 123
}Observations
Get a observation
Endpoint to Get a observation on toolzz analytics
GET
/
api
/
public
/
observations
/
{observationId}
Get a observation
curl --request GET \
--url https://api.example.com/api/public/observations/{observationId}import requests
url = "https://api.example.com/api/public/observations/{observationId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/public/observations/{observationId}', 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.example.com/api/public/observations/{observationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/public/observations/{observationId}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/public/observations/{observationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/public/observations/{observationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"traceId": "<string>",
"type": "<string>",
"name": "<string>",
"startTime": {},
"endTime": {},
"completionStartTime": {},
"model": "<string>",
"modelParameters": {
"property1": "<string>",
"property2": "<string>"
},
"input": null,
"version": "<string>",
"metadata": null,
"output": null,
"usage": {
"input": 123,
"output": 123,
"total": 123,
"unit": "<string>",
"inputCost": 123,
"outputCost": 123,
"totalCost": 123
},
"level": "<string>",
"statusMessage": "<string>",
"parentObservationId": "<string>",
"promptId": "<string>",
"usageDetails": {
"property1": 123,
"property2": 123
},
"costDetails": {
"property1": 123,
"property2": 123
},
"promptName": "<string>",
"promptVersion": 123,
"modelId": "<string>",
"inputPrice": 123,
"outputPrice": 123,
"totalPrice": 123,
"calculatedInputCost": 123,
"calculatedOutputCost": 123,
"calculatedTotalCost": 123,
"latency": 123,
"timeToFirstToken": 123
}Response Description
Below you will see the description of the Get a observation responsestring
required
Unique identifier of the observation.
string
required
Identifier of the trace associated with the observation.
string
required
Type of the observation.
string
required
Name of the observation.
date-time
required
Start time of the observation in ISO 8601 format.
date-time
required
End time of the observation in ISO 8601 format.
date-time
Time when the completion process started in ISO 8601 format.
string
required
Name of the model used in the observation.
object
null
Input data for the observation (nullable).
string
Version of the observation.
null
Metadata associated with the observation (nullable).
null
Output data from the observation (nullable).
object
required
Usage metrics for the observation.
string
required
Log level of the observation (e.g., DEBUG).
string
Status message of the observation.
string
Parent observation ID, if applicable.
string
Identifier of the prompt used in the observation.
object
object
string
Name of the prompt used in the observation.
integer
Version of the prompt used in the observation.
string
Identifier of the model used in the observation.
integer
Price for input usage.
integer
Price for output usage.
integer
Total price for the observation.
integer
Calculated input cost.
integer
Calculated output cost.
integer
Calculated total cost for the observation.
integer
Latency of the observation in milliseconds.
integer
Time taken to generate the first token in milliseconds.
Code Response
Exemples of Response CodeRequest Successful Response
Request Failure

