{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Traceloop API Schemas", "description": "JSON Schema definitions for Traceloop REST API request and response objects", "definitions": { "evaluator_Property": { "properties": { "description": { "type": "string" }, "enum_values": { "description": "The allowed values for this property. Only applicable when `type` is `enum`.", "items": { "type": "string" }, "type": "array" }, "label": { "type": "string" }, "name": { "type": "string" }, "type": { "$ref": "#/components/schemas/evaluator.PropertyType" } }, "required": [ "name", "type" ], "type": "object" }, "evaluator_PropertyType": { "enum": [ "string", "int", "float", "boolean", "enum" ], "type": "string", "x-enum-varnames": [ "StringType", "IntType", "FloatType", "BooleanType", "EnumType" ] }, "model_LLMMessage": { "properties": { "content": { "type": "string" }, "role": { "type": "string" }, "tool_call_id": { "type": "string" } }, "type": "object" }, "request_AgentEfficiencyInput": { "properties": { "trajectory_completions": { "example": "[\"User found\", \"Email updated\", \"Changes saved\"]", "type": "string" }, "trajectory_prompts": { "example": "[\"Find user info\", \"Update email\", \"Save changes\"]", "type": "string" } }, "required": [ "trajectory_completions", "trajectory_prompts" ], "type": "object" }, "request_AgentEfficiencyRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AgentEfficiencyInput" } }, "required": [ "input" ], "type": "object" }, "request_AgentFlowQualityConfigRequest": { "properties": { "conditions": { "example": [ "no tools called", "agent completed task" ], "items": { "type": "string" }, "type": "array" }, "threshold": { "example": 0.5, "type": "number" } }, "required": [ "conditions", "threshold" ], "type": "object" }, "request_AgentFlowQualityInput": { "properties": { "trajectory_completions": { "example": "[\"Found 5 flights\", \"Selected $299 flight\", \"Booking confirmed\"]", "type": "string" }, "trajectory_prompts": { "example": "[\"Search for flights\", \"Select the cheapest option\", \"Confirm booking\"]", "type": "string" } }, "required": [ "trajectory_completions", "trajectory_prompts" ], "type": "object" }, "request_AgentFlowQualityRequest": { "properties": { "config": { "$ref": "#/components/schemas/request.AgentFlowQualityConfigRequest" }, "input": { "$ref": "#/components/schemas/request.AgentFlowQualityInput" } }, "required": [ "config", "input" ], "type": "object" }, "request_AgentGoalAccuracyInput": { "properties": { "completion": { "example": "I have booked your flight from New York to Los Angeles departing Monday at 9am.", "type": "string" }, "question": { "example": "Book a flight from NYC to LA for next Monday", "type": "string" }, "reference": { "example": "Flight booked: NYC to LA, Monday departure", "type": "string" } }, "required": [ "completion", "question", "reference" ], "type": "object" }, "request_AgentGoalAccuracyRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AgentGoalAccuracyInput" } }, "required": [ "input" ], "type": "object" }, "request_AgentGoalCompletenessConfigRequest": { "properties": { "threshold": { "example": 0.5, "type": "number" } }, "required": [ "threshold" ], "type": "object" }, "request_AgentGoalCompletenessInput": { "properties": { "trajectory_completions": { "example": "[\"Account created\", \"Preferences saved\", \"Notifications enabled\"]", "type": "string" }, "trajectory_prompts": { "example": "[\"Create new account\", \"Set preferences\", \"Enable notifications\"]", "type": "string" } }, "required": [ "trajectory_completions", "trajectory_prompts" ], "type": "object" }, "request_AgentGoalCompletenessRequest": { "properties": { "config": { "$ref": "#/components/schemas/request.AgentGoalCompletenessConfigRequest" }, "input": { "$ref": "#/components/schemas/request.AgentGoalCompletenessInput" } }, "required": [ "input" ], "type": "object" }, "request_AgentToolErrorDetectorInput": { "properties": { "tool_input": { "example": "{\"action\": \"search\", \"query\": \"flights to Paris\"}", "type": "string" }, "tool_output": { "example": "{\"status\": \"success\", \"results\": [{\"flight\": \"AF123\", \"price\": 450}]}", "type": "string" } }, "required": [ "tool_input", "tool_output" ], "type": "object" }, "request_AgentToolErrorDetectorRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AgentToolErrorDetectorInput" } }, "required": [ "input" ], "type": "object" }, "request_AgentToolTrajectoryConfigRequest": { "properties": { "input_params_sensitive": { "example": true, "type": "boolean" }, "mismatch_sensitive": { "example": false, "type": "boolean" }, "order_sensitive": { "example": false, "type": "boolean" }, "threshold": { "example": 0.5, "type": "number" } }, "type": "object" }, "request_AgentToolTrajectoryInput": { "properties": { "executed_tool_calls": { "example": "[{\"name\": \"search\", \"input\": {\"query\": \"weather\"}}]", "type": "string" }, "expected_tool_calls": { "example": "[{\"name\": \"search\", \"input\": {\"query\": \"weather\"}}]", "type": "string" } }, "required": [ "executed_tool_calls", "expected_tool_calls" ], "type": "object" }, "request_AgentToolTrajectoryRequest": { "properties": { "config": { "$ref": "#/components/schemas/request.AgentToolTrajectoryConfigRequest" }, "input": { "$ref": "#/components/schemas/request.AgentToolTrajectoryInput" } }, "required": [ "input" ], "type": "object" }, "request_AnswerCompletenessInput": { "properties": { "completion": { "example": "Paris.", "type": "string" }, "context": { "example": "The capital of France is Paris.", "type": "string" }, "question": { "example": "What is the capital of France?", "type": "string" } }, "required": [ "completion", "context", "question" ], "type": "object" }, "request_AnswerCompletenessRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AnswerCompletenessInput" } }, "required": [ "input" ], "type": "object" }, "request_AnswerCorrectnessInput": { "properties": { "completion": { "example": "World War II ended in 1945.", "type": "string" }, "ground_truth": { "example": "1945", "type": "string" }, "question": { "example": "What year did World War II end?", "type": "string" } }, "required": [ "completion", "ground_truth", "question" ], "type": "object" }, "request_AnswerCorrectnessRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AnswerCorrectnessInput" } }, "required": [ "input" ], "type": "object" }, "request_AnswerRelevancyInput": { "properties": { "answer": { "example": "The capital of France is Paris.", "type": "string" }, "question": { "example": "What is the capital of France?", "type": "string" } }, "required": [ "answer", "question" ], "type": "object" }, "request_AnswerRelevancyRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.AnswerRelevancyInput" } }, "required": [ "input" ], "type": "object" }, "request_CharCountInput": { "properties": { "text": { "example": "Hello, world! This is a sample text.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "request_CharCountRatioInput": { "properties": { "denominator_text": { "example": "This is a longer text for comparison", "type": "string" }, "numerator_text": { "example": "Short text", "type": "string" } }, "required": [ "denominator_text", "numerator_text" ], "type": "object" }, "request_CharCountRatioRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.CharCountRatioInput" } }, "required": [ "input" ], "type": "object" }, "request_CharCountRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.CharCountInput" } }, "required": [ "input" ], "type": "object" }, "request_ContextRelevanceConfigRequest": { "properties": { "model": { "example": "gpt-4o", "type": "string" } }, "type": "object" }, "request_ContextRelevanceInput": { "properties": { "completion": { "example": "Our store is open Monday to Friday from 9am to 6pm, and Saturday from 10am to 4pm. We are closed on Sundays.", "type": "string" }, "context": { "example": "Our store is open Monday to Friday from 9am to 6pm, and Saturday from 10am to 4pm. We are closed on Sundays.", "type": "string" }, "query": { "example": "What are the business hours?", "type": "string" } }, "required": [ "completion", "context", "query" ], "type": "object" }, "request_ContextRelevanceRequest": { "properties": { "config": { "$ref": "#/components/schemas/request.ContextRelevanceConfigRequest" }, "input": { "$ref": "#/components/schemas/request.ContextRelevanceInput" } }, "required": [ "input" ], "type": "object" }, "request_ConversationQualityInput": { "properties": { "completions": { "example": "[\"Hi! I'd be happy to assist you today.\", \"We offer consulting, development, and support services.\"]", "type": "string" }, "prompts": { "example": "[\"Hello, how can I help?\", \"What services do you offer?\"]", "type": "string" } }, "required": [ "completions", "prompts" ], "type": "object" }, "request_ConversationQualityRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.ConversationQualityInput" } }, "required": [ "input" ], "type": "object" }, "request_CreateAutoMonitorSetupInput": { "properties": { "evaluators": { "description": "List of evaluator slugs to run on matched spans", "example": [ "hallucination", "toxicity" ], "items": { "type": "string" }, "minItems": 1, "type": "array" }, "external_id": { "description": "Unique identifier for the auto monitor setup, used to reference it in future requests", "example": "my-agent-monitor-1", "type": "string" }, "selector": { "description": "Map of span attributes to filter which spans this monitor applies to.\nKeys are span attribute names (e.g. gen_ai.system, gen_ai.request.model) and\nvalues can be strings, numbers, or booleans.\nExample: {\"gen_ai.system\": \"openai\", \"gen_ai.request.model\": \"gpt-4o\", \"gen_ai.request.max_tokens\": 1000}", "type": "object" } }, "required": [ "evaluators", "external_id" ], "type": "object" }, "request_CreateCustomEvaluatorInput": { "properties": { "description": { "type": "string" }, "frequency_penalty": { "type": "number" }, "input_schema": { "description": "Schemas", "items": { "$ref": "#/components/schemas/evaluator.Property" }, "type": "array" }, "logprobs": { "type": "boolean" }, "max_tokens": { "type": "integer" }, "messages": { "description": "LLM Message configuration", "items": { "$ref": "#/components/schemas/model.LLMMessage" }, "type": "array" }, "mode": { "type": "string" }, "model": { "description": "LLM parameters (from BaseLLMConfig)", "type": "string" }, "name": { "description": "Basic fields", "type": "string" }, "output_schema": { "items": { "$ref": "#/components/schemas/evaluator.Property" }, "type": "array" }, "presence_penalty": { "type": "number" }, "provider": { "description": "Provider configuration", "type": "string" }, "slug": { "type": "string" }, "stop": { "items": { "type": "string" }, "type": "array" }, "temperature": { "type": "number" }, "top_p": { "type": "number" } }, "required": [ "input_schema", "messages", "model", "name", "output_schema", "provider" ], "type": "object" }, "request_CreateOrganizationRequest": { "properties": { "envs": { "items": { "type": "string" }, "type": "array" }, "org_name": { "type": "string" }, "retention_hours": { "type": "integer", "description": "Data retention period in hours (1-720). Defaults to 720 (1 month).", "minimum": 1, "maximum": 720, "default": 720 } }, "required": [ "org_name" ], "type": "object" }, "request_FaithfulnessInput": { "properties": { "completion": { "example": "The Eiffel Tower is located in Paris and was built in 1889.", "type": "string" }, "context": { "example": "The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It was constructed from 1887 to 1889.", "type": "string" }, "question": { "example": "When was the Eiffel Tower built?", "type": "string" } }, "required": [ "completion", "context", "question" ], "type": "object" }, "request_FaithfulnessRequest": { "properties": { "input": { "$ref": "#/components/schemas/request.FaithfulnessInput" } }, "required": [ "input" ], "type": "object" }, "request_GetMetricsRequest": { "properties": { "from_timestamp_sec": { "type": "integer", "description": "Start time in Unix seconds timestamp.", "example": 1772905218 }, "to_timestamp_sec": { "type": "integer", "description": "End time in Unix seconds timestamp.", "example": 1772905218 }, "cursor": { "type": "integer", "description": "Pagination cursor for fetching the next page of results. The cursor is returned in the response to the previous request.", "example": 1772905218000 }, "environments": { "items": { "type": "string" }, "type": "array", "description": "List of environments to filter by", "example": [ "prd", "stg", "dev" ] }, "filters": { "items": { "$ref": "#/components/schemas/shared.FilterCondition" }, "type": "array" }, "limit": { "type": "integer", "description": "Maximum number of metrics to return per page.", "example": 50 }, "logical_operator": { "$ref": "#/components/schemas/types.LogicalOperator" }, "metric_name": { "type": "string", "description": "Metric name to filter by. The metric_name is a metric attribute that is set on the metric object.", "example": "answer relevancy" }, "metric_source": { "type": "string", "description": "Metric source to filter by. The metric_source is a metric attribute that is set on the metric object.", "example": "llm_as_a_judge" }, "sort_by": { "type": "string", "description": "Field to sort by.", "example": "timestamp" }, "sort_order": { "type": "string", "description": "Sort order.", "example": "ASC" } }, "type": "object" }, "request_HtmlComparisonInput": { "properties": { "html1": { "example": "