API Documentation
This document provides an overview of the available API endpoints for retrieving project data, trace information, and system operations. It covers project data, trace information, and system operations.
API Endpoints
Base URL
The base URL for all endpoints is: {{HOST_URL}}
API Overview
GET/api/projects
This endpoint allows you to fetch all projects stored in the system. Each project contains metadata about the execution, including timing, cost, and token usage information.
Details
Response
Status Codes
200: Success500: Server error
200 Success
A list of projects with details like ID, project name, start and end times, duration, cost, and token usage. Schema
Example Response:
500 Internal Server Error
A server error message if something goes wrong. Schema
Example Response:
Example Usage
Python code to fetch and print all projects.
Python
Get Project Details
API Overview
GET/api/projects/{project_id}
This endpoint allows you to fetch detailed information about a specific project, including all associated metadata and system information.
Details
Path Parameters
project_id
integer
Yes
The unique identifier of the project
Response
Status Codes
200: Success500: Server error404: Not Found
200 Success
Returns detailed project information, including system specs like OS, Python version, CPU, GPU, and installed packages.
Example Response:
404 Not Found
Error message if the project is not found. Schema
Example Response:
500 Internal Server Error
Server error message. Schema
Example Response:
Example Usage
Python code to fetch and display project details for a specific project ID.
Python
Get Project Traces
API Overview
GET/api/projects/{project_id}/traces
This endpoint allows you to fetch all execution traces for a specific project, providing summary statistics and execution details like agent calls, LLM calls, tool calls, and errors for each trace.
Details
Path Parameters
project_id
integer
Yes
The unique identifier of the project
Response
Response
Status Codes
200: Success500: Server error
200 Success
A list of traces with details on execution times, agent/tool interactions, and errors.
Example Response:
500 Internal Server Error
Server error message
Example Response:
Example Usage
Python code to fetch and display project traces.
Python
Get Analysis Trace
API Overview
GET/api/analysis_traces/{trace_id}
This endpoint will fetch a detailed analysis of a specific trace, including calls to LLM models, tools, metrics, and system information.
Details
Path Parameters
trace_id
integer
Yes
The unique identifier of the trace
Response
Status Codes
200: Success404: Trace not found500: Server error
200 Success
Includes LLM calls, tool calls, metrics, and system information related to the trace.
Example Response:
404 Not Found
Error message if the trace is not found.
Example Response:
500 Internal Server Error
Server error message.
Example Response:
Example Usage
Python code snippet to initiate a new trace with the specified configurations.
Get Trace Details
API Overview
GET/api/traces/{trace_id}
This endpoin returns comprehensive details about a specific trace, including all related calls and interactions.
Details
Path Parameters
trace_id
integer
Yes
The unique identifier of the trace
Response
200: Success404: Trace not found500: Server error
200 Success
Schema
Example Response:
Example Usage:
Python code to fetch and display all available traces, including their statuses and creation timestamps.
Get Project Evaluation
API Overview
GET/api/projects/{project_id}/evaluation
This endpoint retrieves evaluation metrics for a specific project, with Trace filtering option.
Details
Path Parameters
project_id
integer
Yes
The unique identifier of the project
Query Parameters
trace_id
string
No
Filter metrics by specific trace ID. Use 'all' for all traces
Response
200: Success500: Server error
200 Success
Schema
Example Response :
Example Usage
System Management
Get Health Check
API Overview
GET/health
This is a simple endpoint used to check the health and availability of the server. It is typically used for monitoring and ensuring the API is responsive.
Details
Response
"OK"with a status code 200 to indicate that the server is healthy and operational.
Example Usage
To return the status of the port use this pyhton code
API Overview
POST/api/cache/clear
Operation Overview
This endpoint clears the server's cache storage.
Operation Details
Caching
Response is cached for 600 seconds (10 minutes)
Cache can be cleared using the /api/cache/clear endpoint
Response
200: Success500: Server error
200 Success
Schema
Example Response :
Example Usage:
Get Port
API Overview
GET/api/port
This endpoint returns the current port configuration of the server. It helps determine which port the server is running on, especially useful when there are multiple environments or when running on different servers.
Details
Response
200 Success
Returns the port number on which the server is currently running.
Example Response
Example Usage
Shutdown Server
API Overview
POST/api/shutdown
This endpoint allows for a graceful shutdown of the server. It ensures that all ongoing processes are completed before the server is stopped.
Details
Authentication
Only accessible from localhost (127.0.0.1, ::1, localhost)
Response
200: Success403: Forbidden (if not called from localhost)
200 Success
The server will begin the shutdown process.
Example Response
example Usage
403 Forbidden
Returned when the request is not from localhost
Example Usage
Python
Last updated