{ "openapi": "3.1.0", "info": { "title": "FastAPI", "version": "0.1.0" }, "paths": { "/prompt-templates/{identifier}": { "get": { "tags": [ "prompt-templates" ], "summary": "Get Prompt Template Raw Data", "description": "Retrieve raw prompt template data without applying input variables. Designed for GitHub sync, local caching, and template inspection. By default, snippets are resolved (expanded). Use resolve_snippets=false to get the raw template with snippet references intact.", "operationId": "get_prompt_template_raw", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "identifier", "description": "The identifier can be either the prompt name or the prompt id." } }, { "name": "version", "in": "query", "required": false, "schema": { "type": "integer", "exclusiveMinimum": 0, "title": "Version", "description": "Specific version number to retrieve. Mutually exclusive with `label`." } }, { "name": "label", "in": "query", "required": false, "schema": { "type": "string", "title": "Label", "description": "Release label name to retrieve (e.g. 'prod', 'staging'). Mutually exclusive with `version`." } }, { "name": "resolve_snippets", "in": "query", "required": false, "schema": { "type": "boolean", "default": true, "title": "Resolve Snippets", "description": "When true (default), snippets are expanded in the returned prompt_template. When false, raw @@@snippet@@@ references are preserved." } }, { "name": "include_llm_kwargs", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Include LLM Kwargs", "description": "When true, includes provider-specific llm_kwargs in the response. Requires model metadata to be set on the template." } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPromptTemplateRawResponse" } } } }, "404": { "description": "Prompt template not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "prompt-templates" ], "summary": "Get Prompt Template by ID", "operationId": "get_prompt_templates__prompt_identifier__post", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "identifier", "description": "The identifier can be either the prompt name or the prompt id." } } ], "requestBody": { "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/GetPromptTemplate" }, { "type": "null" } ], "title": "Body" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPromptTemplateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/prompt-templates/{identifier}/labels": { "get": { "tags": [ "prompt-templates", "release-labels" ], "summary": "Get Prompt Template Labels", "operationId": "get_prompt_templates_labels_prompt_identifier__post", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "identifier", "description": "The identifier can be either the prompt name or the prompt id." } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPromptTemplateLabelResponse" } } } }, "404": { "description": "Not Found" } } } }, "/prompts/{prompt_id}/label": { "post": { "tags": [ "prompts", "labels" ], "summary": "Create a new label for a prompt", "operationId": "create_prompt_label", "parameters": [ { "name": "prompt_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "prompt_id" } }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt_version_number": { "type": "integer" }, "name": { "type": "string" } }, "required": [ "prompt_version_number", "name" ] } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "id": { "type": "integer" }, "name": { "type": "string" }, "prompt_id": { "type": "integer" }, "prompt_version_id": { "type": "integer" } }, "required": [ "created_at", "id", "name", "prompt_id", "prompt_version_id" ] } } } } } } }, "/prompt-labels/{prompt_label_id}": { "patch": { "tags": [ "prompt-templates", "release-labels" ], "summary": "Move Prompt Template Labels", "operationId": "prompt_templates_labels_prompt_label_id__patch", "parameters": [ { "name": "prompt_label_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "prompt_label_id" } }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt_version_number": { "type": "integer" } }, "required": [ "prompt_version_number" ] } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "id": { "type": "integer" }, "name": { "type": "string" }, "prompt_id": { "type": "integer" }, "prompt_version_id": { "type": "integer" } }, "required": [ "created_at", "id", "name", "prompt_id", "prompt_version_id" ] } } } } } }, "delete": { "tags": [ "prompt-templates", "release-labels" ], "summary": "Delete Prompt Template Label", "operationId": "delete_prompt_templates_labels_prompt_label_id", "parameters": [ { "name": "prompt_label_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "prompt_label_id" } }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "responses": { "204": { "description": "No Content", "content": { "application/json": { "schema": { "type": "string" } } } } } } }, "/rest/prompt-templates": { "post": { "tags": [ "rest", "prompt-templates" ], "summary": "Publish Prompt Template", "operationId": "publish_prompt_template_rest_prompt_templates_post", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptTemplate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptTemplateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/rest/prompt-templates/{identifier}": { "patch": { "tags": [ "rest", "prompt-templates" ], "summary": "Patch Prompt Template Version", "description": "Partially update a prompt template by creating a new version with merged changes. This endpoint fetches a base version (latest by default), applies your patches, validates the result, and creates a new version.", "operationId": "patch_prompt_template_version", "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "Identifier", "description": "The prompt template name or ID." } }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchPromptTemplateVersion" } } } }, "responses": { "201": { "description": "New version created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptTemplateResponse" } } } }, "400": { "description": "Validation error (e.g. conflicting fields, out-of-bounds index, wrong template type)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized - missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Prompt template, version, or label not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/rest/track-metadata": { "post": { "summary": "Track Metadata", "operationId": "trackMetadata", "tags": [ "metadata" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API Key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "integer", "description": "The unique identifier for the request to which the metadata is associated." }, "metadata": { "type": "object", "additionalProperties": true, "description": "A dictionary of metadata items to associate with the request. Can include session_ids, user_ids, location, etc." } }, "required": [ "request_id", "metadata" ] } } } }, "responses": { "200": { "description": "Metadata tracked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" } } } }, "/rest/track-group": { "post": { "summary": "Track Group", "operationId": "trackGroup", "tags": [ "group" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API Key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "integer", "description": "The unique identifier for the request." }, "group_id": { "type": "integer", "description": "The unique identifier for the group to be associated with the request." } }, "required": [ "request_id", "group_id" ] } } } }, "responses": { "200": { "description": "Group tracked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" } } } }, "/rest/track-prompt": { "post": { "summary": "Track Prompt", "operationId": "trackPrompt", "tags": [ "prompt" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API Key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt_name": { "type": "string", "description": "The name of the prompt template.", "minLength": 1 }, "prompt_input_variables": { "type": "object", "description": "Input variables for the prompt template.", "additionalProperties": { "type": "string" }, "optional": true }, "request_id": { "type": "integer", "description": "The unique identifier for the request." }, "version": { "type": "integer", "description": "The version of the prompt template. Both version and label cannot be specified. Only one or none.", "optional": true }, "label": { "type": "string", "description": "The label of the prompt template version. Both version and label cannot be specified. Only one or none.", "minLength": 1, "maxLength": 512, "optional": true } }, "required": [ "prompt_name", "request_id" ] } } } }, "responses": { "200": { "description": "Prompt tracked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" } } } }, "/rest/track-score": { "post": { "summary": "Track Score", "operationId": "trackScore", "tags": [ "score" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API Key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "request_id": { "type": "integer", "description": "The `request_id` from tracking a request." }, "score": { "type": "integer", "description": "The score you would like to give to this request (0 - 100).", "minimum": 0, "maximum": 100 }, "name": { "type": "string", "description": "A name for this request score. If not provided, the score will be tracked as `default`.", "optional": true } }, "required": [ "request_id", "score" ] } } } }, "responses": { "200": { "description": "Score tracked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" } } } }, "/reports/name/{report_name}": { "delete": { "summary": "Delete Reports by Name", "operationId": "deleteReportsByName", "tags": [ "reports" ], "parameters": [ { "name": "report_name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Name of the report to archive." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key to authorize the operation." } ], "responses": { "200": { "description": "Successful Operation", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Report not found" } } } }, "/reports": { "post": { "summary": "Create Evaluation Pipeline", "description": "Creates a new evaluation pipeline (report) with optional evaluation columns and custom scoring.", "operationId": "createEvaluationPipeline", "tags": [ "reports" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "description": "The ID of the dataset group containing the dataset versions to evaluate. The dataset group must be within a workspace accessible to the authenticated user.", "minimum": 1 }, "name": { "type": "string", "description": "Optional name for the evaluation pipeline. If not provided, a unique name will be auto-generated. Must be between 1 and 255 characters if specified.", "minLength": 1, "maxLength": 255 }, "folder_id": { "type": "integer", "description": "Optional folder ID to organize the pipeline within your workspace. If not specified, the pipeline will be created at the root level.", "minimum": 1, "nullable": true }, "dataset_version_number": { "type": "integer", "description": "Optional specific dataset version number to use. If not specified, the latest non-draft version will be used. Cannot be -1 (draft version).", "nullable": true }, "columns": { "type": "array", "description": "Optional list of evaluation columns to create with the pipeline.", "items": { "type": "object", "properties": { "column_type": { "type": "string", "description": "Type of column (e.g., LLM_ASSERTION, VARIABLE, CODE_EXECUTION, PROMPT_TEMPLATE)" }, "name": { "type": "string", "description": "Display name for the column" }, "configuration": { "type": "object", "description": "Column-type-specific configuration" }, "position": { "type": "integer", "description": "Position in the pipeline (auto-assigned if not provided)" }, "is_part_of_score": { "type": "boolean", "description": "Whether this column contributes to built-in score averaging (defaults to false)" } }, "required": [ "column_type", "name", "configuration" ] } }, "score_configuration": { "type": "object", "description": "Optional custom scoring logic configuration.", "properties": { "code": { "type": "string", "description": "Python or JavaScript code for score calculation. Receives 'data' variable (list of row dictionaries) and must return {'score': number}." }, "code_language": { "type": "string", "enum": [ "PYTHON", "JAVASCRIPT" ], "description": "Language of the code (defaults to PYTHON)" } }, "required": [ "code" ] } }, "required": [ "dataset_group_id" ], "example": { "dataset_group_id": 123, "name": "QA Evaluation Pipeline", "columns": [ { "column_type": "LLM_ASSERTION", "name": "Language Check", "configuration": { "source": "response", "prompt": "Is the response written in {language}?", "variable_mappings": { "language": "target_language" } }, "is_part_of_score": true } ] } } } } }, "responses": { "201": { "description": "Evaluation pipeline created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the operation was successful", "example": true }, "report_id": { "type": "integer", "description": "The unique ID of the created evaluation pipeline. Use this ID to run evaluations.", "example": 456 }, "report_columns": { "type": "array", "description": "List of created columns (only present if columns were provided in the request)", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "report_id": { "type": "integer" }, "column_type": { "type": "string" }, "name": { "type": "string" }, "position": { "type": "integer" }, "is_part_of_score": { "type": "boolean" }, "configuration": { "type": "object" } } } } }, "required": [ "success", "report_id" ], "example": { "success": true, "report_id": 456, "report_columns": [ { "id": 789, "report_id": 456, "column_type": "LLM_ASSERTION", "name": "Language Check", "position": 2, "is_part_of_score": true, "configuration": { "source": "response", "prompt": "Is the response written in {language}?", "variable_mappings": { "language": "target_language" } } } ] } } } } }, "400": { "description": "Bad Request - Invalid parameters, draft dataset version, or no datasets in group", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Dataset must have at least one non-draft version" } } } } } }, "403": { "description": "Forbidden - Access to dataset group not allowed or missing permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Access to this dataset group is not allowed" } } } } } }, "404": { "description": "Not Found - Dataset group or version not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Dataset group not found" } } } } } }, "401": { "description": "Unauthorized - Invalid or missing authentication" } } } }, "/report-columns": { "post": { "summary": "Add Column to Evaluation Pipeline", "description": "Adds a new evaluation step (column) to an existing evaluation pipeline. Columns execute sequentially from left to right and can reference data from previous columns.\n\n**Column Types Available:**\n- **Primary**: PROMPT_TEMPLATE, ENDPOINT, MCP, HUMAN, CODE_EXECUTION, CODING_AGENT, CONVERSATION_SIMULATOR, WORKFLOW\n- **Evaluation**: LLM_ASSERTION, AI_DATA_EXTRACTION, COMPARE, CONTAINS, REGEX, REGEX_EXTRACTION, COSINE_SIMILARITY, ABSOLUTE_NUMERIC_DISTANCE\n- **Helper**: JSON_PATH, XML_PATH, PARSE_VALUE, APPLY_DIFF, VARIABLE, ASSERT_VALID, COALESCE, COMBINE_COLUMNS, COUNT, MATH_OPERATOR, MIN_MAX\n\nSee the full documentation for detailed configuration requirements for each column type.", "operationId": "addReportColumn", "tags": [ "reports" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "report_id": { "type": "integer", "description": "The ID of the evaluation pipeline to add this column to.", "minimum": 1 }, "column_type": { "type": "string", "description": "The type of evaluation or transformation this column performs. Must be one of the supported column types.", "enum": [ "ABSOLUTE_NUMERIC_DISTANCE", "AI_DATA_EXTRACTION", "ASSERT_VALID", "CONVERSATION_SIMULATOR", "COALESCE", "CODE_EXECUTION", "COMBINE_COLUMNS", "COMPARE", "CONTAINS", "COSINE_SIMILARITY", "COUNT", "ENDPOINT", "MCP", "HUMAN", "JSON_PATH", "LLM_ASSERTION", "MATH_OPERATOR", "MIN_MAX", "PARSE_VALUE", "APPLY_DIFF", "PROMPT_TEMPLATE", "REGEX", "REGEX_EXTRACTION", "VARIABLE", "XML_PATH", "WORKFLOW", "CODING_AGENT" ] }, "name": { "type": "string", "description": "Display name for this column. Must be unique within the pipeline. This name is used to reference the column in subsequent steps.", "minLength": 1, "maxLength": 255 }, "configuration": { "type": "object", "description": "Column-specific configuration. The schema varies based on column_type. See documentation for each type's requirements.", "additionalProperties": true }, "position": { "type": "integer", "description": "Optional position for the column. If not specified, the column is added at the end. Cannot overwrite dataset columns.", "minimum": 0, "nullable": true } }, "required": [ "report_id", "column_type", "name", "configuration" ], "example": { "report_id": 456, "column_type": "PROMPT_TEMPLATE", "name": "Generate Answer", "configuration": { "template": { "name": "qa_template", "version_number": null }, "prompt_template_variable_mappings": { "question": "input_question" }, "engine": { "provider": "openai", "model": "gpt-4", "parameters": { "temperature": 0.7 } } } } } } } }, "responses": { "201": { "description": "Column added successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "report_column": { "type": "object", "description": "Details of the created column including its ID and configuration" } } } } } }, "400": { "description": "Bad Request - Invalid column type, configuration validation failed, or column name already exists", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Report already has a column with that name" } } } } } }, "403": { "description": "Forbidden - Cannot overwrite dataset columns or missing permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "You can not overwrite dataset columns" } } } } } }, "404": { "description": "Not Found - Report not found or not accessible", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Report not found" } } } } } }, "401": { "description": "Unauthorized - Invalid or missing authentication" } } } }, "/reports/{report_id}/run": { "post": { "summary": "Run Full Evaluation", "operationId": "runReport", "tags": [ "reports" ], "parameters": [ { "name": "report_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "ID of the evaluation pipeline report to run." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key to authorize the operation." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the final report to be created. Must be between 1 and 255 characters in length.", "minLength": 1, "maxLength": 255 }, "dataset_id": { "type": [ "integer", "null" ], "description": "The ID of the dataset to use for the report. If not provided, uses the evaluation pipeline's default dataset." }, "refresh_dataset": { "type": [ "boolean", "null" ], "description": "Whether to refresh the dataset before running the report. Only applicable for dynamic datasets." } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Report run initiated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "report_id": { "type": "integer", "description": "The ID of the created final report." } }, "required": [ "success", "report_id" ] } } } }, "400": { "description": "Bad Request - Invalid data or report generation error", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "description": "Unauthorized - No requests found for the given criteria", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "403": { "description": "Forbidden - Can only run evaluation pipeline reports or dataset refresh not allowed", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "404": { "description": "Not Found - Report or dataset not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } } } } }, "/reports/{report_id}": { "get": { "summary": "Get Evaluation", "operationId": "getReport", "tags": [ "reports" ], "parameters": [ { "name": "report_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "ID of the report to retrieve." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key to authorize the operation." } ], "responses": { "200": { "description": "Report retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "report": { "type": "object", "description": "The report data with all fields", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "comment": { "type": [ "string", "null" ] }, "is_blueprint": { "type": [ "boolean", "null" ] }, "deleted": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "score": { "type": [ "object", "null" ], "description": "Report score data" }, "score_configuration": { "type": [ "object", "null" ], "description": "Score configuration settings" }, "score_matrix": { "type": [ "array", "null" ], "description": "Score matrix for custom scoring" }, "score_calculation_error": { "type": [ "string", "null" ], "description": "Error message if score calculation failed" }, "parent_report_id": { "type": [ "integer", "null" ] }, "dataset_id": { "type": [ "integer", "null" ] }, "user_id": { "type": [ "integer", "null" ] }, "workspace_id": { "type": "integer" }, "prompt_registry_id": { "type": [ "integer", "null" ], "description": "ID of associated prompt registry" }, "prompt_version_number": { "type": [ "integer", "null" ], "description": "Version number of associated prompt" } }, "required": [ "id", "name", "deleted", "created_at", "updated_at", "workspace_id" ] }, "status": { "type": "string", "enum": [ "RUNNING", "COMPLETED" ], "description": "Overall status of the report execution" }, "stats": { "type": "object", "properties": { "status_counts": { "type": "object", "description": "Count of cells in each status", "properties": { "COMPLETED": { "type": "integer", "description": "Number of completed cells" }, "FAILED": { "type": "integer", "description": "Number of failed cells" }, "QUEUED": { "type": "integer", "description": "Number of queued cells" }, "RUNNING": { "type": "integer", "description": "Number of running cells" } }, "required": [ "COMPLETED", "FAILED", "QUEUED", "RUNNING" ] } }, "required": [ "status_counts" ] } }, "required": [ "success", "message", "report", "status", "stats" ] } } } }, "401": { "description": "Unauthorized - Invalid or missing authentication" }, "404": { "description": "Report not found or not accessible" } } } }, "/reports/{report_id}/score": { "get": { "summary": "Get Evaluation Score", "operationId": "getReportScore", "tags": [ "reports" ], "parameters": [ { "name": "report_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "ID of the report to get the score for." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key to authorize the operation." } ], "responses": { "200": { "description": "Report score retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "score": { "type": "object", "properties": { "overall_score": { "type": [ "number", "null" ], "description": "The overall score of the report" }, "score_type": { "type": "string", "enum": [ "single_column", "multi_column", "custom", "none" ], "description": "Type of scoring used for this report" }, "has_custom_scoring": { "type": "boolean", "description": "Whether custom scoring logic was used" }, "details": { "type": "object", "oneOf": [ { "description": "Single column score details", "properties": { "column_name": { "type": "string" }, "score": { "type": [ "number", "null" ] }, "score_type": { "type": [ "string", "null" ] }, "num_skipped": { "type": "integer" } } }, { "description": "Multi-column score details", "properties": { "columns": { "type": "array", "items": { "type": "object", "properties": { "column_name": { "type": "string" }, "score": { "type": [ "number", "null" ] }, "score_type": { "type": [ "string", "null" ] }, "num_skipped": { "type": "integer" } } } } } }, { "description": "Custom score details", "properties": { "matrix": { "type": "array", "description": "Score matrix from custom scoring logic" }, "configuration": { "type": [ "object", "null" ], "description": "Custom scoring configuration" } } }, { "description": "No score details", "properties": { "message": { "type": "string" } } } ] } }, "required": [ "overall_score", "score_type", "has_custom_scoring", "details" ] } }, "required": [ "success", "message", "score" ] } } } }, "400": { "description": "Bad Request - Blueprint reports do not have scores" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden - Invalid workspace" }, "404": { "description": "Report not found" } } } }, "/api/public/v2/datasets": { "get": { "summary": "List Datasets", "operationId": "listDatasets", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." }, { "name": "dataset_group_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific dataset group ID" }, { "name": "prompt_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific prompt ID" }, { "name": "prompt_version_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific prompt version ID" }, { "name": "prompt_label_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific prompt label ID" }, { "name": "workspace_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific workspace ID. If not provided, uses the current user's workspace" }, { "name": "report_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific report ID (includes parent report ID)" }, { "name": "name", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter datasets by name (case-insensitive partial match on dataset group name)" }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "active", "deleted", "all" ], "default": "active" }, "description": "Filter datasets by status: 'active' (default) returns only active datasets, 'deleted' returns only deleted/archived datasets, 'all' returns both" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 }, "description": "Page number for pagination" }, { "name": "per_page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 10 }, "description": "Number of items per page" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "datasets": { "type": "array", "items": { "$ref": "#/components/schemas/Dataset" } }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "pages": { "type": "integer" } }, "required": [ "success", "message", "datasets", "page", "per_page", "total", "pages" ] } } } }, "400": { "description": "Invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/requests/{request_id}": { "get": { "summary": "Get Request", "operationId": "getRequest", "tags": [ "tracking" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication." }, { "name": "request_id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 }, "description": "The ID of the request to retrieve." } ], "responses": { "200": { "description": "Successfully retrieved request as a prompt blueprint.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates the request was successful." }, "prompt_blueprint": { "type": "object", "description": "The request converted to a prompt blueprint format.", "properties": { "prompt_template": { "type": "object", "description": "The prompt template with type and messages." }, "metadata": { "type": "object", "description": "Metadata including model provider, name, and parameters." }, "inference_client_name": { "type": "string", "nullable": true, "description": "The inference client name if one was used." } } }, "request_id": { "type": "integer", "description": "The ID of the request." }, "provider": { "type": "string", "description": "The LLM provider (e.g. openai, anthropic)." }, "model": { "type": "string", "description": "The model name (e.g. gpt-4, claude-3-sonnet)." }, "input_tokens": { "type": "integer", "nullable": true, "description": "Number of input tokens used." }, "output_tokens": { "type": "integer", "nullable": true, "description": "Number of output tokens generated." }, "tokens": { "type": "integer", "nullable": true, "description": "Total token count (input + output)." }, "price": { "type": "number", "nullable": true, "description": "Cost of the request in USD." }, "request_start_time": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp of when the request started." }, "request_end_time": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp of when the request ended." }, "latency_ms": { "type": "number", "nullable": true, "description": "Request latency in milliseconds, derived from start and end times." }, "trace_id": { "type": "string", "nullable": true, "description": "The trace ID associated with this request, if the request was part of a trace." } } } } } }, "401": { "description": "Authentication failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Invalid workspace.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Request not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/traces/{trace_id}": { "get": { "summary": "Get Trace", "operationId": "getTrace", "tags": [ "tracking" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication." }, { "name": "trace_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The trace ID to retrieve spans for." } ], "responses": { "200": { "description": "Successfully retrieved trace spans.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates the request was successful." }, "spans": { "type": "array", "description": "List of spans belonging to this trace.", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "The internal span ID." }, "name": { "type": "string", "description": "The name of the span." }, "trace_id": { "type": "string", "description": "The trace ID this span belongs to." }, "span_id": { "type": "string", "description": "The unique span identifier." }, "parent_id": { "type": "string", "nullable": true, "description": "The parent span ID, or null for root spans." }, "start": { "type": "string", "description": "ISO 8601 timestamp of when the span started." }, "end": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp of when the span ended." }, "attributes": { "type": "object", "nullable": true, "description": "Arbitrary key-value attributes attached to the span." }, "resource": { "type": "object", "nullable": true, "description": "Resource information for the span." }, "context": { "type": "object", "nullable": true, "description": "Span context information." }, "kind": { "type": "string", "nullable": true, "description": "The span kind (e.g. INTERNAL, CLIENT, SERVER)." }, "status": { "type": "object", "nullable": true, "description": "The span status including status code." }, "events": { "type": "array", "nullable": true, "description": "Events recorded on the span." }, "links": { "type": "array", "nullable": true, "description": "Links to other spans." }, "request_log_id": { "type": "integer", "nullable": true, "description": "The PromptLayer request log ID associated with this span, if any." } } } } } } } } }, "401": { "description": "Authentication failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Invalid workspace.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Trace not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/datasets/{dataset_id}/rows": { "get": { "summary": "Get Dataset Rows", "operationId": "getDatasetRows", "tags": [ "datasets" ], "description": "Retrieve paginated rows from a dataset. Each row is an array of cells matching the order of the `columns` array. All cells have `{\"type\": \"dataset\", \"value\": ...}`.", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "The ID of the dataset to retrieve rows from" }, { "name": "workspace_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific workspace ID. Defaults to current user's workspace." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 }, "description": "Page number for pagination" }, { "name": "per_page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 10 }, "description": "Number of rows per page (max 100)" }, { "name": "q", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Search query for filtering rows" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "columns": { "type": "array", "items": { "type": "string" }, "description": "Ordered list of column names" }, "rows": { "type": "array", "items": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": ["dataset"] }, "value": { "description": "The cell value" } }, "required": ["type", "value"] } }, "description": "Array of rows, each row is an array of cells" }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "pages": { "type": "integer" } }, "required": [ "success", "message", "columns", "rows", "page", "per_page", "total", "pages" ] } } } }, "400": { "description": "Invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/evaluations/{evaluation_id}/rows": { "get": { "summary": "Get Evaluation Rows", "operationId": "getEvaluationRows", "tags": [ "evaluations" ], "description": "Retrieve paginated evaluation results with dataset input variables and evaluation cell outcomes. Each row is an array of cells matching the order of the `columns` array. Dataset input cells have `{\"type\": \"dataset\", \"value\": ...}`. Eval result cells have `{\"type\": \"eval\", \"status\": ..., \"value\": ...}`.", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." }, { "name": "evaluation_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "The ID of the evaluation to retrieve rows from" }, { "name": "workspace_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific workspace ID. Defaults to current user's workspace." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 }, "description": "Page number for pagination" }, { "name": "per_page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 10 }, "description": "Number of rows per page (max 100)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "columns": { "type": "array", "items": { "type": "string" }, "description": "Ordered list of column names. Dataset columns appear first, followed by evaluation columns." }, "rows": { "type": "array", "items": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": ["dataset", "eval"] }, "value": { "description": "The cell value" }, "status": { "type": "string", "enum": ["PASSED", "FAILED", null], "description": "Evaluation status (only for eval cells)" }, "error_message": { "type": "string", "description": "Error details (only present for failed eval cells)" } }, "required": ["type"] } }, "description": "Array of rows, each row is an array of cells" }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "pages": { "type": "integer" } }, "required": [ "success", "message", "columns", "rows", "page", "per_page", "total", "pages" ] } } } }, "400": { "description": "Invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Evaluation not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/evaluations": { "get": { "summary": "List Evaluations", "operationId": "listEvaluations", "tags": [ "evaluations" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." }, { "name": "workspace_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter by specific workspace ID. If not provided, uses the current user's workspace" }, { "name": "name", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter evaluations by name (case-insensitive partial match)" }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "active", "deleted", "all" ], "default": "active" }, "description": "Filter evaluations by status: 'active' (default) returns only active evaluations, 'deleted' returns only deleted/archived evaluations, 'all' returns both" }, { "name": "include_runs", "in": "query", "required": false, "schema": { "type": "boolean", "default": false }, "description": "If true, include batch runs nested under each evaluation. Each run includes its full report data, status (RUNNING or COMPLETED), and cell status counts." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 }, "description": "Page number for pagination" }, { "name": "per_page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 10 }, "description": "Number of items per page" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "evaluations": { "type": "array", "items": { "$ref": "#/components/schemas/Evaluation" } }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "pages": { "type": "integer" } }, "required": [ "success", "message", "evaluations", "page", "per_page", "total", "pages" ] } } } }, "400": { "description": "Invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-groups": { "post": { "summary": "Create Dataset Group", "operationId": "createDatasetGroup", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your PromptLayer API key." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the dataset group. Must be unique within the workspace." }, "workspace_id": { "type": "integer", "minimum": 1, "description": "Optional: ID of the workspace where the dataset group will be created. If not provided, uses the workspace associated with your API key." } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Dataset group created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "dataset_group": { "$ref": "#/components/schemas/DatasetGroup" }, "dataset": { "$ref": "#/components/schemas/Dataset" } }, "required": [ "success", "message", "dataset_group", "dataset" ] } } } }, "400": { "description": "Bad Request - Invalid workspace_id or dataset with this name already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-versions/from-file": { "post": { "summary": "Create Dataset Version from File", "operationId": "createDatasetVersionFromFile", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication. This endpoint supports API key authentication only." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "minimum": 1, "description": "ID of the dataset group where the new version will be created" }, "file_name": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Name of the file being uploaded (must end with .csv or .json)" }, "file_content_base64": { "type": "string", "minLength": 1, "description": "Base64 encoded content of the file. Maximum file size: 100MB. Supported formats: CSV, JSON" } }, "required": [ "dataset_group_id", "file_name", "file_content_base64" ] } } } }, "responses": { "201": { "description": "Dataset version creation job queued", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "dataset_id": { "type": "integer", "description": "ID of the created draft dataset" } }, "required": [ "success", "message", "dataset_id" ] } } } }, "400": { "description": "Bad Request - Invalid file format, file too large, or invalid base64 encoding", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Access denied to this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset group not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to upload file or create dataset version", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-versions/from-filter-params": { "post": { "summary": "Create Dataset Version from Filter Params", "operationId": "createDatasetVersionFromFilterParams", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication. This endpoint supports API key authentication only." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "minimum": 1, "description": "ID of the dataset group where the new version will be created" }, "variables_to_parse": { "type": "array", "items": { "type": "string" }, "description": "List of variables to parse from the request logs" }, "prompt_id": { "type": "integer", "description": "Filter by specific prompt ID" }, "prompt_version_id": { "type": "integer", "description": "Filter by specific prompt version ID" }, "prompt_label_id": { "type": "integer", "description": "Filter by specific prompt label ID" }, "workspace_id": { "type": "integer", "description": "Filter by specific workspace ID" }, "start_time": { "type": "string", "format": "date-time", "description": "Filter logs after this timestamp (ISO format)" }, "end_time": { "type": "string", "format": "date-time", "description": "Filter logs before this timestamp (ISO format)" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Filter by specific tags" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Filter by metadata key-value pairs" }, "scores": { "type": "object", "additionalProperties": { "type": "object", "properties": { "min": { "type": "number" }, "max": { "type": "number" } } }, "description": "Filter by score ranges" } }, "required": [ "dataset_group_id" ] } } } }, "responses": { "201": { "description": "Dataset version creation job queued", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "dataset_id": { "type": "integer", "description": "ID of the created draft dataset" }, "dataset_group_id": { "type": "integer", "description": "ID of the dataset group" }, "version_number": { "type": "integer", "description": "Version number of the dataset (-1 for draft)" } }, "required": [ "success", "message", "dataset_id", "dataset_group_id", "version_number" ] } } } }, "403": { "description": "Access denied to this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset group not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-versions/create-draft": { "post": { "summary": "Create Draft Dataset Version", "operationId": "createDraftDatasetVersion", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication. This endpoint supports API key authentication only." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "minimum": 1, "description": "ID of the dataset group to create a draft version for" }, "source_dataset_id": { "type": "integer", "minimum": 1, "description": "Optional. ID of an existing dataset version to copy rows from. Must belong to the same dataset group." } }, "required": [ "dataset_group_id" ] } } } }, "responses": { "201": { "description": "Empty draft created", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "draft_dataset_id": { "type": "integer", "description": "ID of the created draft dataset" } }, "required": [ "success", "message", "draft_dataset_id" ] } } } }, "202": { "description": "Draft created, rows being copied from source dataset", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "draft_dataset_id": { "type": "integer", "description": "ID of the created draft dataset" } }, "required": [ "success", "message", "draft_dataset_id" ] } } } }, "403": { "description": "Access denied to this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset group or source dataset not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "A draft version already exists for this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-versions/add-request-log": { "post": { "summary": "Add Request Log to Draft Dataset", "operationId": "addRequestLogToDatasetVersion", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication. This endpoint supports API key authentication only." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "minimum": 1, "description": "ID of the dataset group containing the draft" }, "request_log_id": { "type": "integer", "minimum": 1, "description": "ID of the request log to add as a dataset row" } }, "required": [ "dataset_group_id", "request_log_id" ] } } } }, "responses": { "201": { "description": "Request log added to draft dataset", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "draft_dataset_id": { "type": "integer", "description": "ID of the draft dataset" } }, "required": [ "success", "message", "draft_dataset_id" ] } } } }, "400": { "description": "Request log and dataset must belong to the same workspace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Access denied to this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset group, draft, or request log not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/dataset-versions/save-draft": { "post": { "summary": "Save Draft Dataset Version", "operationId": "saveDraftDatasetVersion", "tags": [ "datasets" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication. This endpoint supports API key authentication only." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dataset_group_id": { "type": "integer", "minimum": 1, "description": "ID of the dataset group containing the draft to save" } }, "required": [ "dataset_group_id" ] } } } }, "responses": { "202": { "description": "Dataset save job queued", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "draft_dataset_id": { "type": "integer", "description": "ID of the draft dataset being saved" } }, "required": [ "success", "message", "draft_dataset_id" ] } } } }, "403": { "description": "Access denied to this dataset group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Dataset group not found or no draft version exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/prompt-templates": { "get": { "tags": [ "prompt-templates" ], "summary": "Get All", "operationId": "get_all_prompt_templates__get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "in": "query", "name": "page", "schema": { "type": "integer", "title": "Page" } }, { "in": "query", "name": "per_page", "schema": { "type": "integer", "title": "Per Page" } }, { "in": "query", "name": "label", "schema": { "type": "string", "title": "Label" }, "description": "Filter prompt templates by release label (e.g., 'prod', 'dev', 'staging')" }, { "in": "query", "name": "name", "schema": { "type": "string", "title": "Name" }, "description": "Filter prompt templates by name (case-insensitive partial match)" }, { "in": "query", "name": "tags", "schema": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "title": "Tags" }, "description": "Filter prompt templates by tags. Can be a single tag or a list of tags. Only templates whose tags contain all specified values are returned." }, { "in": "query", "name": "status", "schema": { "type": "string", "enum": [ "active", "deleted", "all" ], "default": "active", "title": "Status" }, "description": "Filter prompt templates by status: 'active' (default) returns only active templates, 'deleted' returns only deleted/archived templates, 'all' returns both" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPromptTemplates" } } } } } } }, "/log-request": { "post": { "tags": [ "request" ], "summary": "Log Request", "operationId": "logRequest", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "description": "API key to authorize the operation." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogRequestResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/BadRequestError" }, { "$ref": "#/components/schemas/ValidationError" } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequestError" } } } } } } }, "/workflow-version-execution-results": { "get": { "summary": "Get Workflow Version Execution Results", "operationId": "getWorkflowVersionExecutionResults", "tags": [ "workflow" ], "parameters": [ { "name": "workflow_version_execution_id", "in": "query", "required": true, "schema": { "type": "integer", "format": "int64" }, "description": "The unique identifier of the workflow version execution whose results you want to retrieve." }, { "name": "return_all_outputs", "in": "query", "required": false, "schema": { "type": "boolean", "default": false }, "description": "When set to true, the response includes all output nodes' results. If omitted or set to false, only the main output is returned." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." } ], "responses": { "200": { "description": "Successful response with execution results.", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "additionalProperties": { "type": "object", "properties": { "status": { "type": "string", "description": "The status of the node execution." }, "value": { "description": "The output value of the node." }, "error_message": { "type": "string", "nullable": true, "description": "Error message if the node failed." }, "raw_error_message": { "type": "string", "nullable": true, "description": "Raw error message if the node failed." }, "is_output_node": { "type": "boolean", "description": "Whether this node is an output node." } } } }, { "description": "The main output value of the workflow execution when return_all_outputs is false." } ] } } } }, "202": { "description": "Execution is still in progress. At least one node is in a non-final status (QUEUED or RUNNING).", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "additionalProperties": { "type": "object", "properties": { "status": { "type": "string", "description": "The status of the node execution." }, "value": { "description": "The output value of the node." }, "error_message": { "type": "string", "nullable": true, "description": "Error message if the node failed." }, "raw_error_message": { "type": "string", "nullable": true, "description": "Raw error message if the node failed." }, "is_output_node": { "type": "boolean", "description": "Whether this node is an output node." } } } }, { "description": "The main output value of the workflow execution when return_all_outputs is false." } ] } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/rest/workflows": { "post": { "summary": "Create Workflow", "operationId": "createWorkflow", "tags": [ "workflow" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflow" } } } }, "responses": { "201": { "description": "Workflow created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/rest/workflows/{workflow_id_or_name}": { "patch": { "summary": "Patch Workflow", "operationId": "patchWorkflow", "tags": [ "workflow" ], "parameters": [ { "name": "workflow_id_or_name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The ID or name of the workflow to update." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchWorkflow" } } } }, "responses": { "201": { "description": "Workflow version created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/workflows": { "get": { "summary": "List Workflows", "operationId": "listWorkflows", "tags": [ "workflow" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 }, "description": "Page number for pagination." }, { "name": "per_page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 30 }, "description": "Number of items per page." } ], "responses": { "200": { "description": "List of workflows retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique identifier for the workflow" }, "workspace_id": { "type": "integer", "description": "ID of the workspace this workflow belongs to" }, "user_id": { "type": "integer", "nullable": true, "description": "ID of the user who created this workflow" }, "name": { "type": "string", "description": "Name of the workflow" }, "is_deleted": { "type": "boolean", "description": "Whether the workflow is deleted" }, "latest_version_number": { "type": "integer", "nullable": true, "description": "The latest version number of the workflow" }, "release_labels": { "type": "array", "items": { "type": "string" }, "description": "Array of release label names associated with the workflow" } }, "required": [ "id", "workspace_id", "name", "is_deleted", "release_labels" ] } }, "page": { "type": "integer", "description": "Current page number" }, "per_page": { "type": "integer", "description": "Number of items per page" }, "total": { "type": "integer", "nullable": true, "description": "Total number of items" }, "pages": { "type": "integer", "description": "Total number of pages" }, "has_next": { "type": "boolean", "description": "Whether there is a next page" }, "has_prev": { "type": "boolean", "description": "Whether there is a previous page" }, "next_num": { "type": "integer", "nullable": true, "description": "Next page number if available" }, "prev_num": { "type": "integer", "nullable": true, "description": "Previous page number if available" } }, "required": [ "items", "page", "per_page", "pages", "has_next", "has_prev" ] } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Invalid pagination parameters" } }, "required": [ "success", "message" ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Invalid API key" } }, "required": [ "success", "message" ] } } } } } } }, "/workflows/{workflow_id_or_name}": { "get": { "summary": "Get Agent", "operationId": "getWorkflow", "tags": [ "workflow" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." }, { "name": "workflow_id_or_name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The agent ID or name." }, { "name": "version", "in": "query", "required": false, "schema": { "type": "integer", "exclusiveMinimum": 0 }, "description": "Specific version number to retrieve. Mutually exclusive with `label`." }, { "name": "label", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Release label name to retrieve (e.g. 'prod', 'staging'). Mutually exclusive with `version`." } ], "responses": { "200": { "description": "Agent retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "workflow_id": { "type": "integer", "description": "Unique identifier for the agent" }, "workflow_name": { "type": "string", "description": "Name of the agent" }, "version": { "type": "integer", "description": "Version number" }, "workflow_version_id": { "type": "integer", "description": "Unique identifier for this version" }, "commit_message": { "type": "string", "nullable": true, "description": "Commit message for this version" }, "required_input_variables": { "type": "object", "nullable": true, "description": "Input variable names mapped to their types", "additionalProperties": { "type": "string" } }, "release_labels": { "type": "array", "items": { "type": "string" }, "description": "Release labels attached to this version" }, "created_at": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp of when this version was created" }, "nodes": { "type": "array", "description": "Full node definitions including configuration and dependencies", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "UUID of the node" }, "workflow_version_id": { "type": "integer", "description": "Version ID this node belongs to" }, "name": { "type": "string", "description": "Node name (unique within a version)" }, "node_type": { "type": "string", "description": "Type of node (e.g. PROMPT_TEMPLATE, CODE_EXECUTION, VARIABLE)" }, "is_output_node": { "type": "boolean", "description": "Whether this node is an output node" }, "configuration": { "type": "object", "description": "Full node configuration (structure depends on node_type)" }, "dependencies": { "type": "array", "items": { "type": "string" }, "description": "Names of nodes this node depends on" } }, "required": ["id", "name", "node_type", "is_output_node", "configuration", "dependencies"] } }, "edges": { "type": "array", "description": "Connections between nodes with optional conditionals", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "UUID of the edge" }, "source_node_name": { "type": "string", "description": "Name of the source node" }, "target_node_name": { "type": "string", "description": "Name of the target node" }, "is_and": { "type": "boolean", "description": "Whether all conditionals must be true (AND) or any (OR)" }, "conditionals": { "type": "array", "description": "Conditional rules for this edge", "items": { "type": "object" } } }, "required": ["id", "source_node_name", "target_node_name", "is_and"] } } }, "required": ["success", "workflow_id", "workflow_name", "version", "workflow_version_id", "nodes", "edges"] } } } }, "404": { "description": "Agent or version not found" }, "422": { "description": "Validation Error (e.g. both version and label specified)" } } } }, "/workflows/{workflow_id_or_name}/labels": { "get": { "summary": "Get Agent Labels", "operationId": "getWorkflowLabels", "tags": [ "workflow", "release-labels" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." }, { "name": "workflow_id_or_name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The agent ID or name." } ], "responses": { "200": { "description": "Labels retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "release_labels": { "type": "array", "items": { "type": "object", "properties": { "release_label": { "type": "string", "description": "Label name (e.g. 'prod', 'staging')" }, "release_label_id": { "type": "integer", "description": "Unique identifier for the label" }, "workflow_version_id": { "type": "integer", "description": "Version ID this label points to" }, "workflow_version_number": { "type": "integer", "description": "Version number this label points to" } }, "required": ["release_label", "release_label_id", "workflow_version_id", "workflow_version_number"] } } }, "required": ["success", "release_labels"] } } } }, "404": { "description": "Agent not found" } } } }, "/workflows/{workflow_name}/run": { "post": { "summary": "Run Workflow", "operationId": "runWorkflow", "tags": [ "workflow" ], "parameters": [ { "name": "workflow_name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "The name of the workflow to execute." }, { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Your API key for authentication." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunWorkflow" } } } }, "responses": { "201": { "description": "Workflow execution created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunWorkflowResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/spans-bulk": { "post": { "tags": [ "spans" ], "summary": "Create Spans Bulk", "operationId": "createSpansBulk", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "description": "API key to authorize the operation." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSpansBulk" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSpansBulkResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/folders": { "post": { "tags": [ "folders" ], "summary": "Create Folder", "description": "Creates a new folder in the workspace. Folders can be nested within other folders by providing a parent_id. The folder name must be unique within its parent folder (or at the root level if no parent is specified).", "operationId": "create_folder_api_public_v2_folders_post", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFolderRequest" } } } }, "responses": { "201": { "description": "Folder created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFolderSuccessResponse" } } } }, "400": { "description": "Bad request - Invalid input or folder name already exists", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/FolderExistsError" }, { "type": "string", "example": "Invalid workspace_id" } ] } } } }, "401": { "description": "Unauthorized - Missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedError" } } } }, "404": { "description": "Parent folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ParentFolderNotFoundError" } } } } } } }, "/api/public/v2/folders/{folder_id}": { "patch": { "tags": [ "folders" ], "summary": "Update Folder", "description": "Renames an existing folder. The new name must be unique within the folder's parent (or at root level). The folder must belong to a workspace accessible by the authenticated user.", "operationId": "update_folder_api_public_v2_folders_patch", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "folder_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Folder ID", "description": "The ID of the folder to update." } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateFolderRequest" } } } }, "responses": { "200": { "description": "Folder updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFolderSuccessResponse" } } } }, "400": { "description": "Bad request - Folder with the same name already exists at this level", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderExistsError" } } } }, "401": { "description": "Unauthorized - Missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedError" } } } }, "404": { "description": "Folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderNotFoundError" } } } } } } }, "/api/public/v2/folders/entities": { "get": { "tags": [ "folders" ], "summary": "List Folder Entities", "description": "Lists entities within a folder or at the workspace root. Returns folders, prompts, snippets, workflows, datasets, evaluations, AB tests, and input variable sets. Supports filtering by entity type, searching by name, flattening the folder hierarchy, and optionally including entity metadata.", "operationId": "list_folder_entities_api_public_v2_folders_entities_get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "workspace_id", "in": "query", "required": true, "schema": { "type": "integer", "title": "Workspace ID", "description": "The ID of the workspace to list entities from." } }, { "name": "folder_id", "in": "query", "required": false, "schema": { "type": "integer", "title": "Folder ID", "description": "The ID of the folder to list entities from. If not provided, lists entities at the workspace root level." } }, { "name": "filter_type", "in": "query", "required": false, "schema": { "oneOf": [ { "type": "string", "enum": ["FOLDER", "PROMPT", "SNIPPET", "WORKFLOW", "DATASET", "REPORT", "AB_TEST", "INPUT_VARIABLE_SET"] }, { "type": "array", "items": { "type": "string", "enum": ["FOLDER", "PROMPT", "SNIPPET", "WORKFLOW", "DATASET", "REPORT", "AB_TEST", "INPUT_VARIABLE_SET"] } } ], "title": "Filter Type", "description": "Filter entities by type. Can be a single type or a list of types. If not provided, all entity types are returned." } }, { "name": "search_query", "in": "query", "required": false, "schema": { "type": "string", "title": "Search Query", "description": "Search entities by name (case-insensitive partial match)." } }, { "name": "flatten", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Flatten", "description": "When true, returns all entities recursively within the folder hierarchy instead of only direct children." } }, { "name": "include_metadata", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Include Metadata", "description": "When true, includes type-specific metadata for each entity (e.g., prompt type, latest version number)." } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListFolderEntitiesResponse" } } } }, "400": { "description": "Bad request - Missing or invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderNotFoundError" } } } } } }, "post": { "tags": [ "folders" ], "summary": "Move Folder Entities", "description": "Moves one or more entities into a target folder, or to the workspace root if no folder_id is provided. Supports moving folders, prompts, snippets, workflows, datasets, evaluations, AB tests, and input variable sets. Requires appropriate edit permissions for each entity type.", "operationId": "move_folder_entities_api_public_v2_folders_entities_post", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MoveFolderEntitiesRequest" } } } }, "responses": { "200": { "description": "Entities moved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderEntitiesCountResponse" } } } }, "400": { "description": "Bad request - Missing workspace_id or invalid entity type", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized - Missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedError" } } } }, "404": { "description": "Folder or entity not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderNotFoundError" } } } } } }, "delete": { "tags": [ "folders" ], "summary": "Delete Folder Entities", "description": "Deletes one or more entities from the workspace. Supports deleting folders, prompts, snippets, workflows, datasets, evaluations, AB tests, and input variable sets. Use cascade=true to recursively delete all contents of a folder. Without cascade, deleting a non-empty folder returns an error. Entities are soft-deleted where applicable.", "operationId": "delete_folder_entities_api_public_v2_folders_entities_delete", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteFolderEntitiesRequest" } } } }, "responses": { "200": { "description": "Entities deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderEntitiesCountResponse" } } } }, "400": { "description": "Bad request - Folder is not empty (use cascade=true) or invalid entity type", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized - Missing or invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedError" } } } }, "404": { "description": "Entity not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error during deletion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/folders/resolve-id": { "get": { "tags": [ "folders" ], "summary": "Resolve Folder ID by Path", "description": "Resolves a folder's ID from its path. The path uses dot-separated folder names representing the hierarchy (e.g., \"My Folder.Subfolder\").", "operationId": "resolve_folder_id_api_public_v2_folders_resolve_id_get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "name": "X-API-KEY", "in": "header" }, { "name": "workspace_id", "in": "query", "required": true, "schema": { "type": "integer", "title": "Workspace ID", "description": "The ID of the workspace containing the folder." } }, { "name": "path", "in": "query", "required": true, "schema": { "type": "string", "title": "Path", "description": "Dot-separated folder path to resolve (e.g., \"My Folder.Subfolder\")." } } ], "responses": { "200": { "description": "Folder ID resolved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolveFolderIdResponse" } } } }, "400": { "description": "Bad request - Missing or invalid workspace_id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Folder path not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/prompt-templates/{identifier}/snippet-usage": { "get": { "tags": [ "prompt-templates", "snippets" ], "summary": "Get Snippet Usage", "description": "Get all prompts that use a given snippet (prompt template). Returns a list of prompts and their version numbers that reference this snippet.", "operationId": "get_snippet_usage", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" } }, { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "identifier", "description": "The identifier can be either the prompt name or the prompt id." } }, { "name": "prompt_version_number", "in": "query", "required": false, "schema": { "type": "integer", "title": "prompt_version_number", "description": "Optional specific version number to check usage for" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetSnippetUsageResponse" } } } }, "403": { "description": "Access denied - Invalid workspace_id" }, "404": { "description": "Prompt template not found" } } } }, "/v1/traces": { "post": { "tags": [ "otlp" ], "summary": "Ingest Traces (OTLP)", "description": "Ingest OpenTelemetry traces using the standard OTLP/HTTP protocol.\n\nThis endpoint accepts an `ExportTraceServiceRequest` as defined by the [OpenTelemetry specification](https://opentelemetry.io/docs/specs/otel/protocol/otlp/#otlphttp). Spans carrying [GenAI semantic convention](https://opentelemetry.io/docs/specs/semconv/gen-ai/) attributes are automatically converted into PromptLayer request logs.\n\nSupported content types:\n- `application/x-protobuf` — binary protobuf encoding (recommended)\n- `application/json` — JSON encoding\n\nGzip `Content-Encoding` is supported for both formats.\n\nSpans can include `promptlayer.prompt.name` (or `promptlayer.prompt.id`) and `promptlayer.prompt.version` (or `promptlayer.prompt.label`) attributes to link the generated request log to an existing prompt template in your workspace.", "operationId": "ingestOtlpTraces", "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string", "title": "X-Api-Key" }, "description": "API key to authorize the operation." }, { "name": "Content-Type", "in": "header", "required": true, "schema": { "type": "string", "enum": [ "application/x-protobuf", "application/json" ] }, "description": "The encoding of the request body. Use `application/x-protobuf` for binary protobuf or `application/json` for JSON." }, { "name": "Content-Encoding", "in": "header", "required": false, "schema": { "type": "string", "enum": [ "gzip" ] }, "description": "Set to `gzip` if the request body is gzip-compressed." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OtlpExportTraceServiceRequest" } }, "application/x-protobuf": { "schema": { "type": "string", "format": "binary", "description": "Binary-encoded ExportTraceServiceRequest protobuf message." } } } }, "responses": { "200": { "description": "Successful Response. When using protobuf, the response is a binary `ExportTraceServiceResponse`. When using JSON, the response is a JSON object.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OtlpExportTraceServiceResponse" } }, "application/x-protobuf": { "schema": { "type": "string", "format": "binary", "description": "Binary-encoded ExportTraceServiceResponse protobuf message." } } } }, "415": { "description": "Unsupported Content-Type", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error during ingestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/public/v2/requests/search": { "post": { "summary": "Search Request Logs", "operationId": "searchRequestLogs", "tags": [ "tracking" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchRequestLogsRequest" } } } }, "responses": { "200": { "description": "Paginated list of matching request logs.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchRequestLogsResponse" } } } }, "400": { "description": "Invalid filter or search parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Authentication failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Invalid workspace.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Rate limit exceeded (10 requests per minute)." } } } }, "/api/public/v2/requests/suggestions": { "get": { "summary": "Search Request Suggestions", "operationId": "getRequestSearchSuggestions", "tags": [ "tracking" ], "parameters": [ { "name": "X-API-KEY", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication." }, { "name": "field", "in": "query", "required": true, "schema": { "type": "string", "enum": [ "engine", "provider_type", "prompt_id", "prompt", "tags", "metadata_keys", "status", "tool_names", "output_keys", "input_variable_keys", "metadata_values", "output_values", "input_variable_values" ] }, "description": "The request log field to get suggestions for." }, { "name": "prefix", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Case-insensitive prefix to filter suggestions." }, { "name": "metadata_key", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Required when field is metadata_values, output_values, or input_variable_values. Specifies which key to get values for." }, { "name": "prompt_id", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1 }, "description": "Filter suggestions to a specific prompt template (only used when field is prompt)." }, { "name": "filter_group", "in": "query", "required": false, "schema": { "type": "string" }, "description": "JSON-encoded filter group to scope suggestions to matching requests." } ], "responses": { "200": { "description": "List of suggestion values.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "values": { "type": "array", "items": {}, "description": "List of suggestion values matching the query." } } } } } }, "401": { "description": "Authentication failed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "403": { "description": "Invalid workspace.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Rate limit exceeded (10 requests per minute)." } } } } }, "components": { "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-KEY" } }, "schemas": { "Evaluation": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique identifier for the evaluation" }, "name": { "type": "string", "description": "Name of the evaluation" }, "comment": { "type": "string", "nullable": true, "description": "Optional comment or description for the evaluation" }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp when the evaluation was created" }, "updated_at": { "type": "string", "format": "date-time", "description": "Timestamp when the evaluation was last updated" }, "workspace_id": { "type": "integer", "description": "ID of the workspace this evaluation belongs to" }, "folder_id": { "type": "integer", "nullable": true, "description": "ID of the folder containing this evaluation" }, "user_id": { "type": "integer", "nullable": true, "description": "ID of the user who created this evaluation" }, "dataset_id": { "type": "integer", "nullable": true, "description": "ID of the dataset associated with this evaluation" }, "is_blueprint": { "type": "boolean", "description": "Whether this is a blueprint (pipeline definition) or a batch run" }, "tags": { "type": "object", "nullable": true, "description": "Tags associated with this evaluation" }, "deleted": { "type": "boolean", "description": "Whether this evaluation has been deleted" }, "parent_report_id": { "type": "integer", "nullable": true, "description": "ID of the parent blueprint (set for batch runs)" }, "score_configuration": { "type": "object", "nullable": true, "description": "Custom scoring configuration for this evaluation" }, "runs": { "type": "array", "description": "Batch runs for this evaluation. Only present when include_runs=true.", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique identifier for the run" }, "name": { "type": "string", "description": "Name of the run" }, "comment": { "type": "string", "nullable": true, "description": "Optional comment or description" }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp when the run was created" }, "updated_at": { "type": "string", "format": "date-time", "description": "Timestamp when the run was last updated" }, "workspace_id": { "type": "integer", "description": "ID of the workspace" }, "folder_id": { "type": "integer", "nullable": true, "description": "ID of the folder" }, "user_id": { "type": "integer", "nullable": true, "description": "ID of the user who created this run" }, "dataset_id": { "type": "integer", "nullable": true, "description": "ID of the dataset" }, "is_blueprint": { "type": "boolean", "description": "Whether this is a blueprint" }, "tags": { "type": "object", "nullable": true, "description": "Tags associated with this run" }, "deleted": { "type": "boolean", "description": "Whether this run has been deleted" }, "parent_report_id": { "type": "integer", "nullable": true, "description": "ID of the parent blueprint" }, "score_configuration": { "type": "object", "nullable": true, "description": "Custom scoring configuration" }, "score": { "type": "object", "nullable": true, "description": "Computed score for this run" }, "score_matrix": { "type": "array", "nullable": true, "description": "Matrix of scores across evaluation columns" }, "score_calculation_error": { "type": "string", "nullable": true, "description": "Error message if score calculation failed" }, "status": { "type": "string", "enum": [ "RUNNING", "COMPLETED" ], "description": "Current status of the batch run" }, "stats": { "type": "object", "description": "Run statistics", "properties": { "status_counts": { "type": "object", "description": "Count of cells by status" } } } } } } }, "required": [ "id", "name", "workspace_id" ] }, "GetSnippetUsageResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "snippet_name": { "type": "string", "description": "The name of the snippet prompt template" }, "snippet_usage": { "type": "array", "items": { "type": "object", "properties": { "prompt_registry_id": { "type": "integer", "description": "The ID of the prompt that uses this snippet" }, "prompt_name": { "type": "string", "description": "The name of the prompt that uses this snippet" }, "version_numbers": { "type": "array", "items": { "type": "integer" }, "description": "List of version numbers that use this snippet" } } }, "description": "List of prompts using this snippet" }, "total_prompts_using_snippet": { "type": "integer", "description": "Total number of prompts using this snippet" }, "label_usage": { "type": "array", "items": { "type": "object", "properties": { "prompt_registry_id": { "type": "integer", "description": "The ID of the prompt with a label using this snippet" }, "prompt_name": { "type": "string", "description": "The name of the prompt with a label using this snippet" }, "label_name": { "type": "string", "description": "The name of the label using this snippet" } } }, "description": "List of labels using this snippet" }, "total_labels_using_snippet": { "type": "integer", "description": "Total number of labels using this snippet" } }, "title": "GetSnippetUsageResponse" }, "RunWorkflow": { "type": "object", "properties": { "workflow_label_name": { "type": "string", "nullable": true, "description": "Specify a workflow label name to run a specific labeled version." }, "workflow_version_number": { "type": "integer", "nullable": true, "description": "Specify a workflow version number to run a specific version." }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "nullable": true, "description": "A dictionary of metadata key-value pairs." }, "input_variables": { "type": "object", "additionalProperties": true, "default": {}, "description": "A dictionary of input variables required by the workflow." }, "return_all_outputs": { "type": "boolean", "default": false, "description": "If set to `true`, all outputs from the workflow execution will be returned." } }, "required": [], "description": "Parameters to run a workflow." }, "RunWorkflowResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the request was successful." }, "message": { "type": "string", "description": "A message describing the result." }, "warning": { "type": "string", "nullable": true, "description": "Any warnings about missing input variables." }, "workflow_version_execution_id": { "type": "integer", "description": "The ID of the created workflow execution." } }, "required": [ "success", "message", "workflow_version_execution_id" ], "description": "Response after initiating a workflow execution." }, "WorkflowNode": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Unique name for the node within this workflow." }, "node_type": { "type": "string", "description": "The type of node. Common types include VARIABLE, CODE_EXECUTION, PROMPT_TEMPLATE, ENDPOINT, COMPARE, CONTAINS, LLM_ASSERTION, AI_DATA_EXTRACTION, CODING_AGENT. See Node & Column Types documentation for the complete list." }, "configuration": { "type": "object", "description": "Node-specific configuration." }, "dependencies": { "type": "array", "items": { "type": "string" }, "description": "Names of nodes or input variables this node depends on." }, "is_output_node": { "type": "boolean", "description": "Whether this node is an output node." } }, "required": [ "name", "node_type", "configuration", "is_output_node" ] }, "EdgeConditional": { "type": "object", "properties": { "position": { "type": "integer", "minimum": 0, "description": "Order of evaluation." }, "operator": { "type": "string", "enum": [ "=", "!=", "<", ">", "<=", ">=", "in", "not_in", "is_null", "is_not_null" ], "description": "Comparison operator." }, "left_config": { "type": "object", "description": "Left side of comparison. Can be static_value or source." }, "right_config": { "type": "object", "description": "Right side of comparison. Can be static_value or source." } }, "required": [ "position", "operator", "left_config", "right_config" ] }, "Edge": { "type": "object", "properties": { "source_node_name": { "type": "string", "description": "The source node name." }, "target_node_name": { "type": "string", "description": "The target node name." }, "is_and": { "type": "boolean", "description": "Whether multiple conditionals use AND logic (true) or OR logic (false)." }, "conditionals": { "type": "array", "items": { "$ref": "#/components/schemas/EdgeConditional" }, "minItems": 1, "description": "At least one conditional." } }, "required": [ "source_node_name", "target_node_name", "is_and", "conditionals" ] }, "CreateWorkflow": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "nullable": true, "description": "The name for a new workflow. If not provided, a name will be auto-generated." }, "workflow_id": { "type": "integer", "nullable": true, "description": "The ID of an existing workflow to create a new version for." }, "workflow_name": { "type": "string", "nullable": true, "description": "The name of an existing workflow to create a new version for." }, "folder_id": { "type": "integer", "nullable": true, "description": "The folder ID to place the workflow in." }, "commit_message": { "type": "string", "nullable": true, "description": "A message describing the changes in this version." }, "nodes": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowNode" }, "description": "The nodes in the workflow." }, "required_input_variables": { "type": "object", "additionalProperties": { "type": "string" }, "description": "A mapping of variable names to their types." }, "edges": { "type": "array", "items": { "$ref": "#/components/schemas/Edge" }, "nullable": true, "description": "Conditional edges between nodes." }, "release_labels": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Labels to attach to this version." } }, "required": [ "nodes" ], "description": "Request body for creating a new workflow or workflow version." }, "NodeUpdate": { "type": "object", "properties": { "node_type": { "type": "string", "nullable": true, "description": "The node type (required for new nodes)." }, "configuration": { "type": "object", "nullable": true, "description": "Node configuration to merge." }, "dependencies": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Dependencies to replace." }, "is_output_node": { "type": "boolean", "nullable": true, "description": "Whether this is an output node." } }, "description": "Partial update for a single node." }, "PatchWorkflow": { "type": "object", "properties": { "base_version": { "type": "integer", "nullable": true, "description": "The version number to base changes on. Defaults to the latest version." }, "commit_message": { "type": "string", "nullable": true, "description": "A message describing the changes." }, "nodes": { "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "#/components/schemas/NodeUpdate" }, { "type": "null" } ] }, "nullable": true, "description": "Node updates keyed by node name. Use null to remove a node." }, "required_input_variables": { "type": "object", "additionalProperties": { "type": "string" }, "nullable": true, "description": "If provided, replaces the input variables entirely." }, "edges": { "type": "array", "items": { "$ref": "#/components/schemas/Edge" }, "nullable": true, "description": "If provided, replaces edges entirely." }, "release_labels": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Labels to attach to the new version." } }, "description": "Request body for partially updating a workflow." }, "CreateWorkflowResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the request was successful." }, "workflow_id": { "type": "integer", "description": "The ID of the workflow." }, "workflow_name": { "type": "string", "description": "The name of the workflow." }, "workflow_version_id": { "type": "integer", "description": "The ID of the created workflow version." }, "version_number": { "type": "integer", "description": "The version number." }, "base_version": { "type": "integer", "nullable": true, "description": "The base version this was created from (PATCH only)." }, "release_labels": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Labels attached to this version." }, "nodes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "node_type": { "type": "string" }, "is_output_node": { "type": "boolean" } } }, "description": "Summary of nodes in the workflow." }, "required_input_variables": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Required input variables for the workflow." } }, "required": [ "success", "workflow_id", "workflow_name", "workflow_version_id", "version_number" ], "description": "Response after creating or patching a workflow." }, "ErrorResponse": { "type": "object", "properties": { "success": { "type": "boolean", "default": false, "description": "Indicates that the request failed." }, "error": { "type": "string", "description": "Error message explaining why the request failed." } }, "required": [ "success", "error" ], "description": "Error response format." }, "Base": { "properties": { "page": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Page", "default": 1 }, "per_page": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Per Page", "default": 30 } }, "type": "object", "title": "Base" }, "Function": { "properties": { "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description", "default": "" }, "strict": { "type": "boolean", "title": "Strict", "default": false, "description": "Whether to enable strict schema validation for the function parameters." }, "parameters": { "type": "object", "title": "Parameters", "default": { "type": "object", "properties": {} } } }, "type": "object", "required": [ "name" ], "title": "Function" }, "FunctionCall": { "properties": { "name": { "type": "string", "title": "Name" }, "arguments": { "type": "string", "title": "Arguments" } }, "type": "object", "required": [ "name", "arguments" ], "title": "FunctionCall" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "Model": { "title": "Model", "type": "object", "properties": { "provider": { "title": "Provider", "type": "string", "description": "The LLM provider (e.g. openai, anthropic, google, openai.azure, vertexai, mistral, cohere, amazon.bedrock, huggingface)." }, "model_config_display_name": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "default": null, "title": "Model Config Display Name", "description": "Optional display name for the model configuration." }, "base_model": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ], "default": null, "title": "Base Model", "description": "The base model name (e.g. for fine-tuned models)." }, "name": { "title": "Name", "type": "string", "description": "The model name (e.g. gpt-4o, claude-sonnet-4-20250514)." }, "parameters": { "title": "Parameters", "default": {}, "type": "object", "description": "Model parameters (e.g. temperature, max_tokens, top_p)." }, "display_params": { "title": "Display Params", "default": {}, "type": "object", "description": "Display-friendly parameter values shown in the UI." }, "api_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Api Type", "description": "The API type (e.g. chat.completions, responses, images). Used to select the correct API endpoint for the provider." } }, "required": [ "provider", "name" ] }, "Metadata": { "title": "Metadata", "type": "object", "additionalProperties": true, "properties": { "model": { "anyOf": [ { "$ref": "#/components/schemas/Model" }, { "type": "null" } ], "default": null, "title": "Model" } }, "description": "Metadata associated with the prompt blueprint. Supports additional custom fields beyond the model field." }, "GetPromptTemplate": { "properties": { "version": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Version" }, "workspace_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Workspace Id" }, "label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label" }, "provider": { "anyOf": [ { "type": "string", "enum": [ "openai", "anthropic" ] }, { "type": "null" } ], "title": "Provider" }, "input_variables": { "anyOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "type": "null" } ], "title": "Input Variables" }, "metadata_filters": { "anyOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "type": "null" } ], "title": "Metadata Filters", "description": "Optional dictionary of key values used for A/B release labels." }, "model": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Modal", "description": "Optional model name used for returning default parameters with llm_kwargs." }, "model_parameter_overrides": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Model Parameter Overrides", "description": "Optional dictionary of model parameter overrides to use with the prompt template. This will override the parameters at runtime for the specified model and will try to make sure the model supports these parameters. For example, if you supply `maxOutputTokens` for OpenAI, it will be converted to `max_completion_tokens`." } }, "type": "object", "title": "GetPromptTemplate" }, "CompletionPrompt": { "additionalProperties": true, "properties": { "content": { "items": { "discriminator": { "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" }, "propertyName": "type" }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "title": "Content", "type": "array" }, "input_variables": { "default": [], "items": { "type": "string" }, "title": "Input Variables", "type": "array" }, "template_format": { "default": "f-string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "type": "string" }, "type": { "const": "completion", "default": "completion", "enum": [ "completion" ], "title": "Type", "type": "string" } }, "required": [ "content" ], "title": "Completion Template", "type": "object" }, "FileAnnotation": { "properties": { "type": { "const": "file_citation", "title": "Type", "type": "string" }, "index": { "type": "integer", "title": "Index" }, "file_id": { "type": "string", "title": "File Id" }, "filename": { "type": "string", "title": "Filename" } }, "type": "object", "required": [ "type", "index", "file_id", "filename" ], "title": "FileAnnotation" }, "WebAnnotation": { "properties": { "type": { "const": "url_citation", "title": "Type", "type": "string" }, "title": { "type": "string", "title": "Title" }, "url": { "type": "string", "title": "Url" }, "start_index": { "type": "integer", "title": "Start Index" }, "end_index": { "type": "integer", "title": "End Index" }, "cited_text": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cited Text" }, "encrypted_index": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Encrypted Index" } }, "type": "object", "required": [ "type", "title", "url", "start_index", "end_index" ], "title": "WebAnnotation" }, "MapAnnotation": { "properties": { "type": { "const": "map_citation", "title": "Type", "type": "string" }, "title": { "type": "string", "title": "Title" }, "url": { "type": "string", "title": "Url" }, "place_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Place Id" }, "start_index": { "type": "integer", "title": "Start Index" }, "end_index": { "type": "integer", "title": "End Index" }, "cited_text": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cited Text" } }, "type": "object", "required": [ "type", "title", "url", "start_index", "end_index" ], "title": "MapAnnotation" }, "ContainerFileAnnotation": { "properties": { "type": { "const": "container_file_citation", "title": "Type", "type": "string" }, "container_id": { "type": "string", "title": "Container Id" }, "start_index": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Start Index" }, "end_index": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "End Index" }, "filename": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Filename" }, "file_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "File Id" } }, "type": "object", "required": [ "type", "container_id" ], "title": "ContainerFileAnnotation" }, "TextContent": { "properties": { "type": { "const": "text", "default": "text", "enum": [ "text" ], "title": "Type", "type": "string" }, "text": { "title": "Text", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "annotations": { "anyOf": [ { "items": { "oneOf": [ { "$ref": "#/components/schemas/WebAnnotation" }, { "$ref": "#/components/schemas/FileAnnotation" }, { "$ref": "#/components/schemas/MapAnnotation" }, { "$ref": "#/components/schemas/ContainerFileAnnotation" } ] }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Annotations", "description": "Citations and references within the text (web citations, file citations, map citations, container file citations)." }, "thought_signature": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Thought Signature" } }, "required": [ "text" ], "title": "TextContent", "type": "object" }, "ThinkingContent": { "properties": { "signature": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Signature" }, "type": { "const": "thinking", "default": "thinking", "enum": [ "thinking" ], "title": "Type", "type": "string" }, "thinking": { "title": "Thinking", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "required": [ "thinking" ], "title": "ThinkingContent", "type": "object" }, "ImageURL": { "properties": { "url": { "type": "string", "title": "Url" }, "detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Detail" } }, "type": "object", "required": [ "url" ], "title": "ImageURL" }, "Media": { "properties": { "title": { "type": "string", "title": "Title", "default": "media", "description": "Title of the media" }, "type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Type", "default": "image/jpeg", "description": "MIME type of the media. For example, image/png, image/jpeg" }, "url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Url" }, "format": { "type": "string", "enum": [ "base64", "url", "neither" ], "title": "Format", "default": "neither", "description": "Format of the media data." } }, "type": "object", "title": "Media" }, "ImageContent": { "properties": { "type": { "const": "image_url", "default": "image_url", "enum": [ "image_url" ], "title": "Type", "type": "string" }, "image_url": { "$ref": "#/components/schemas/ImageURL" }, "image_variable": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Image Variable" } }, "required": [ "image_url" ], "title": "ImageContent", "type": "object" }, "MediaContent": { "properties": { "type": { "const": "media", "default": "media", "enum": [ "media" ], "title": "Type", "type": "string" }, "media": { "$ref": "#/components/schemas/Media" } }, "required": [ "media" ], "title": "MediaContent", "type": "object" }, "MediaVariable": { "properties": { "type": { "const": "media_variable", "default": "media_variable", "enum": [ "media_variable" ], "title": "Type", "type": "string" }, "name": { "type": "string", "title": "Name", "description": "Name of the media variable" } }, "required": [ "name" ], "title": "MediaVariable", "type": "object" }, "OutputMediaContent": { "description": "LLM-generated media output (e.g. from image generation tools).", "properties": { "type": { "const": "output_media", "default": "output_media", "enum": ["output_media"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "url": { "type": "string", "title": "Url" }, "mime_type": { "type": "string", "default": "image/png", "title": "Mime Type" }, "media_type": { "enum": ["image", "video", "audio"], "default": "image", "title": "Media Type", "type": "string" }, "provider_metadata": { "anyOf": [{"type": "object"}, {"type": "null"}], "default": null, "title": "Provider Metadata" } }, "required": ["url"], "title": "OutputMediaContent", "type": "object" }, "CodeContent": { "description": "Code content block (e.g. from code execution tools).", "properties": { "type": { "const": "code", "default": "code", "enum": ["code"], "title": "Type", "type": "string" }, "code": { "type": "string", "title": "Code" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "container_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Container Id" } }, "required": ["code"], "title": "CodeContent", "type": "object" }, "ServerToolUseContent": { "description": "Server-side tool use block (e.g. web search, code execution).", "properties": { "type": { "const": "server_tool_use", "default": "server_tool_use", "enum": ["server_tool_use"], "title": "Type", "type": "string" }, "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "input": { "type": "object", "default": {}, "title": "Input" } }, "required": ["id", "name"], "title": "ServerToolUseContent", "type": "object" }, "WebSearchResult": { "properties": { "type": { "const": "web_search_result", "default": "web_search_result", "enum": ["web_search_result"], "title": "Type", "type": "string" }, "url": { "type": "string", "default": "", "title": "Url" }, "title": { "type": "string", "default": "", "title": "Title" }, "encrypted_content": { "type": "string", "default": "", "title": "Encrypted Content" }, "page_age": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Page Age" } }, "title": "WebSearchResult", "type": "object" }, "WebSearchToolResultContent": { "description": "Results from a web search tool invocation.", "properties": { "type": { "const": "web_search_tool_result", "default": "web_search_tool_result", "enum": ["web_search_tool_result"], "title": "Type", "type": "string" }, "tool_use_id": { "type": "string", "title": "Tool Use Id" }, "content": { "items": { "$ref": "#/components/schemas/WebSearchResult" }, "type": "array", "default": [], "title": "Content" } }, "required": ["tool_use_id"], "title": "WebSearchToolResultContent", "type": "object" }, "CodeExecutionResultContent": { "description": "Result from a code execution tool.", "properties": { "type": { "const": "code_execution_result", "default": "code_execution_result", "enum": ["code_execution_result"], "title": "Type", "type": "string" }, "output": { "type": "string", "title": "Output" }, "outcome": { "type": "string", "default": "OUTCOME_OK", "title": "Outcome" } }, "required": ["output"], "title": "CodeExecutionResultContent", "type": "object" }, "McpListToolsContent": { "description": "MCP list tools response block.", "properties": { "type": { "const": "mcp_list_tools", "default": "mcp_list_tools", "enum": ["mcp_list_tools"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "server_label": { "type": "string", "default": "", "title": "Server Label" }, "tools": { "items": {"type": "object"}, "type": "array", "default": [], "title": "Tools" }, "error": { "anyOf": [{"type": "string"}, {"type": "object"}, {"type": "null"}], "default": null, "title": "Error" } }, "title": "McpListToolsContent", "type": "object" }, "McpCallContent": { "description": "MCP tool call block.", "properties": { "type": { "const": "mcp_call", "default": "mcp_call", "enum": ["mcp_call"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "name": { "type": "string", "default": "", "title": "Name" }, "server_label": { "type": "string", "default": "", "title": "Server Label" }, "arguments": { "type": "string", "default": "", "title": "Arguments" }, "output": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Output" }, "error": { "anyOf": [{"type": "string"}, {"type": "object"}, {"type": "null"}], "default": null, "title": "Error" }, "approval_request_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Approval Request Id" } }, "title": "McpCallContent", "type": "object" }, "McpApprovalRequestContent": { "description": "MCP tool approval request block.", "properties": { "type": { "const": "mcp_approval_request", "default": "mcp_approval_request", "enum": ["mcp_approval_request"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "name": { "type": "string", "default": "", "title": "Name" }, "arguments": { "type": "string", "default": "", "title": "Arguments" }, "server_label": { "type": "string", "default": "", "title": "Server Label" } }, "title": "McpApprovalRequestContent", "type": "object" }, "McpApprovalResponseContent": { "description": "MCP tool approval response block.", "properties": { "type": { "const": "mcp_approval_response", "default": "mcp_approval_response", "enum": ["mcp_approval_response"], "title": "Type", "type": "string" }, "approval_request_id": { "type": "string", "title": "Approval Request Id" }, "approve": { "type": "boolean", "title": "Approve" } }, "required": ["approval_request_id", "approve"], "title": "McpApprovalResponseContent", "type": "object" }, "BashCodeExecutionToolResultContent": { "description": "Result from bash code execution tool.", "properties": { "type": { "const": "bash_code_execution_tool_result", "default": "bash_code_execution_tool_result", "enum": ["bash_code_execution_tool_result"], "title": "Type", "type": "string" }, "tool_use_id": { "type": "string", "title": "Tool Use Id" }, "content": { "type": "object", "default": {}, "title": "Content" } }, "required": ["tool_use_id"], "title": "BashCodeExecutionToolResultContent", "type": "object" }, "TextEditorCodeExecutionToolResultContent": { "description": "Result from text editor code execution tool.", "properties": { "type": { "const": "text_editor_code_execution_tool_result", "default": "text_editor_code_execution_tool_result", "enum": ["text_editor_code_execution_tool_result"], "title": "Type", "type": "string" }, "tool_use_id": { "type": "string", "title": "Tool Use Id" }, "content": { "type": "object", "default": {}, "title": "Content" } }, "required": ["tool_use_id"], "title": "TextEditorCodeExecutionToolResultContent", "type": "object" }, "ShellCallContent": { "description": "Shell tool call block.", "properties": { "type": { "const": "shell_call", "default": "shell_call", "enum": ["shell_call"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "call_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Call Id" }, "action": { "type": "object", "default": {}, "title": "Action" }, "status": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Status" } }, "title": "ShellCallContent", "type": "object" }, "ShellCallOutputContent": { "description": "Shell tool output block.", "properties": { "type": { "const": "shell_call_output", "default": "shell_call_output", "enum": ["shell_call_output"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "call_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Call Id" }, "output": { "items": {"type": "object"}, "type": "array", "default": [], "title": "Output" }, "status": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Status" } }, "title": "ShellCallOutputContent", "type": "object" }, "ApplyPatchCallContent": { "description": "Apply patch tool call block.", "properties": { "type": { "const": "apply_patch_call", "default": "apply_patch_call", "enum": ["apply_patch_call"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "call_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Call Id" }, "operation": { "type": "object", "default": {}, "title": "Operation" }, "status": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Status" } }, "title": "ApplyPatchCallContent", "type": "object" }, "ApplyPatchCallOutputContent": { "description": "Apply patch tool output block.", "properties": { "type": { "const": "apply_patch_call_output", "default": "apply_patch_call_output", "enum": ["apply_patch_call_output"], "title": "Type", "type": "string" }, "id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Id" }, "call_id": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Call Id" }, "output": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Output" }, "status": { "anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "title": "Status" } }, "title": "ApplyPatchCallOutputContent", "type": "object" }, "BuiltInTool": { "description": "A provider-native built-in tool (e.g. web search, code interpreter, bash).", "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description" }, "provider": { "type": "string", "title": "Provider" }, "type": { "enum": [ "web_search", "file_search", "code_interpreter", "image_generation", "google_maps", "url_context", "mcp", "bash", "shell", "apply_patch", "text_editor" ], "title": "Type", "type": "string" }, "config": { "type": "object", "title": "Config", "description": "Provider-specific tool configuration. Structure varies by provider and tool type." } }, "required": ["id", "name", "description", "provider", "type", "config"], "title": "BuiltInTool", "type": "object" }, "SystemMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array", "title": "Content" }, "role": { "const": "system", "title": "Role", "default": "system" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" } }, "type": "object", "required": [ "content" ], "title": "SystemMessage" }, "UserMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array", "title": "Content" }, "role": { "const": "user", "title": "Role", "default": "user" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" } }, "type": "object", "required": [ "content" ], "title": "UserMessage" }, "AssistantMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "anyOf": [ { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array" }, { "type": "null" } ], "title": "Content" }, "role": { "const": "assistant", "title": "Role", "default": "assistant" }, "function_call": { "anyOf": [ { "$ref": "#/components/schemas/FunctionCall" }, { "type": "null" } ], "title": "Function Call", "deprecated": true, "description": "This field is deprecated. Please use `tool_calls` field to specify tool calls." }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "tool_calls": { "anyOf": [ { "items": { "$ref": "#/components/schemas/ToolCall" }, "type": "array" }, { "type": "null" } ], "title": "Tool Calls" } }, "type": "object", "title": "AssistantMessage" }, "FunctionMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "anyOf": [ { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array" }, { "type": "null" } ], "title": "Content" }, "role": { "const": "function", "title": "Role", "default": "function" }, "name": { "type": "string", "title": "Name" } }, "type": "object", "required": [ "name" ], "title": "FunctionMessage" }, "DeveloperMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array", "title": "Content" }, "role": { "const": "developer", "title": "Role", "default": "developer" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" } }, "type": "object", "required": [ "content" ], "title": "DeveloperMessage" }, "MessageFunctionCall": { "properties": { "name": { "type": "string", "title": "Name" } }, "type": "object", "required": [ "name" ], "title": "MessageFunctionCall" }, "ChatPrompt": { "properties": { "messages": { "items": { "discriminator": { "mapping": { "assistant": "#/components/schemas/AssistantMessage", "function": "#/components/schemas/FunctionMessage", "placeholder": "#/components/schemas/PlaceholderMessage", "system": "#/components/schemas/SystemMessage", "tool": "#/components/schemas/ToolMessage", "user": "#/components/schemas/UserMessage", "developer": "#/components/schemas/DeveloperMessage" }, "propertyName": "role" }, "oneOf": [ { "$ref": "#/components/schemas/SystemMessage" }, { "$ref": "#/components/schemas/UserMessage" }, { "$ref": "#/components/schemas/AssistantMessage" }, { "$ref": "#/components/schemas/FunctionMessage" }, { "$ref": "#/components/schemas/ToolMessage" }, { "$ref": "#/components/schemas/PlaceholderMessage" }, { "$ref": "#/components/schemas/DeveloperMessage" } ] }, "title": "Messages", "type": "array" }, "functions": { "anyOf": [ { "items": { "$ref": "#/components/schemas/Function" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Functions" }, "tools": { "anyOf": [ { "items": { "$ref": "#/components/schemas/Tool" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tools" }, "function_call": { "anyOf": [ { "type": "string" }, { "$ref": "#/components/schemas/MessageFunctionCall" }, { "type": "null" } ], "default": null, "title": "Function Call" }, "tool_choice": { "anyOf": [ { "type": "string" }, { "$ref": "#/components/schemas/ChatToolChoice" }, { "type": "null" } ], "default": null, "title": "Tool Choice" }, "type": { "const": "chat", "default": "chat", "enum": [ "chat" ], "title": "Type", "type": "string" }, "input_variables": { "default": [], "items": { "type": "string" }, "title": "Input Variables", "type": "array" } }, "required": [ "messages" ], "title": "Chat Template", "type": "object" }, "GetPromptTemplateResponse": { "properties": { "id": { "type": "integer", "title": "Id" }, "prompt_name": { "type": "string", "title": "Prompt Name" }, "prompt_template": { "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Prompt Template", "discriminator": { "propertyName": "type", "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" } } }, "metadata": { "anyOf": [ { "$ref": "#/components/schemas/Metadata" }, { "type": "null" } ] }, "commit_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Commit Message" }, "llm_kwargs": { "anyOf": [ { "type": "object" }, { "type": "null" } ], "title": "Llm Kwargs", "description": "When you optionally specify `provider` in the body, `llm_kwargs` will be returned for that specific provider and you can pass these kwargs to the provider's API directly. **Important:** This object's structure is provider-specific and may change without notice as LLM providers update their APIs. For stable, provider-agnostic prompt data, use `prompt_template` instead." }, "version": { "type": "integer", "title": "Version" } }, "type": "object", "required": [ "id", "prompt_name", "prompt_template" ], "title": "GetPromptTemplateResponse" }, "SnippetReference": { "properties": { "prompt_name": { "type": "string", "title": "Prompt Name", "description": "The name of the snippet prompt template." }, "version": { "type": "integer", "title": "Version", "description": "The version number of the snippet used." }, "label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label", "description": "The release label of the snippet, if applicable." } }, "type": "object", "required": [ "prompt_name", "version" ], "title": "SnippetReference" }, "GetPromptTemplateRawResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "id": { "type": "integer", "title": "Id", "description": "The prompt template ID." }, "prompt_name": { "type": "string", "title": "Prompt Name", "description": "The name of the prompt template." }, "version": { "type": "integer", "title": "Version", "description": "The version number of the prompt template." }, "workspace_id": { "type": "integer", "title": "Workspace Id", "description": "The workspace this prompt template belongs to." }, "prompt_template": { "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Prompt Template", "description": "The prompt template content. When resolve_snippets is true (default), snippets are expanded. When false, raw @@@snippet@@@ references are preserved.", "discriminator": { "propertyName": "type", "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" } } }, "metadata": { "anyOf": [ { "$ref": "#/components/schemas/Metadata" }, { "type": "null" } ], "description": "Model configuration including provider, model name, and parameters." }, "commit_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Commit Message", "description": "The commit message for this version." }, "tags": { "type": "array", "items": { "type": "string" }, "title": "Tags", "description": "Tags associated with the prompt template." }, "created_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Created At", "description": "Timestamp when this version was created." }, "snippets": { "type": "array", "items": { "$ref": "#/components/schemas/SnippetReference" }, "title": "Snippets", "description": "List of snippet references used in this template." }, "llm_kwargs": { "anyOf": [ { "type": "object" }, { "type": "null" } ], "title": "LLM Kwargs", "description": "Provider-specific LLM arguments. Only present when include_llm_kwargs=true. Structure is provider-specific and may change without notice." } }, "type": "object", "required": [ "success", "id", "prompt_name", "version", "workspace_id", "prompt_template", "snippets" ], "title": "GetPromptTemplateRawResponse" }, "GetPromptTemplateLabelResponse": { "properties": { "release_labels": { "type": "array", "items": { "type": "object", "properties": { "prompt_version_id": { "type": "integer" }, "prompt_version_number": { "type": "integer" }, "release_label": { "type": "string" }, "release_label_id": { "type": "integer" } }, "required": [ "prompt_version_id", "prompt_version_number", "release_label", "release_label_id" ] }, "title": "Release Labels" } }, "type": "object", "required": [ "release_labels" ], "title": "GetPromptTemplateLabelResponse" }, "BasePromptTemplate": { "properties": { "prompt_name": { "type": "string", "maxLength": 512, "minLength": 1, "title": "Prompt Name" }, "tags": { "items": { "type": "string" }, "type": "array", "title": "Tags", "default": [] }, "folder_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Folder Id", "description": "The ID of the folder to publish the prompt template into. If not provided, the prompt will be published to the root level." } }, "type": "object", "required": [ "prompt_name" ], "title": "BasePromptTemplate" }, "PromptVersion": { "properties": { "prompt_template": { "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Prompt Template", "discriminator": { "propertyName": "type", "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" } } }, "commit_message": { "anyOf": [ { "type": "string", "maxLength": 72 }, { "type": "null" } ], "title": "Commit Message" }, "metadata": { "anyOf": [ { "$ref": "#/components/schemas/Metadata" }, { "type": "null" } ] } }, "type": "object", "required": [ "prompt_template" ], "title": "PromptVersion" }, "PatchPromptTemplateVersion": { "properties": { "version": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Version", "description": "The base version number to patch from. Mutually exclusive with `label`. If neither is provided, the latest version is used." }, "label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label", "description": "The release label identifying the base version to patch from (e.g. 'prod', 'staging'). Mutually exclusive with `version`." }, "messages": { "anyOf": [ { "type": "object", "additionalProperties": true, "description": "Index-based patch. Keys are string indices (e.g. \"0\", \"1\"), values are the replacement message objects." }, { "type": "array", "items": {}, "description": "Full replacement. Replaces all messages." }, { "type": "null" } ], "title": "Messages", "description": "Patch for chat template messages. Pass an object with index keys for index-based patching, or an array for full replacement. Chat templates only." }, "tools": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "array", "items": {} }, { "type": "null" } ], "title": "Tools", "description": "Patch for tools. Object for index-based patching, array for full replacement, null to remove. Chat templates only." }, "functions": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "array", "items": {} }, { "type": "null" } ], "title": "Functions", "description": "Patch for functions. Object for index-based patching, array for full replacement, null to remove. Chat templates only." }, "function_call": { "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Function Call", "description": "Replace the function_call setting. Set to null to remove. Chat templates only." }, "tool_choice": { "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Tool Choice", "description": "Replace the tool_choice setting. Set to null to remove. Chat templates only." }, "content": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "array", "items": {} }, { "type": "null" } ], "title": "Content", "description": "Patch for completion template content. Object for index-based patching, array for full replacement. Completion templates only." }, "model_parameters": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Model Parameters", "description": "Parameters to shallow-merge into the existing model parameters (e.g. temperature, max_tokens). Existing keys not specified here are preserved." }, "response_format": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Response Format", "description": "Convenience field to set response_format in model parameters. Cannot be used simultaneously with response_format inside model_parameters. Set to null to remove." }, "commit_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Commit Message", "description": "A message describing the changes in this version." }, "release_labels": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ], "title": "Release Labels", "description": "Release labels to create or move to the newly created version (e.g. ['staging', 'production'])." } }, "type": "object", "title": "PatchPromptTemplateVersion" }, "CreatePromptTemplate": { "properties": { "prompt_template": { "$ref": "#/components/schemas/BasePromptTemplate" }, "prompt_version": { "$ref": "#/components/schemas/PromptVersion" }, "release_labels": { "type": [ "array", "null" ], "items": { "type": "string" }, "title": "Release Labels" } }, "type": "object", "required": [ "prompt_template", "prompt_version" ], "title": "CreatePromptTemplate" }, "CreatePromptTemplateResponse": { "properties": { "id": { "type": "integer", "title": "Id", "description": "The ID of the prompt template." }, "prompt_name": { "type": "string", "title": "Prompt Name", "description": "The name of the prompt template." }, "prompt_version_id": { "type": "integer", "title": "Prompt Version Id", "description": "The ID of the created prompt version." }, "version_number": { "type": "integer", "title": "Version Number", "description": "The version number of the prompt template." }, "tags": { "items": { "type": "string" }, "type": "array", "title": "Tags" }, "release_labels": { "type": [ "array", "null" ], "items": { "type": "string" }, "title": "Release Labels" }, "prompt_template": { "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Prompt Template", "discriminator": { "propertyName": "type", "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" } } }, "metadata": { "anyOf": [ { "$ref": "#/components/schemas/Metadata" }, { "type": "null" } ] }, "commit_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Commit Message" } }, "type": "object", "required": [ "id", "prompt_name", "prompt_version_id", "version_number", "tags", "prompt_template" ], "title": "CreatePromptTemplateResponse" }, "ToolCall": { "properties": { "tool_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Tool Id" }, "id": { "type": "string", "title": "Id" }, "type": { "const": "function", "title": "Type", "default": "function" }, "function": { "$ref": "#/components/schemas/FunctionCall" } }, "type": "object", "required": [ "id", "function" ], "title": "ToolCall" }, "ToolMessage": { "properties": { "input_variables": { "items": { "type": "string" }, "type": "array", "title": "Input Variables", "default": [] }, "template_format": { "type": "string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "default": "f-string" }, "content": { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array", "title": "Content" }, "role": { "const": "tool", "title": "Role", "default": "tool" }, "tool_call_id": { "type": "string", "title": "Tool Call Id" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" } }, "type": "object", "required": [ "content", "tool_call_id" ], "title": "ToolMessage" }, "FunctionTool": { "description": "A custom function tool definition.", "properties": { "type": { "const": "function", "title": "Type", "default": "function" }, "function": { "$ref": "#/components/schemas/Function" } }, "type": "object", "required": [ "function" ], "title": "FunctionTool" }, "Tool": { "discriminator": { "propertyName": "type", "mapping": { "function": "#/components/schemas/FunctionTool", "web_search": "#/components/schemas/BuiltInTool", "file_search": "#/components/schemas/BuiltInTool", "code_interpreter": "#/components/schemas/BuiltInTool", "image_generation": "#/components/schemas/BuiltInTool", "google_maps": "#/components/schemas/BuiltInTool", "url_context": "#/components/schemas/BuiltInTool", "mcp": "#/components/schemas/BuiltInTool", "bash": "#/components/schemas/BuiltInTool", "shell": "#/components/schemas/BuiltInTool", "apply_patch": "#/components/schemas/BuiltInTool", "text_editor": "#/components/schemas/BuiltInTool" } }, "oneOf": [ {"$ref": "#/components/schemas/FunctionTool"}, {"$ref": "#/components/schemas/BuiltInTool"} ], "title": "Tool" }, "ChatToolChoice": { "properties": { "type": { "const": "function", "title": "Type", "default": "function" }, "function": { "$ref": "#/components/schemas/MessageFunctionCall" } }, "type": "object", "required": [ "function" ], "title": "ChatToolChoice" }, "ListPromptTemplates": { "properties": { "has_next": { "type": "boolean", "title": "Has Next" }, "has_prev": { "type": "boolean", "title": "Has Prev" }, "items": { "items": { "$ref": "#/components/schemas/GetPromptTemplateResponse" }, "type": "array", "title": "Items" }, "next_num": { "type": "integer", "title": "Next Num" }, "prev_num": { "type": "integer", "title": "Prev Num" }, "page": { "type": "integer", "title": "Page" }, "pages": { "type": "integer", "title": "Pages" }, "total": { "type": "integer", "title": "Total" } }, "type": "object", "required": [ "has_next", "has_prev", "items", "next_num", "prev_num", "page", "pages", "total" ], "title": "ListPromptTemplates" }, "PlaceholderMessage": { "properties": { "input_variables": { "default": [], "items": { "type": "string" }, "title": "Input Variables", "type": "array" }, "template_format": { "default": "f-string", "enum": [ "f-string", "jinja2" ], "title": "Template Format", "type": "string" }, "content": { "anyOf": [ { "items": { "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/TextContent", "thinking": "#/components/schemas/ThinkingContent", "code": "#/components/schemas/CodeContent", "image_url": "#/components/schemas/ImageContent", "media": "#/components/schemas/MediaContent", "media_variable": "#/components/schemas/MediaVariable", "output_media": "#/components/schemas/OutputMediaContent", "server_tool_use": "#/components/schemas/ServerToolUseContent", "web_search_tool_result": "#/components/schemas/WebSearchToolResultContent", "code_execution_result": "#/components/schemas/CodeExecutionResultContent", "mcp_list_tools": "#/components/schemas/McpListToolsContent", "mcp_call": "#/components/schemas/McpCallContent", "mcp_approval_request": "#/components/schemas/McpApprovalRequestContent", "mcp_approval_response": "#/components/schemas/McpApprovalResponseContent", "bash_code_execution_tool_result": "#/components/schemas/BashCodeExecutionToolResultContent", "text_editor_code_execution_tool_result": "#/components/schemas/TextEditorCodeExecutionToolResultContent", "shell_call": "#/components/schemas/ShellCallContent", "shell_call_output": "#/components/schemas/ShellCallOutputContent", "apply_patch_call": "#/components/schemas/ApplyPatchCallContent", "apply_patch_call_output": "#/components/schemas/ApplyPatchCallOutputContent" } }, "oneOf": [ {"$ref": "#/components/schemas/TextContent"}, {"$ref": "#/components/schemas/ThinkingContent"}, {"$ref": "#/components/schemas/CodeContent"}, {"$ref": "#/components/schemas/ImageContent"}, {"$ref": "#/components/schemas/MediaContent"}, {"$ref": "#/components/schemas/MediaVariable"}, {"$ref": "#/components/schemas/OutputMediaContent"}, {"$ref": "#/components/schemas/ServerToolUseContent"}, {"$ref": "#/components/schemas/WebSearchToolResultContent"}, {"$ref": "#/components/schemas/CodeExecutionResultContent"}, {"$ref": "#/components/schemas/McpListToolsContent"}, {"$ref": "#/components/schemas/McpCallContent"}, {"$ref": "#/components/schemas/McpApprovalRequestContent"}, {"$ref": "#/components/schemas/McpApprovalResponseContent"}, {"$ref": "#/components/schemas/BashCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/TextEditorCodeExecutionToolResultContent"}, {"$ref": "#/components/schemas/ShellCallContent"}, {"$ref": "#/components/schemas/ShellCallOutputContent"}, {"$ref": "#/components/schemas/ApplyPatchCallContent"}, {"$ref": "#/components/schemas/ApplyPatchCallOutputContent"} ] }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Content" }, "raw_request_display_role": { "default": "", "title": "Raw Request Display Role", "type": "string" }, "role": { "const": "placeholder", "default": "placeholder", "enum": [ "placeholder" ], "title": "Role", "type": "string" }, "name": { "title": "Name", "type": "string" } }, "required": [ "name" ], "title": "PlaceholderMessage", "type": "object" }, "LogRequest": { "properties": { "provider": { "title": "Provider", "type": "string" }, "model": { "title": "Model", "type": "string" }, "input": { "discriminator": { "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Input" }, "output": { "discriminator": { "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Output" }, "request_start_time": { "format": "date-time", "title": "Request Start Time", "type": "string" }, "request_end_time": { "format": "date-time", "title": "Request End Time", "type": "string" }, "parameters": { "default": {}, "title": "Parameters", "type": "object", "description": "Model parameters including temperature, max_tokens, etc. Can also include structured output configuration via response_format.json_schema. See documentation for structured output examples." }, "tags": { "default": [], "items": { "maxLength": 512, "type": "string" }, "title": "Tags", "type": "array" }, "metadata": { "additionalProperties": { "type": "string" }, "default": {}, "title": "Metadata", "type": "object", "description": "Custom key-value pairs for tracking additional request information. Keys are limited to 1024 characters." }, "prompt_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prompt Name" }, "prompt_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Prompt Id", "description": "The ID of the prompt template used for this request. This is useful for tracking which prompt was used in the request." }, "prompt_version_number": { "anyOf": [ { "exclusiveMinimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Prompt Version Number" }, "prompt_input_variables": { "default": {}, "title": "Prompt Input Variables", "type": "object" }, "input_tokens": { "default": 0, "minimum": 0, "title": "Input Tokens", "type": "integer" }, "output_tokens": { "default": 0, "minimum": 0, "title": "Output Tokens", "type": "integer" }, "price": { "default": 0.0, "minimum": 0.0, "title": "Price", "type": "number" }, "function_name": { "default": "", "title": "Function Name", "type": "string" }, "score": { "default": 0, "maximum": 100, "minimum": 0, "title": "Score", "type": "integer" }, "api_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Api Type" }, "status": { "type": "string", "enum": [ "SUCCESS", "WARNING", "ERROR" ], "default": "SUCCESS", "title": "Status", "description": "Request status.\n\n| Value | Description |\n|-------|-------------|\n| `SUCCESS` | Request completed successfully (default) |\n| `WARNING` | Request succeeded but had issues (e.g., retries, degraded response) |\n| `ERROR` | Request failed |" }, "error_type": { "anyOf": [ { "type": "string", "enum": [ "PROVIDER_TIMEOUT", "PROVIDER_QUOTA_LIMIT", "PROVIDER_RATE_LIMIT", "PROVIDER_AUTH_ERROR", "PROVIDER_ERROR", "TEMPLATE_RENDER_ERROR", "VARIABLE_MISSING_OR_EMPTY", "UNKNOWN_ERROR" ] }, { "type": "null" } ], "default": null, "title": "Error Type", "description": "Categorized error type.\n\n| Value | Description | Allowed Statuses |\n|-------|-------------|------------------|\n| `PROVIDER_RATE_LIMIT` | Rate limit hit on provider API | WARNING, ERROR |\n| `PROVIDER_QUOTA_LIMIT` | Account quota or spending limit exceeded | WARNING, ERROR |\n| `VARIABLE_MISSING_OR_EMPTY` | Required template variable was missing or empty | WARNING |\n| `PROVIDER_TIMEOUT` | Request timed out | ERROR |\n| `PROVIDER_AUTH_ERROR` | Authentication failed with provider | ERROR |\n| `PROVIDER_ERROR` | General provider-side error | ERROR |\n| `TEMPLATE_RENDER_ERROR` | Failed to render prompt template | ERROR |\n| `UNKNOWN_ERROR` | Uncategorized error | WARNING, ERROR |" }, "error_message": { "anyOf": [ { "type": "string", "maxLength": 1024 }, { "type": "null" } ], "default": null, "title": "Error Message", "description": "Detailed error message describing what went wrong. Maximum 1024 characters." } }, "required": [ "provider", "model", "input", "output", "request_start_time", "request_end_time" ], "title": "LogRequest", "type": "object" }, "LogRequestResponse": { "properties": { "id": { "title": "Id", "type": "integer" }, "prompt_version": { "$ref": "#/components/schemas/PromptVersion" }, "status": { "type": "string", "enum": [ "SUCCESS", "WARNING", "ERROR" ], "title": "Status", "description": "Request status indicating success, warning, or error." }, "error_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Type", "description": "Categorized error type if status is WARNING or ERROR." }, "error_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Message", "description": "Detailed error message if status is WARNING or ERROR." } }, "required": [ "id", "prompt_version" ], "title": "LogRequestResponse", "type": "object" }, "BadRequestError": { "properties": { "success": { "const": false, "default": false, "enum": [ false ], "title": "Success", "type": "boolean" }, "message": { "title": "Message", "type": "string" } }, "required": [ "message" ], "title": "BadRequestError", "type": "object" }, "PromptBlueprint": { "properties": { "prompt_template": { "anyOf": [ { "$ref": "#/components/schemas/CompletionPrompt" }, { "$ref": "#/components/schemas/ChatPrompt" } ], "title": "Prompt Template", "description": "The prompt template. Either a CompletionPrompt (type: 'completion') or ChatPrompt (type: 'chat').", "discriminator": { "propertyName": "type", "mapping": { "chat": "#/components/schemas/ChatPrompt", "completion": "#/components/schemas/CompletionPrompt" } } }, "commit_message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Commit Message" }, "metadata": { "anyOf": [ { "$ref": "#/components/schemas/Metadata" }, { "type": "null" } ], "default": null, "title": "Metadata" }, "provider_base_url_name": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "default": null, "title": "Provider Base Url Name", "description": "Name of the custom provider base URL configuration." }, "report_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Report Id" }, "inference_client_name": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "default": null, "title": "Inference Client Name", "description": "Name of the inference client to use." }, "provider_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "default": null, "title": "Provider Id", "description": "ID of the provider configuration to use." } }, "type": "object", "required": [ "prompt_template" ], "title": "PromptBlueprint" }, "SpanKind": { "type": "string", "enum": [ "SpanKind.CLIENT", "SpanKind.CONSUMER", "SpanKind.INTERNAL", "SpanKind.PRODUCER", "SpanKind.SERVER" ], "title": "SpanKind" }, "StatusCode": { "type": "string", "enum": [ "StatusCode.ERROR", "StatusCode.OK", "StatusCode.UNSET" ], "title": "StatusCode" }, "SpanContext": { "type": "object", "properties": { "trace_id": { "type": "string", "title": "Trace ID" }, "span_id": { "type": "string", "title": "Span ID" }, "trace_state": { "type": "string", "title": "Trace State" } }, "required": [ "trace_id", "span_id", "trace_state" ], "title": "SpanContext" }, "SpanStatus": { "type": "object", "properties": { "status_code": { "$ref": "#/components/schemas/StatusCode" }, "description": { "type": "string", "title": "Description", "nullable": true } }, "required": [ "status_code" ], "title": "SpanStatus" }, "SpanResource": { "type": "object", "properties": { "attributes": { "type": "object", "additionalProperties": { "type": "string" }, "title": "Attributes" }, "schema_url": { "type": "string", "title": "Schema URL" } }, "required": [ "attributes", "schema_url" ], "title": "SpanResource" }, "Span": { "type": "object", "properties": { "name": { "type": "string", "title": "Name" }, "context": { "$ref": "#/components/schemas/SpanContext" }, "kind": { "$ref": "#/components/schemas/SpanKind" }, "parent_id": { "type": "string", "title": "Parent ID", "nullable": true }, "start_time": { "type": "integer", "title": "Start Time" }, "end_time": { "type": "integer", "title": "End Time" }, "status": { "$ref": "#/components/schemas/SpanStatus" }, "attributes": { "type": "object", "title": "Attributes" }, "events": { "type": "array", "items": { "type": "object" }, "title": "Events", "default": [] }, "links": { "type": "array", "items": { "type": "object" }, "title": "Links", "default": [] }, "resource": { "$ref": "#/components/schemas/SpanResource" }, "log_request": { "anyOf": [ { "$ref": "#/components/schemas/LogRequest" }, { "type": "null" } ], "title": "Log Request", "nullable": true } }, "required": [ "name", "context", "kind", "start_time", "end_time", "status", "attributes", "resource" ], "title": "Span" }, "CreateSpansBulk": { "type": "object", "properties": { "spans": { "type": "array", "items": { "$ref": "#/components/schemas/Span" }, "title": "Spans" } }, "required": [ "spans" ], "title": "CreateSpansBulk" }, "CreateSpansBulkResponse": { "type": "object", "properties": { "success": { "type": "boolean", "title": "Success" }, "spans": { "type": "array", "items": { "type": "object" }, "title": "Spans" }, "request_logs": { "type": "array", "items": { "type": "object" }, "title": "Request Logs", "nullable": true } }, "required": [ "success", "spans" ], "title": "CreateSpansBulkResponse" }, "Dataset": { "type": "object", "properties": { "id": { "type": "integer", "description": "Dataset ID" }, "dataset_group_id": { "type": "integer", "description": "Associated dataset group ID" }, "version_number": { "type": "integer", "description": "Version number of the dataset" }, "column_names": { "type": "array", "items": { "type": "string" }, "description": "Array of column names in the dataset" }, "filter_params": { "type": "object", "nullable": true, "description": "Filter parameters used to create the dataset" }, "is_deleted": { "type": "boolean", "description": "Whether the dataset is deleted" }, "user_id": { "type": "integer", "description": "ID of the user who created the dataset" }, "dataset_group": { "$ref": "#/components/schemas/DatasetGroup", "description": "Associated dataset group information" } }, "required": [ "id", "dataset_group_id", "version_number", "column_names", "is_deleted", "user_id" ], "title": "Dataset" }, "DatasetGroup": { "type": "object", "properties": { "id": { "type": "integer", "description": "Dataset group ID" }, "name": { "type": "string", "description": "Dataset group name" }, "workspace_id": { "type": "integer", "description": "Associated workspace ID" }, "is_deleted": { "type": "boolean", "description": "Whether the dataset group is deleted" } }, "required": [ "id", "name", "workspace_id", "is_deleted" ], "title": "DatasetGroup" }, "CreateFolderRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "description": "The name of the folder. Must be unique within its parent folder." }, "parent_id": { "type": "integer", "nullable": true, "description": "The ID of the parent folder. If null or not provided, the folder will be created at the root level of the workspace." } }, "title": "CreateFolderRequest" }, "CreateFolderSuccessResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates if the operation was successful" }, "folder": { "$ref": "#/components/schemas/Folder" } }, "title": "CreateFolderSuccessResponse" }, "Folder": { "type": "object", "properties": { "id": { "type": "integer", "description": "Unique identifier for the folder" }, "name": { "type": "string", "description": "The name of the folder" }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp when the folder was created" }, "updated_at": { "type": "string", "format": "date-time", "description": "Timestamp when the folder was last updated" }, "path": { "type": "array", "nullable": true, "items": { "type": "object" }, "description": "JSON array representing the folder hierarchy path. Contains the IDs and names of all parent folders. Null for root-level folders." }, "workspace_id": { "type": "integer", "description": "ID of the workspace this folder belongs to" }, "parent_id": { "type": "integer", "nullable": true, "description": "ID of the parent folder. Null for root-level folders." } }, "title": "Folder" }, "FolderExistsError": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "title": "FolderExistsError" }, "ParentFolderNotFoundError": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "title": "ParentFolderNotFoundError" }, "UnauthorizedError": { "type": "object", "properties": { "error": { "type": "string" }, "message": { "type": "string" } }, "title": "UnauthorizedError" }, "FolderNotFoundError": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "title": "FolderNotFoundError" }, "UpdateFolderRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "description": "The new name for the folder. Must be unique within its parent folder." } }, "title": "UpdateFolderRequest" }, "EntityType": { "type": "string", "enum": [ "FOLDER", "PROMPT", "SNIPPET", "WORKFLOW", "DATASET", "REPORT", "AB_TEST", "INPUT_VARIABLE_SET" ], "description": "The type of entity. SNIPPET is a pseudo-entity type representing completion-type prompts." }, "FolderEntity": { "type": "object", "required": [ "id", "name", "type", "path" ], "properties": { "id": { "type": "integer", "description": "Unique identifier for the entity" }, "name": { "type": "string", "description": "Name of the entity" }, "type": { "$ref": "#/components/schemas/EntityType" }, "created_at": { "type": "string", "format": "date-time", "nullable": true, "description": "Timestamp when the entity was created" }, "updated_at": { "type": "string", "format": "date-time", "nullable": true, "description": "Timestamp when the entity was last updated" }, "folder_id": { "type": "integer", "nullable": true, "description": "ID of the folder containing this entity. Null for root-level entities." }, "path": { "type": "array", "items": { "type": "string" }, "description": "Array of folder names representing the entity's location in the folder hierarchy." }, "metadata": { "nullable": true, "description": "Type-specific metadata. Included only when include_metadata=true.", "oneOf": [ { "$ref": "#/components/schemas/PromptEntityMetadata" }, { "$ref": "#/components/schemas/WorkflowEntityMetadata" }, { "$ref": "#/components/schemas/DatasetEntityMetadata" }, { "type": "object" } ] } }, "title": "FolderEntity" }, "PromptEntityMetadata": { "type": "object", "properties": { "type": { "type": "string", "nullable": true, "enum": ["chat", "completion"], "description": "The prompt template type." }, "latest_version_number": { "type": "integer", "nullable": true, "description": "The latest version number of the prompt." } }, "title": "PromptEntityMetadata" }, "WorkflowEntityMetadata": { "type": "object", "properties": { "latest_version_number": { "type": "integer", "nullable": true, "description": "The latest version number of the workflow." } }, "title": "WorkflowEntityMetadata" }, "DatasetEntityMetadata": { "type": "object", "properties": { "isDraft": { "type": "boolean", "description": "Whether the dataset group only has draft versions (no published versions)." }, "latest_version_number": { "type": "integer", "nullable": true, "description": "The latest published version number of the dataset." } }, "title": "DatasetEntityMetadata" }, "ListFolderEntitiesResponse": { "type": "object", "properties": { "entities": { "type": "array", "items": { "$ref": "#/components/schemas/FolderEntity" }, "description": "List of entities matching the query." } }, "title": "ListFolderEntitiesResponse" }, "EntityReference": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "The ID of the entity." }, "type": { "$ref": "#/components/schemas/EntityType" } }, "title": "EntityReference" }, "MoveFolderEntitiesRequest": { "type": "object", "required": [ "entities" ], "properties": { "entities": { "type": "array", "items": { "$ref": "#/components/schemas/EntityReference" }, "description": "List of entities to move." }, "folder_id": { "type": "integer", "nullable": true, "description": "The ID of the destination folder. If null or not provided, entities are moved to the workspace root." }, "workspace_id": { "type": "integer", "description": "The ID of the workspace." } }, "title": "MoveFolderEntitiesRequest" }, "DeleteFolderEntitiesRequest": { "type": "object", "required": [ "entities" ], "properties": { "entities": { "type": "array", "items": { "$ref": "#/components/schemas/EntityReference" }, "description": "List of entities to delete." }, "cascade": { "type": "boolean", "default": false, "description": "When true, recursively deletes all contents of any folders in the entities list. When false, attempting to delete a non-empty folder returns an error." }, "workspace_id": { "type": "integer", "description": "The ID of the workspace." } }, "title": "DeleteFolderEntitiesRequest" }, "FolderEntitiesCountResponse": { "type": "object", "properties": { "moved_count": { "type": "integer", "description": "The number of entities affected by the operation." } }, "title": "FolderEntitiesCountResponse" }, "ResolveFolderIdResponse": { "type": "object", "properties": { "id": { "type": "integer", "description": "The ID of the resolved folder." } }, "title": "ResolveFolderIdResponse" }, "OtlpExportTraceServiceRequest": { "type": "object", "title": "ExportTraceServiceRequest", "description": "An OTLP ExportTraceServiceRequest in JSON encoding. See the [OTLP specification](https://opentelemetry.io/docs/specs/otlp/#otlphttp-request) for the full schema.", "properties": { "resourceSpans": { "type": "array", "description": "An array of ResourceSpans. Each element describes spans from a single instrumented resource.", "items": { "type": "object", "properties": { "resource": { "type": "object", "description": "The resource that produced the spans.", "properties": { "attributes": { "type": "array", "description": "Resource attributes as key-value pairs.", "items": { "$ref": "#/components/schemas/OtlpKeyValue" } } } }, "scopeSpans": { "type": "array", "description": "An array of ScopeSpans, grouping spans by instrumentation scope.", "items": { "type": "object", "properties": { "scope": { "type": "object", "description": "The instrumentation scope that produced the spans.", "properties": { "name": { "type": "string" }, "version": { "type": "string" } } }, "spans": { "type": "array", "description": "Array of Span objects.", "items": { "$ref": "#/components/schemas/OtlpSpan" } } } } } } } } } }, "OtlpSpan": { "type": "object", "title": "Span", "description": "A single OTLP span. See the [OTLP Span spec](https://opentelemetry.io/docs/specs/otel/trace/api/#span) for full details.", "required": ["traceId", "spanId", "name", "startTimeUnixNano"], "properties": { "traceId": { "type": "string", "description": "Hex-encoded trace ID (32 hex characters / 16 bytes).", "minLength": 32, "maxLength": 32 }, "spanId": { "type": "string", "description": "Hex-encoded span ID (16 hex characters / 8 bytes).", "minLength": 16, "maxLength": 16 }, "parentSpanId": { "type": "string", "description": "Hex-encoded parent span ID. Empty or omitted for root spans." }, "name": { "type": "string", "description": "The name of the span." }, "kind": { "type": "integer", "description": "Span kind: 0=UNSPECIFIED, 1=INTERNAL, 2=SERVER, 3=CLIENT, 4=PRODUCER, 5=CONSUMER.", "enum": [0, 1, 2, 3, 4, 5] }, "startTimeUnixNano": { "type": "string", "description": "Start time in nanoseconds since Unix epoch, encoded as a string." }, "endTimeUnixNano": { "type": "string", "description": "End time in nanoseconds since Unix epoch, encoded as a string." }, "attributes": { "type": "array", "description": "Span attributes as key-value pairs. GenAI semantic convention attributes (e.g. `gen_ai.request.model`, `gen_ai.usage.input_tokens`) are automatically extracted.", "items": { "$ref": "#/components/schemas/OtlpKeyValue" } }, "status": { "type": "object", "description": "Span status.", "properties": { "code": { "type": "integer", "description": "Status code: 0=UNSET, 1=OK, 2=ERROR.", "enum": [0, 1, 2] }, "message": { "type": "string", "description": "Status message (typically set for ERROR status)." } } }, "events": { "type": "array", "description": "Span events (e.g. exceptions).", "items": { "type": "object", "properties": { "timeUnixNano": { "type": "string" }, "name": { "type": "string" }, "attributes": { "type": "array", "items": { "$ref": "#/components/schemas/OtlpKeyValue" } } } } }, "links": { "type": "array", "description": "Links to other spans.", "items": { "type": "object", "properties": { "traceId": { "type": "string" }, "spanId": { "type": "string" }, "attributes": { "type": "array", "items": { "$ref": "#/components/schemas/OtlpKeyValue" } } } } } } }, "OtlpKeyValue": { "type": "object", "title": "KeyValue", "description": "An OTLP attribute key-value pair.", "required": ["key", "value"], "properties": { "key": { "type": "string" }, "value": { "type": "object", "description": "The attribute value. Exactly one of the value fields must be set.", "properties": { "stringValue": { "type": "string" }, "intValue": { "type": "string" }, "doubleValue": { "type": "number" }, "boolValue": { "type": "boolean" }, "arrayValue": { "type": "object", "properties": { "values": { "type": "array", "items": { "type": "object" } } } } } } } }, "OtlpExportTraceServiceResponse": { "type": "object", "title": "ExportTraceServiceResponse", "description": "Response to an OTLP trace export request.", "properties": { "partialSuccess": { "type": ["object", "null"], "description": "Present only when some spans were rejected. Null when all spans were accepted.", "properties": { "rejectedSpans": { "type": "integer", "description": "The number of spans that were rejected." }, "errorMessage": { "type": "string", "description": "A human-readable error message describing why spans were rejected." } } } } }, "SearchRequestLogsRequest": { "type": "object", "title": "SearchRequestLogsRequest", "description": "Search and filter request logs with structured filters, free-text search, sorting, and pagination.", "properties": { "filter_group": { "nullable": true, "description": "Nested filter group with AND/OR logic. Use this for complex queries.", "$ref": "#/components/schemas/StructuredFilterGroup" }, "q": { "type": "string", "nullable": true, "description": "Free-text search query. Searches across the prompt input and LLM output text using fuzzy prefix matching." }, "page": { "type": "integer", "minimum": 1, "nullable": true, "description": "Page number for pagination. Defaults to 1." }, "per_page": { "type": "integer", "minimum": 1, "maximum": 25, "nullable": true, "description": "Number of results per page. Defaults to 10, maximum 25." }, "sort_by": { "type": "string", "nullable": true, "enum": ["request_start_time", "input_tokens", "output_tokens", "cost", "latency_ms", "status"], "description": "Field to sort results by." }, "sort_order": { "type": "string", "nullable": true, "enum": ["asc", "desc"], "description": "Sort direction. Must be provided together with sort_by." }, "include_prompt_name": { "type": "boolean", "nullable": true, "description": "When true, includes the prompt template name in each result item. Defaults to false." } } }, "StructuredFilter": { "type": "object", "title": "StructuredFilter", "description": "A single filter condition on a request log field.", "required": ["field", "operator"], "properties": { "field": { "type": "string", "description": "The request log field to filter on.", "enum": [ "pl_id", "prompt_id", "engine", "provider_type", "input_text", "output_text", "prompt_version_number", "input_tokens", "output_tokens", "cost", "latency_ms", "request_start_time", "request_end_time", "status", "is_json", "is_tool_call", "is_plain_text", "tags", "metadata_keys", "metadata", "tool_names", "output", "output_keys", "input_variables", "input_variable_keys" ] }, "operator": { "type": "string", "description": "The comparison operator.", "enum": [ "is", "is_not", "in", "not_in", "contains", "not_contains", "starts_with", "ends_with", "eq", "neq", "gt", "gte", "lt", "lte", "between", "before", "after", "is_true", "is_false", "is_empty", "is_not_empty", "is_null", "is_not_null", "key_equals", "key_not_equals", "key_contains" ] }, "value": { "description": "The value to compare against. Type depends on the field and operator.", "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "array" }, { "type": "null" } ] }, "nested_key": { "type": "string", "nullable": true, "description": "Required for nested fields (metadata, output, input_variables). Specifies which key within the nested object to filter on." } } }, "StructuredFilterGroup": { "type": "object", "title": "StructuredFilterGroup", "description": "A group of filters combined with AND or OR logic. Can be nested recursively.", "required": ["filters"], "properties": { "logic": { "type": "string", "enum": ["AND", "OR"], "default": "AND", "description": "How to combine the filters in this group." }, "filters": { "type": "array", "description": "List of filters or nested filter groups.", "items": { "oneOf": [ { "$ref": "#/components/schemas/StructuredFilter" }, { "$ref": "#/components/schemas/StructuredFilterGroup" } ] } } } }, "SearchRequestLogsResponse": { "type": "object", "title": "SearchRequestLogsResponse", "description": "Paginated search results.", "properties": { "success": { "type": "boolean", "description": "Indicates the request was successful." }, "items": { "type": "array", "description": "List of matching request log summaries.", "items": { "type": "object", "description": "A request log summary including metadata, token counts, cost, and tags." } }, "page": { "type": "integer", "description": "Current page number." }, "pages": { "type": "integer", "description": "Total number of pages." }, "per_page": { "type": "integer", "description": "Number of results per page." }, "total": { "type": "integer", "description": "Total number of matching results." }, "has_next": { "type": "boolean", "description": "Whether there are more pages after the current one." }, "has_prev": { "type": "boolean", "description": "Whether there are pages before the current one." }, "next_num": { "type": "integer", "nullable": true, "description": "Next page number, or null if on the last page." }, "prev_num": { "type": "integer", "nullable": true, "description": "Previous page number, or null if on the first page." } } } } } }