curl -X POST "https://api.llmide.app/v1/diagnosis?deployId=dep_12345" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_789",
"status": 0,
"content": {
"input": "Prompt variables: {...}",
"output": "LLM reply content"
},
"latency": 2450,
"startAt": 1720780800000,
"endAt": 1720780802450,
"additional_properties": {
"trace_id": "trc_abc",
"token_usage": { "prompt_tokens": 200, "completion_tokens": 150 }
}
}'import requests
import json
headers = {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json'
}
params = {
'deployId': 'dep_12345'
}
data = {
'sessionId': 'sess_789',
'status': 0,
'content': {
'input': 'Prompt variables: {...}',
'output': 'LLM reply content'
},
'latency': 2450,
'startAt': 1720780800000,
'endAt': 1720780802450,
'additional_properties': {
'trace_id': 'trc_abc',
'token_usage': {'prompt_tokens': 200, 'completion_tokens': 150}
}
}
response = requests.post(
'https://api.llmide.app/v1/diagnosis',
headers=headers,
params=params,
data=json.dumps(data)
)
print(response.json())const response = await fetch('https://api.llmide.app/v1/diagnosis?deployId=dep_12345', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'sess_789',
status: 0,
content: {
input: 'Prompt variables: {...}',
output: 'LLM reply content'
},
latency: 2450,
startAt: 1720780800000,
endAt: 1720780802450,
additional_properties: {
trace_id: 'trc_abc',
token_usage: { prompt_tokens: 200, completion_tokens: 150 }
}
})
});
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.llmide.app/v1/prompts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => 'sess_789',
'status' => 0,
'content' => [
'input' => 'Prompt variables: {...}',
'output' => 'LLM reply content'
],
'latency' => 2450,
'startAt' => 1720780800000,
'endAt' => 1720780802450,
'additional_properties' => [
'trace_id' => 'trc_abc',
'token_usage' => [
'prompt_tokens' => 200,
'completion_tokens' => 150
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.llmide.app/v1/prompts"
payload := strings.NewReader("{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.llmide.app/v1/prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.llmide.app/v1/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "diag_abc123",
"status": "success",
"message": "Diagnosis data recorded successfully"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate limit exceeded",
"details": {
"limit": 123,
"used": 123,
"resetTime": 123,
"upgradeUrl": "<string>"
}
}{
"error": "<string>"
}Submit diagnosis data
Submits external diagnosis session data (including input/output, timing, and additional fields) to the backend diagnosis table and generates API call logs
curl -X POST "https://api.llmide.app/v1/diagnosis?deployId=dep_12345" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_789",
"status": 0,
"content": {
"input": "Prompt variables: {...}",
"output": "LLM reply content"
},
"latency": 2450,
"startAt": 1720780800000,
"endAt": 1720780802450,
"additional_properties": {
"trace_id": "trc_abc",
"token_usage": { "prompt_tokens": 200, "completion_tokens": 150 }
}
}'import requests
import json
headers = {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json'
}
params = {
'deployId': 'dep_12345'
}
data = {
'sessionId': 'sess_789',
'status': 0,
'content': {
'input': 'Prompt variables: {...}',
'output': 'LLM reply content'
},
'latency': 2450,
'startAt': 1720780800000,
'endAt': 1720780802450,
'additional_properties': {
'trace_id': 'trc_abc',
'token_usage': {'prompt_tokens': 200, 'completion_tokens': 150}
}
}
response = requests.post(
'https://api.llmide.app/v1/diagnosis',
headers=headers,
params=params,
data=json.dumps(data)
)
print(response.json())const response = await fetch('https://api.llmide.app/v1/diagnosis?deployId=dep_12345', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'sess_789',
status: 0,
content: {
input: 'Prompt variables: {...}',
output: 'LLM reply content'
},
latency: 2450,
startAt: 1720780800000,
endAt: 1720780802450,
additional_properties: {
trace_id: 'trc_abc',
token_usage: { prompt_tokens: 200, completion_tokens: 150 }
}
})
});
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.llmide.app/v1/prompts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => 'sess_789',
'status' => 0,
'content' => [
'input' => 'Prompt variables: {...}',
'output' => 'LLM reply content'
],
'latency' => 2450,
'startAt' => 1720780800000,
'endAt' => 1720780802450,
'additional_properties' => [
'trace_id' => 'trc_abc',
'token_usage' => [
'prompt_tokens' => 200,
'completion_tokens' => 150
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.llmide.app/v1/prompts"
payload := strings.NewReader("{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.llmide.app/v1/prompts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.llmide.app/v1/prompts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"sess_789\",\n \"status\": 0,\n \"content\": {\n \"input\": \"Prompt variables: {...}\",\n \"output\": \"LLM reply content\"\n },\n \"latency\": 2450,\n \"startAt\": 1720780800000,\n \"endAt\": 1720780802450,\n \"additional_properties\": {\n \"trace_id\": \"trc_abc\",\n \"token_usage\": {\n \"prompt_tokens\": 200,\n \"completion_tokens\": 150\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "diag_abc123",
"status": "success",
"message": "Diagnosis data recorded successfully"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate limit exceeded",
"details": {
"limit": 123,
"used": 123,
"resetTime": 123,
"upgradeUrl": "<string>"
}
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The target deployment ID. Must belong to the current API key's workspace and be in active state
"dep_12345"
Body
Diagnosis session data to be recorded
External diagnosis session identifier
"sess_789"
Business-defined status code, stored as integer
0
Session input/output content. At least one of input or output must be provided
- Option 1
- Option 2
Show child attributes
Show child attributes
Call latency in milliseconds
x >= 02450
Session start time, UNIX millisecond timestamp, must be non-negative
x >= 01720780800000
Session end time, UNIX millisecond timestamp, must be non-negative
x >= 01720780802450
Arbitrary JSON structure for additional information, stored as-is
{
"trace_id": "trc_abc",
"token_usage": {
"prompt_tokens": 200,
"completion_tokens": 150
}
}