cURL
curl --request GET \
--url https://aigw.portkey.ai/v1/logs/{logId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://aigw.portkey.ai/v1/logs/{logId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://aigw.portkey.ai/v1/logs/{logId}', 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://aigw.portkey.ai/v1/logs/{logId}",
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://aigw.portkey.ai/v1/logs/{logId}"
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://aigw.portkey.ai/v1/logs/{logId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://aigw.portkey.ai/v1/logs/{logId}")
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{
"_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request": {
"url": "<string>",
"method": "GET",
"portkeyHeaders": {},
"headers": {},
"body": {}
},
"response": {
"status": 123,
"responseTime": 123,
"lastUsedOptionJsonPath": "<string>",
"headers": {},
"body": {}
},
"organisation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"metrics": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "<string>",
"organisation_name": "<string>",
"prompt_id": "<string>",
"prompt_version_id": "<string>",
"config_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"is_success": true,
"ai_org": "<string>",
"ai_model": "<string>",
"req_units": 123,
"res_units": 123,
"total_units": 123,
"cost": 123,
"cost_currency": "USD",
"request_url": "<string>",
"request_method": "<string>",
"response_status_code": 123,
"response_time": 123,
"is_proxy_call": true,
"cache_status": "<string>",
"cache_type": "<string>",
"stream_mode": 123,
"retry_success_count": 123,
"trace_id": "<string>",
"span_id": "<string>",
"span_name": "<string>",
"parent_span_id": "<string>",
"mode": "<string>",
"virtual_key": "<string>",
"source": "<string>",
"runtime": "<string>",
"runtime_version": "<string>",
"sdk_version": "<string>",
"config": "<string>",
"internal_trace_id": "<string>",
"last_used_option_index": 123,
"config_version_id": "<string>",
"prompt_slug": "<string>",
"workspace_slug": "<string>",
"log_store_file_path_format": "<string>",
"metadata.key": [
"<string>"
],
"metadata.value": [
"<string>"
],
"api_key_id": "<string>",
"request_parsing_time": 123,
"pre_processing_time": 123,
"cache_processing_time": 123,
"response_parsing_time": 123,
"gateway_processing_time": 123,
"upstream_response_time": 123
},
"finalUntransformedRequest": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
},
"originalResponse": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
},
"transformedRequest": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
}
}Get logs by log id
GET
/
logs
/
{logId}
cURL
curl --request GET \
--url https://aigw.portkey.ai/v1/logs/{logId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://aigw.portkey.ai/v1/logs/{logId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://aigw.portkey.ai/v1/logs/{logId}', 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://aigw.portkey.ai/v1/logs/{logId}",
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://aigw.portkey.ai/v1/logs/{logId}"
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://aigw.portkey.ai/v1/logs/{logId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://aigw.portkey.ai/v1/logs/{logId}")
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{
"_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request": {
"url": "<string>",
"method": "GET",
"portkeyHeaders": {},
"headers": {},
"body": {}
},
"response": {
"status": 123,
"responseTime": 123,
"lastUsedOptionJsonPath": "<string>",
"headers": {},
"body": {}
},
"organisation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"metrics": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "<string>",
"organisation_name": "<string>",
"prompt_id": "<string>",
"prompt_version_id": "<string>",
"config_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"is_success": true,
"ai_org": "<string>",
"ai_model": "<string>",
"req_units": 123,
"res_units": 123,
"total_units": 123,
"cost": 123,
"cost_currency": "USD",
"request_url": "<string>",
"request_method": "<string>",
"response_status_code": 123,
"response_time": 123,
"is_proxy_call": true,
"cache_status": "<string>",
"cache_type": "<string>",
"stream_mode": 123,
"retry_success_count": 123,
"trace_id": "<string>",
"span_id": "<string>",
"span_name": "<string>",
"parent_span_id": "<string>",
"mode": "<string>",
"virtual_key": "<string>",
"source": "<string>",
"runtime": "<string>",
"runtime_version": "<string>",
"sdk_version": "<string>",
"config": "<string>",
"internal_trace_id": "<string>",
"last_used_option_index": 123,
"config_version_id": "<string>",
"prompt_slug": "<string>",
"workspace_slug": "<string>",
"log_store_file_path_format": "<string>",
"metadata.key": [
"<string>"
],
"metadata.value": [
"<string>"
],
"api_key_id": "<string>",
"request_parsing_time": 123,
"pre_processing_time": 123,
"cache_processing_time": 123,
"response_parsing_time": 123,
"gateway_processing_time": 123,
"upstream_response_time": 123
},
"finalUntransformedRequest": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
},
"originalResponse": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
},
"transformedRequest": {
"body": {},
"headers": {},
"url": "<string>",
"method": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Available options:
v1, v2 Available options:
hooks Response
200 - application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on September 18, 2026
Was this page helpful?

