{
  "openapi": "3.1.0",
  "info": {
    "title": "Asserto AI - API",
    "description": "API for Asserto  AI",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://app.asserto.ai",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/prompts": {
      "get": {
        "tags": [
          "API"
        ],
        "summary": "Prompt List",
        "description": "Get all project's prompts. The project is given by its API key.",
        "operationId": "prompts_list_api_prompts_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "API Key in the format: `Authorization: ApiKey <key>`",
              "title": "Authorization"
            },
            "description": "API Key in the format: `Authorization: ApiKey <key>`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIPromptList"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/prompts/{slug}": {
      "get": {
        "tags": [
          "API"
        ],
        "summary": "Prompt by Slug",
        "description": "Get single prompt by slug.\n\nGet only major versions",
        "operationId": "prompts_get_api_prompts__slug__get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "API Key in the format: `Authorization: ApiKey <key>`",
              "title": "Authorization"
            },
            "description": "API Key in the format: `Authorization: ApiKey <key>`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptSchema"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/graph": {
      "get": {
        "tags": [
          "API"
        ],
        "summary": "Project Graph Export",
        "description": "Export project graph in simplified Prompt Flow JSON format for external integrations.\n\nReturns a graph structure with nodes and edges in a standardized format suitable\nfor external workflow tools and integrations.",
        "operationId": "graph_export_api_graph_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "API Key in the format: `Authorization: ApiKey <key>`",
              "title": "Authorization"
            },
            "description": "API Key in the format: `Authorization: ApiKey <key>`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PFGraph"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "APIPromptList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PromptSchema"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "APIPromptList"
      },
      "ContentText": {
        "properties": {
          "type": {
            "type": "string",
            "const": "text",
            "title": "Type"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "title": "ContentText"
      },
      "GenerationParams": {
        "properties": {
          "temperature": {
            "type": "number",
            "title": "Temperature",
            "default": 0.1
          }
        },
        "type": "object",
        "title": "GenerationParams"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LLMPricing": {
        "properties": {
          "tkInput": {
            "type": "string",
            "title": "Tkinput"
          },
          "tkOutput": {
            "type": "string",
            "title": "Tkoutput"
          },
          "tkCacheWrite": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tkcachewrite"
          },
          "tkCacheRead": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tkcacheread"
          }
        },
        "type": "object",
        "required": [
          "tkInput",
          "tkOutput"
        ],
        "title": "LLMPricing",
        "description": "Pricing in USD per 1M tokens"
      },
      "MCP_PromptMessage": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "content": {
            "$ref": "#/components/schemas/ContentText"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "MCP_PromptMessage",
        "description": "prompt message as used in MCP protocol"
      },
      "MCP_ToolDef": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "inputSchema": {
            "$ref": "#/components/schemas/MCP_Tool_InputSchema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "inputSchema"
        ],
        "title": "MCP_ToolDef"
      },
      "MCP_Tool_InputSchema": {
        "properties": {
          "type": {
            "type": "string",
            "const": "object",
            "title": "Type",
            "default": "object"
          },
          "properties": {
            "additionalProperties": true,
            "type": "object",
            "title": "Properties"
          },
          "required": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required"
          }
        },
        "type": "object",
        "required": [
          "properties",
          "required"
        ],
        "title": "MCP_Tool_InputSchema"
      },
      "ModelInfo": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "type": "string",
            "enum": [
              "system",
              "custom"
            ],
            "title": "Kind"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "pricing": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LLMPricing"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "provider"
        ],
        "title": "ModelInfo"
      },
      "PFEdge": {
        "properties": {
          "src": {
            "type": "string",
            "title": "Src"
          },
          "tgt": {
            "type": "string",
            "title": "Tgt"
          }
        },
        "type": "object",
        "required": [
          "src",
          "tgt"
        ],
        "title": "PFEdge"
      },
      "PFGraph": {
        "properties": {
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/PFNode"
            },
            "type": "array",
            "title": "Nodes"
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/PFEdge"
            },
            "type": "array",
            "title": "Edges"
          }
        },
        "type": "object",
        "required": [
          "nodes",
          "edges"
        ],
        "title": "PFGraph"
      },
      "PFNode": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "params": {
            "additionalProperties": true,
            "type": "object",
            "title": "Params"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type",
          "params"
        ],
        "title": "PFNode"
      },
      "PromptSchema": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/MCP_PromptMessage"
            },
            "type": "array",
            "title": "Messages"
          },
          "model": {
            "$ref": "#/components/schemas/ModelInfo"
          },
          "genParams": {
            "$ref": "#/components/schemas/GenerationParams"
          },
          "respFormat": {
            "type": "string",
            "title": "Respformat"
          },
          "outputSchema": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SchemaJsonFormat"
              },
              {
                "type": "null"
              }
            ]
          },
          "variables": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Variables",
            "default": []
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MCP_ToolDef"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "messages",
          "model",
          "genParams",
          "respFormat",
          "tools"
        ],
        "title": "PromptSchema",
        "description": "Prompt info with nested tool definitions"
      },
      "SchemaJsonFormat": {
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Name",
            "description": "Schema name. Must match pattern: ^[a-zA-Z0-9_-]+$"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "A brief description of the Schema."
          },
          "schema": {
            "$ref": "#/components/schemas/SchemaJsonProperties",
            "description": "Schema that describes the output."
          },
          "strict": {
            "type": "boolean",
            "title": "Strict",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name",
          "schema"
        ],
        "title": "SchemaJsonFormat",
        "description": "Schema for response when using response format json_schema"
      },
      "SchemaJsonProp": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "description": "The data type of the parameter, e.g., 'string', 'number', 'object'."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the parameter."
          },
          "properties": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/SchemaJsonProp"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Properties",
            "description": "Dictionary of parameter names to their definitions."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "SchemaJsonProp"
      },
      "SchemaJsonProperties": {
        "properties": {
          "type": {
            "type": "string",
            "const": "object",
            "title": "Type",
            "default": "object"
          },
          "properties": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SchemaJsonProp"
            },
            "type": "object",
            "title": "Properties",
            "description": "Dictionary of parameter names to their definitions."
          },
          "required": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required",
            "description": "List of required parameters.",
            "default": []
          },
          "additionalProperties": {
            "type": "boolean",
            "title": "Additionalproperties",
            "description": "Indicates if additional properties are allowed.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "properties"
        ],
        "title": "SchemaJsonProperties"
      },
      "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"
      }
    }
  }
}
