diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 6e6e6f8..8caf753 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -61,7 +61,7 @@ }, "definition": { "additionalProperties": true, - "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, transform, gate, retry, evaluate_step, insight, extract_json, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, and others.", + "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, transform, gate, retry, evaluate_step, insight, extract_content, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, and others.", "title": "Definition", "type": "object" }, @@ -2048,6 +2048,17 @@ "description": "Embedding model override.", "title": "Embedding Model" }, + "index_mode": { + "anyOf": [ + { + "$ref": "#/components/schemas/SourceIndexMode" + }, + { + "type": "null" + } + ], + "description": "Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom." + }, "name": { "description": "Source name.", "maxLength": 255, @@ -2106,7 +2117,7 @@ "title": "Retention" }, "source_type": { - "description": "Source type: rss, website, file_uploads, or custom_index.", + "description": "Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index.", "title": "Source Type", "type": "string" }, @@ -3918,6 +3929,101 @@ "title": "PendingProcessingCompletedFailedStatus", "type": "string" }, + "PlaygroundCreateRequest": { + "description": "Create a model playground experiment via the public API.", + "properties": { + "evaluation_complexity": { + "default": "medium", + "description": "simple, medium, or complex", + "enum": [ + "simple", + "medium", + "complex" + ], + "title": "Evaluation Complexity", + "type": "string" + }, + "evaluation_mode": { + "default": "manual", + "description": "manual or prompt", + "enum": [ + "manual", + "prompt" + ], + "title": "Evaluation Mode", + "type": "string" + }, + "evaluator_model_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Evaluator model ID when evaluation_mode is prompt.", + "title": "Evaluator Model Id" + }, + "include_step_output_in_evaluation": { + "default": false, + "description": "Whether to include selected step output as evaluator context.", + "title": "Include Step Output In Evaluation", + "type": "boolean" + }, + "json_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional JSON template for advanced mode.", + "title": "Json Template" + }, + "model_ids": { + "description": "Selected model IDs (1-10).", + "items": { + "type": "string" + }, + "maxItems": 10, + "minItems": 1, + "title": "Model Ids", + "type": "array" + }, + "prompt": { + "description": "Prompt text for the experiment.", + "title": "Prompt", + "type": "string" + }, + "selected_step_output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional step output text for evaluator context.", + "title": "Selected Step Output" + }, + "system_prompt": { + "default": "", + "description": "Optional system prompt.", + "title": "System Prompt", + "type": "string" + } + }, + "required": [ + "model_ids", + "prompt" + ], + "title": "PlaygroundCreateRequest", + "type": "object" + }, "PromptModelAutoUpgradeStrategy": { "enum": [ "none", @@ -3928,6 +4034,110 @@ "title": "PromptModelAutoUpgradeStrategy", "type": "string" }, + "PromptToolResponse": { + "description": "Response model for a prompt tool.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "documentation_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Documentation Url" + }, + "example": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Example" + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Headers" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Notes" + }, + "tool_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Tool Name" + }, + "tool_type": { + "title": "Tool Type", + "type": "string" + }, + "tool_type_pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Tool Type Pattern" + } + }, + "required": [ + "id", + "tool_type", + "name" + ], + "title": "PromptToolResponse", + "type": "object" + }, "ProposedActionResponse": { "description": "A single proposed action.", "properties": { @@ -4262,6 +4472,17 @@ "title": "SourceEmbeddingMigrationResponse", "type": "object" }, + "SourceIndexMode": { + "description": "Embedding quality / cost trade-off preset for custom_index sources.\n\nEach preset controls the default embedding dimensions, chunk size, and\nchunk overlap. The embedding model is always the account-level default\n(currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``).\n\nPresets:\n FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap.\n BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap.\n SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap.\n CUSTOM: Caller supplies embedding model, dimensions, and chunk config.", + "enum": [ + "fast_and_cheap", + "balanced", + "slow_and_thorough", + "custom" + ], + "title": "SourceIndexMode", + "type": "string" + }, "SourceResponse": { "description": "Response model for source data.", "properties": { @@ -4430,6 +4651,17 @@ "title": "Id", "type": "string" }, + "index_mode": { + "anyOf": [ + { + "$ref": "#/components/schemas/SourceIndexMode" + }, + { + "type": "null" + } + ], + "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." + }, "name": { "description": "Name of the source connection.", "title": "Name", @@ -5450,51 +5682,51 @@ "title": "ValidationError", "type": "object" }, - "routers__api__agents__AgentListResponse": { + "VariantCategoryResponse": { + "description": "Response model for a variant category", "properties": { - "data": { - "description": "List of agents.", - "items": { - "$ref": "#/components/schemas/AgentSummaryResponse" - }, - "title": "Data", - "type": "array" + "category": { + "title": "Category", + "type": "string" }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentListResponse", - "type": "object" - }, - "routers__api__agents__AgentRunListResponse": { - "properties": { - "data": { - "description": "List of agent runs.", + "configurable": { + "title": "Configurable", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string" + }, + "options": { "items": { - "$ref": "#/components/schemas/AgentRunResponse" + "$ref": "#/components/schemas/VariantOptionResponse" }, - "title": "Data", + "title": "Options", "type": "array" }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" + "title": { + "title": "Title", + "type": "string" } }, "required": [ - "data", - "pagination" + "category", + "title", + "description", + "configurable", + "options" ], - "title": "AgentRunListResponse", + "title": "VariantCategoryResponse", "type": "object" }, - "routers__api__agents__AgentTraceSearchRequest": { + "VariantOptionResponse": { + "description": "Response model for a variant option", "properties": { - "agent_id": { + "default": { + "title": "Default", + "type": "boolean" + }, + "description": { "anyOf": [ { "type": "string" @@ -5503,81 +5735,252 @@ "type": "null" } ], - "description": "Filter by agent ID.", - "title": "Agent Id" - }, - "query": { - "description": "Search query text.", - "title": "Query", - "type": "string" + "title": "Description" }, - "run_status": { + "input_1h_cache_write_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Filter by run status.", - "title": "Run Status" + "title": "Input 1H Cache Write Credits Per 1000 Tokens" }, - "step_type": { + "input_5m_cache_write_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Filter by step type.", - "title": "Step Type" + "title": "Input 5M Cache Write Credits Per 1000 Tokens" }, - "top_n": { - "default": 10, - "description": "Maximum number of results.", - "maximum": 100.0, - "minimum": 1.0, - "title": "Top N", - "type": "integer" - } - }, - "required": [ - "query" - ], - "title": "AgentTraceSearchRequest", - "type": "object" - }, - "routers__api__agents__CreateAgentRequest": { - "properties": { - "agent_template": { + "input_cache_hit_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", - "title": "Agent Template" + "title": "Input Cache Hit Credits Per 1000 Tokens" }, - "description": { + "input_credits_per_1000_tokens": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "description": "Optional description.", - "title": "Description" + "title": "Input Credits Per 1000 Tokens" }, - "name": { - "description": "Name for the new agent.", + "long_context_input_cache_hit_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" + }, + "long_context_input_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Long Context Input Credits Per 1000 Tokens" + }, + "long_context_output_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Long Context Output Credits Per 1000 Tokens" + }, + "long_context_threshold": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Long Context Threshold" + }, + "output_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Output Credits Per 1000 Tokens" + }, + "title": { + "title": "Title", + "type": "string" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "value", + "title", + "default" + ], + "title": "VariantOptionResponse", + "type": "object" + }, + "routers__api__agents__AgentListResponse": { + "properties": { + "data": { + "description": "List of agents.", + "items": { + "$ref": "#/components/schemas/AgentSummaryResponse" + }, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "AgentListResponse", + "type": "object" + }, + "routers__api__agents__AgentRunListResponse": { + "properties": { + "data": { + "description": "List of agent runs.", + "items": { + "$ref": "#/components/schemas/AgentRunResponse" + }, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "AgentRunListResponse", + "type": "object" + }, + "routers__api__agents__AgentTraceSearchRequest": { + "properties": { + "agent_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by agent ID.", + "title": "Agent Id" + }, + "query": { + "description": "Search query text.", + "title": "Query", + "type": "string" + }, + "run_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by run status.", + "title": "Run Status" + }, + "step_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by step type.", + "title": "Step Type" + }, + "top_n": { + "default": 10, + "description": "Maximum number of results.", + "maximum": 100.0, + "minimum": 1.0, + "title": "Top N", + "type": "integer" + } + }, + "required": [ + "query" + ], + "title": "AgentTraceSearchRequest", + "type": "object" + }, + "routers__api__agents__CreateAgentRequest": { + "properties": { + "agent_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", + "title": "Agent Template" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional description.", + "title": "Description" + }, + "name": { + "description": "Name for the new agent.", "title": "Name", "type": "string" }, @@ -7130,61 +7533,429 @@ "title": "SourceListResponse", "type": "object" }, - "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { - "description": "Per-mode rollup for evaluation activity.", + "schemas__model_responses__PromptModelResponse": { + "description": "Response model for prompt model data", "properties": { - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" + "default": { + "title": "Default", + "type": "boolean" }, - "flagged": { - "title": "Flagged", - "type": "integer" + "deprecated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Deprecated At" }, - "mode": { - "title": "Mode", + "description": { + "title": "Description", "type": "string" }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" + "enabled": { + "title": "Enabled", + "type": "boolean" }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "mode", - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate" - ], - "title": "NonManualEvaluationModeStatResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { - "description": "Account-level summary for evaluations.", - "properties": { - "by_mode": { - "items": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" - }, - "title": "By Mode", - "type": "array" + "family": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Family" }, - "failed": { + "family_generation": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Family Generation" + }, + "id": { + "title": "Id", + "type": "string" + }, + "input_1h_cache_write_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Input 1H Cache Write Credits Per 1000 Tokens" + }, + "input_5m_cache_write_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Input 5M Cache Write Credits Per 1000 Tokens" + }, + "input_cache_hit_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Input Cache Hit Credits Per 1000 Tokens" + }, + "input_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Input Credits Per 1000 Tokens" + }, + "is_new": { + "default": false, + "title": "Is New", + "type": "boolean" + }, + "last_used": { + "default": false, + "title": "Last Used", + "type": "boolean" + }, + "max_context_tokens": { + "title": "Max Context Tokens", + "type": "integer" + }, + "max_conversation_length": { + "title": "Max Conversation Length", + "type": "integer" + }, + "max_output_tokens": { + "title": "Max Output Tokens", + "type": "integer" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "output_credits_per_1000_tokens": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Output Credits Per 1000 Tokens" + }, + "payload_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Model-specific JSON schema for advanced prompt_call json_template payloads.", + "title": "Payload Schema" + }, + "payload_schema_source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Source URL used to derive payload_schema guidance for this model.", + "title": "Payload Schema Source Url" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "released_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Released At" + }, + "schema_documentation_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model documentation URL with request/response payload details.", + "title": "Schema Documentation Url" + }, + "schema_notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable notes about request payload compatibility.", + "title": "Schema Notes" + }, + "successor_model_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Successor Model Id" + }, + "sunset_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Sunset At" + }, + "supported_input_media": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Supported Input Media" + }, + "supported_languages": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Supported Languages" + }, + "supports_openai_arguments": { + "default": false, + "title": "Supports Openai Arguments", + "type": "boolean" + }, + "supports_streaming": { + "default": false, + "title": "Supports Streaming", + "type": "boolean" + }, + "supports_structured_output": { + "default": true, + "title": "Supports Structured Output", + "type": "boolean" + }, + "supports_thinking": { + "default": false, + "title": "Supports Thinking", + "type": "boolean" + }, + "supports_tool_use": { + "default": true, + "title": "Supports Tool Use", + "type": "boolean" + }, + "tools_disabled": { + "items": { + "$ref": "#/components/schemas/PromptToolResponse" + }, + "title": "Tools Disabled", + "type": "array" + }, + "tools_enabled": { + "items": { + "$ref": "#/components/schemas/PromptToolResponse" + }, + "title": "Tools Enabled", + "type": "array" + }, + "training_cutoff_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Training Cutoff At" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + }, + "variants": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/VariantCategoryResponse" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Variants" + } + }, + "required": [ + "id", + "model_id", + "name", + "description", + "enabled", + "default", + "provider", + "max_context_tokens", + "max_output_tokens", + "max_conversation_length" + ], + "title": "PromptModelResponse", + "type": "object" + }, + "schemas__model_responses__ProviderGroupResponse": { + "description": "Response model for provider group with models", + "properties": { + "models": { + "items": { + "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" + }, + "title": "Models", + "type": "array" + }, + "provider": { + "title": "Provider", + "type": "string" + } + }, + "required": [ + "provider", + "models" + ], + "title": "ProviderGroupResponse", + "type": "object" + }, + "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { + "description": "Per-mode rollup for evaluation activity.", + "properties": { + "failed": { + "title": "Failed", + "type": "integer" + }, + "failure_rate": { + "title": "Failure Rate", + "type": "number" + }, + "flagged": { + "title": "Flagged", + "type": "integer" + }, + "mode": { + "title": "Mode", + "type": "string" + }, + "pass_rate": { + "title": "Pass Rate", + "type": "number" + }, + "passed": { + "title": "Passed", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "mode", + "total", + "passed", + "failed", + "flagged", + "pass_rate", + "failure_rate" + ], + "title": "NonManualEvaluationModeStatResponse", + "type": "object" + }, + "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { + "description": "Account-level summary for evaluations.", + "properties": { + "by_mode": { + "items": { + "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" + }, + "title": "By Mode", + "type": "array" + }, + "failed": { "title": "Failed", "type": "integer" }, @@ -7337,6 +8108,18 @@ "description": "Successful Response" }, "402": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detail": { + "type": "object" + } + } + } + } + }, "description": "Plan limit exceeded \u2014 the account has reached the maximum number of agents allowed by its subscription plan." }, "422": { @@ -8458,7 +9241,7 @@ }, "/agents/{agent_id}/definition": { "get": { - "description": "Fetch the current agent definition from the main branch.\n\nThe response includes `change_id` which must be provided when updating the definition (optimistic locking).\n\nThe definition contains the agent's step workflow. Available step types:\n- `prompt_call`: Call an LLM with a prompt template\n- `retrieval`: Search a knowledge base\n- `transform`: Reshape data with a Liquid template\n- `gate`: Evaluate conditions, stop or continue child execution\n- `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1\u201310))\n- `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`)\n- `insight`: Progressively read and analyze large input\n- `extract_json` / `extract_html` / `extract_xml`: Extract structured data\n- `send_email`: Send email with step output\n- `webhook_call`: POST data to an external URL\n- `write_aws_s3_object`: Write output to S3\n- `call_agent`: Invoke another agent\n- `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`)\n- `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`)\n- `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`)\n- `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional)\n- `display_result`: Show output to the user\n- `join`: Merge parallel branches\n- `combinator`: Combine multiple inputs\n- `text`: Static text literal\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", + "description": "Fetch the current agent definition from the main branch.\n\nThe response includes `change_id` which must be provided when updating the definition (optimistic locking).\n\nThe definition contains the agent's step workflow. Available step types:\n- `prompt_call`: Call an LLM with a prompt template\n- `retrieval`: Search a knowledge base\n- `transform`: Reshape data with a Liquid template\n- `gate`: Evaluate conditions, stop or continue child execution\n- `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1\u201310))\n- `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`)\n- `insight`: Progressively read and analyze large input\n- `extract_content`: Extract structured data (JSON, HTML, XML)\n- `send_email`: Send email with step output\n- `webhook_call`: POST data to an external URL\n- `write_aws_s3_object`: Write output to S3\n- `call_agent`: Invoke another agent\n- `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`)\n- `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`)\n- `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`)\n- `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional)\n- `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` trigger; `priority: true` enables real-time streaming)\n- `display_result`: Show output to the user\n- `join`: Merge parallel branches\n- `combinator`: Combine multiple inputs\n- `text`: Static text literal\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", "operationId": "get_agent_definition_api_agents__agent_id__definition_get", "parameters": [ { @@ -8502,7 +9285,7 @@ ] }, "put": { - "description": "Update the agent's definition on the main branch.\n\nUses **optimistic locking**: provide `expected_change_id` from the last `GET /api/agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read.\n\nThe definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `transform`, `gate`, `retry`, `evaluate_step`, `insight`, `extract_json`, `extract_html`, `extract_xml`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `combinator`, and `text`. Non-composite step types (`display_result`, `join`, `retry`, `evaluate_step`) cannot contain child steps.\n\n**Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1\u201310). Best practice: place a `gate` step before the retry to make retries conditional.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", + "description": "Update the agent's definition on the main branch.\n\nUses **optimistic locking**: provide `expected_change_id` from the last `GET /api/agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read.\n\nThe definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `transform`, `gate`, `retry`, `evaluate_step`, `insight`, `extract_content`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `combinator`, and `text`. Non-composite step types (`display_result`, `join`, `retry`, `evaluate_step`, `streaming_result`) cannot contain child steps.\n\n**Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1\u201310). Best practice: place a `gate` step before the retry to make retries conditional.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", "operationId": "update_agent_definition_api_agents__agent_id__definition_put", "parameters": [ { @@ -8994,7 +9777,7 @@ }, "/agents/{agent_id}/export": { "get": { - "description": "Export an agent definition as a portable JSON snapshot.\n\nThe response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name.\n\nResponse shape:\n- `export_version`: schema version (currently `\"2\"`)\n- `exported_at`: ISO-8601 timestamp\n- `agent`: name, description, schema_version, definition, timestamps\n- `trigger`: trigger type, input template, schedules\n- `alert_configs`: alert type, thresholds, recipients\n- `evaluation_criteria`: evaluation settings per step\n- `governance_policies`: agent-scoped governance policies\n- `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users\n\nQuery params:\n- `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- When using OAuth, you may target a different organization account with `X-Account-Id`; for API keys, the key's account is always used.\n- You can only export agents belonging to the resolved account.", + "description": "Export an agent definition as a portable JSON snapshot.\n\nThe response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name.\n\nResponse shape:\n- `export_version`: schema version (currently `\"2\"`)\n- `exported_at`: ISO-8601 timestamp\n- `agent`: name, description, schema_version, definition, timestamps\n- `trigger`: trigger type, input template, schedules\n- `alert_configs`: alert type, thresholds, recipients\n- `evaluation_criteria`: evaluation settings per step\n- `governance_policies`: agent-scoped governance policies\n- `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users\n\nQuery params:\n- `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download.\n\nAuth & scoping:\n- Requires `X-API-Key`. You can only export agents belonging to your account.", "operationId": "export_agent_api_agents__agent_id__export_get", "parameters": [ { @@ -9196,7 +9979,7 @@ ] }, "post": { - "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id`: alternatively, reference a file previously uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n- `priority`: set true for latency-sensitive, user-facing work.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", + "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id`: alternatively, reference a file previously uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", "operationId": "run_agent_api_agents__agent_id__runs_post", "parameters": [ { @@ -9227,11 +10010,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AgentRunResponse" + "$ref": "#/components/schemas/AgentRunResponse" + } + } + }, + "description": "Successful Response" + }, + "402": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detail": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "account_id": { + "type": "string" + } + } + } + } } } }, - "description": "Successful Response" + "description": "Insufficient credits \u2014 the account has exhausted its credits. The response body is `{\"detail\": {\"error\": \"insufficient_credits\", \"message\": ..., \"account_id\": ...}}`." }, "422": { "content": { @@ -9252,7 +10061,7 @@ }, "/agents/{agent_id}/runs/stream": { "post": { - "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", + "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id`: reference a file uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`).\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", "parameters": [ { @@ -9293,6 +10102,32 @@ }, "description": "Streams agent run events via Server-Sent Events (SSE); run is always created as priority.\n\nSSE events:\n- `event: init` \u2014 `data` is an `AgentRunResponse` snapshot (includes `run_id`).\n- `event: done` \u2014 `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc).\n- Other events (e.g. `status`, step events) are forwarded from the run event stream.\n- On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /api/agents/runs/{run_id}`." }, + "402": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detail": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "account_id": { + "type": "string" + } + } + } + } + } + } + }, + "description": "Insufficient credits \u2014 the account has exhausted its credits. The response body is `{\"detail\": {\"error\": \"insufficient_credits\", \"message\": ..., \"account_id\": ...}}`." + }, "422": { "content": { "application/json": { @@ -10930,7 +11765,7 @@ }, "/contents/{source_connection_content_version}/upload": { "post": { - "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/msword`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", + "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", "parameters": [ { @@ -11311,6 +12146,18 @@ "description": "Successful Response" }, "402": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detail": { + "type": "object" + } + } + } + } + }, "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." }, "422": { @@ -11869,14 +12716,252 @@ } } }, - "required": true - }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompactionTestResponseModel" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Test Compaction Prompt Standalone", + "tags": [ + "memory_banks" + ] + } + }, + "/memory_banks/{memory_bank_id}": { + "delete": { + "description": "Soft-delete a memory bank. This action is permanent and cannot be undone.\n\nThe linked content source and all stored conversation memory entries will also be removed.", + "operationId": "delete_memory_bank_api_memory_banks__memory_bank_id__delete", + "parameters": [ + { + "in": "path", + "name": "memory_bank_id", + "required": true, + "schema": { + "title": "Memory Bank Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Delete Memory Bank", + "tags": [ + "memory_banks" + ] + }, + "get": { + "description": "Fetch a memory bank by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account.", + "operationId": "get_memory_bank_api_memory_banks__memory_bank_id__get", + "parameters": [ + { + "in": "path", + "name": "memory_bank_id", + "required": true, + "schema": { + "title": "Memory Bank Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemoryBankResponseModel" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Get Memory Bank", + "tags": [ + "memory_banks" + ] + }, + "put": { + "description": "Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nNote: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries.", + "operationId": "update_memory_bank_api_memory_banks__memory_bank_id__put", + "parameters": [ + { + "in": "path", + "name": "memory_bank_id", + "required": true, + "schema": { + "title": "Memory Bank Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMemoryBankBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemoryBankResponseModel" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Update Memory Bank", + "tags": [ + "memory_banks" + ] + } + }, + "/memory_banks/{memory_bank_id}/agents": { + "get": { + "description": "List agents whose current definition references this memory bank.\n\nReturns an array of `{agent_id, agent_name}` objects.", + "operationId": "get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get", + "parameters": [ + { + "in": "path", + "name": "memory_bank_id", + "required": true, + "schema": { + "title": "Memory Bank Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "title": "Response Get Agents Using Bank Api Memory Banks Memory Bank Id Agents Get", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Get Agents Using Bank", + "tags": [ + "memory_banks" + ] + } + }, + "/memory_banks/{memory_bank_id}/compact": { + "post": { + "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_age_days, max_turns, or max_size_tokens). Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", + "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", + "parameters": [ + { + "in": "path", + "name": "memory_bank_id", + "required": true, + "schema": { + "title": "Memory Bank Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" + "additionalProperties": true, + "title": "Response Compact Memory Bank Api Memory Banks Memory Bank Id Compact Post", + "type": "object" } } }, @@ -11893,16 +12978,16 @@ "description": "Validation Error" } }, - "summary": "Test Compaction Prompt Standalone", + "summary": "Compact Memory Bank", "tags": [ "memory_banks" ] } }, - "/memory_banks/{memory_bank_id}": { + "/memory_banks/{memory_bank_id}/source": { "delete": { - "description": "Soft-delete a memory bank. This action is permanent and cannot be undone.\n\nThe linked content source and all stored conversation memory entries will also be removed.", - "operationId": "delete_memory_bank_api_memory_banks__memory_bank_id__delete", + "description": "Delete the content source linked to a memory bank, removing all stored memory entries.\n\nA new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself.", + "operationId": "delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete", "parameters": [ { "in": "path", @@ -11932,14 +13017,16 @@ "description": "Validation Error" } }, - "summary": "Delete Memory Bank", + "summary": "Delete Memory Bank Source", "tags": [ "memory_banks" ] - }, + } + }, + "/memory_banks/{memory_bank_id}/stats": { "get": { - "description": "Fetch a memory bank by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account.", - "operationId": "get_memory_bank_api_memory_banks__memory_bank_id__get", + "description": "Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters.", + "operationId": "get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get", "parameters": [ { "in": "path", @@ -11950,6 +13037,52 @@ "type": "string" } }, + { + "in": "query", + "name": "days", + "required": false, + "schema": { + "default": 30, + "maximum": 730, + "minimum": 1, + "title": "Days", + "type": "integer" + } + }, + { + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Start Date" + } + }, + { + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "End Date" + } + }, { "$ref": "#/components/parameters/X-Account-Id" } @@ -11959,7 +13092,9 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" + "additionalProperties": true, + "title": "Response Get Memory Bank Entry Stats Api Memory Banks Memory Bank Id Stats Get", + "type": "object" } } }, @@ -11976,14 +13111,16 @@ "description": "Validation Error" } }, - "summary": "Get Memory Bank", + "summary": "Get Memory Bank Entry Stats", "tags": [ "memory_banks" ] - }, - "put": { - "description": "Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nNote: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries.", - "operationId": "update_memory_bank_api_memory_banks__memory_bank_id__put", + } + }, + "/memory_banks/{memory_bank_id}/test-compaction": { + "post": { + "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", + "operationId": "test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post", "parameters": [ { "in": "path", @@ -12002,7 +13139,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateMemoryBankBody" + "$ref": "#/components/schemas/TestCompactionRequest" } } }, @@ -12013,7 +13150,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" + "$ref": "#/components/schemas/CompactionTestResponseModel" } } }, @@ -12030,24 +13167,69 @@ "description": "Validation Error" } }, - "summary": "Update Memory Bank", + "summary": "Test Compaction Prompt", "tags": [ "memory_banks" ] } }, - "/memory_banks/{memory_bank_id}/agents": { + "/models": { "get": { - "description": "List agents whose current definition references this memory bank.\n\nReturns an array of `{agent_id, agent_name}` objects.", - "operationId": "get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get", + "description": "List all enabled LLM models with full details.\n\nReturns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nOptional query parameters:\n- `provider`: filter by provider (e.g. 'anthropic', 'openai')\n- `supports_tool_use`: filter to models with tool calling support\n- `supports_thinking`: filter to models with extended thinking support\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", + "operationId": "list_models_api_models_get", "parameters": [ { - "in": "path", - "name": "memory_bank_id", - "required": true, + "description": "Filter by provider name", + "in": "query", + "name": "provider", + "required": false, "schema": { - "title": "Memory Bank Id", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by provider name", + "title": "Provider" + } + }, + { + "description": "Filter to models that support tool use", + "in": "query", + "name": "supports_tool_use", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Filter to models that support tool use", + "title": "Supports Tool Use" + } + }, + { + "description": "Filter to models that support extended thinking", + "in": "query", + "name": "supports_thinking", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Filter to models that support extended thinking", + "title": "Supports Thinking" } }, { @@ -12060,12 +13242,9 @@ "application/json": { "schema": { "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "$ref": "#/components/schemas/schemas__model_responses__ProviderGroupResponse" }, - "title": "Response Get Agents Using Bank Api Memory Banks Memory Bank Id Agents Get", + "title": "Response List Models Api Models Get", "type": "array" } } @@ -12083,71 +13262,169 @@ "description": "Validation Error" } }, - "summary": "Get Agents Using Bank", + "summary": "List Models", + "tags": [ + "models" + ] + } + }, + "/models/alerts": { + "get": { + "description": "List model lifecycle alerts for the account.\n\nReturns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account.", + "operationId": "list_alerts_api_models_alerts_get", + "parameters": [ + { + "description": "Filter alerts to a specific agent UUID.", + "in": "query", + "name": "agent_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter alerts to a specific agent UUID.", + "title": "Agent Id" + } + }, + { + "description": "When true, only return unread alerts.", + "in": "query", + "name": "unread_only", + "required": false, + "schema": { + "default": false, + "description": "When true, only return unread alerts.", + "title": "Unread Only", + "type": "boolean" + } + }, + { + "description": "Maximum number of alerts to return (1-100).", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 50, + "description": "Maximum number of alerts to return (1-100).", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "description": "Pagination offset.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "description": "Pagination offset.", + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response List Alerts Api Models Alerts Get", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "List Alerts", + "tags": [ + "models" + ] + } + }, + "/models/alerts/mark-all-read": { + "post": { + "description": "Mark all model lifecycle alerts as read for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account.", + "operationId": "mark_all_read_api_models_alerts_mark_all_read_post", + "parameters": [ + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "204": { + "description": "Successful Response" + } + }, + "summary": "Mark All Read", "tags": [ - "memory_banks" + "models" ] } }, - "/memory_banks/{memory_bank_id}/compact": { - "post": { - "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_age_days, max_turns, or max_size_tokens). Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", - "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", + "/models/alerts/unread-count": { + "get": { + "description": "Get the count of unread model lifecycle alerts.\n\nUseful for badge indicators in UIs and dashboards.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account.", + "operationId": "get_alert_unread_count_api_models_alerts_unread_count_get", "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" } ], "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { "additionalProperties": true, - "title": "Response Compact Memory Bank Api Memory Banks Memory Bank Id Compact Post", + "title": "Response Get Alert Unread Count Api Models Alerts Unread Count Get", "type": "object" } } }, "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" } }, - "summary": "Compact Memory Bank", + "summary": "Get Alert Unread Count", "tags": [ - "memory_banks" + "models" ] } }, - "/memory_banks/{memory_bank_id}/source": { - "delete": { - "description": "Delete the content source linked to a memory bank, removing all stored memory entries.\n\nA new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself.", - "operationId": "delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete", + "/models/alerts/{alert_id}/read": { + "patch": { + "description": "Mark a single model lifecycle alert as read (dismissed).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account.", + "operationId": "mark_read_api_models_alerts__alert_id__read_patch", "parameters": [ { "in": "path", - "name": "memory_bank_id", + "name": "alert_id", "required": true, "schema": { - "title": "Memory Bank Id", + "format": "uuid", + "title": "Alert Id", "type": "string" } }, @@ -12170,32 +13447,25 @@ "description": "Validation Error" } }, - "summary": "Delete Memory Bank Source", + "summary": "Mark Read", "tags": [ - "memory_banks" + "models" ] } }, - "/memory_banks/{memory_bank_id}/stats": { + "/models/playground/experiments": { "get": { - "description": "Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters.", - "operationId": "get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get", + "description": "List model playground experiments for the account.\n\nReturns a paginated, time-filtered list of experiments ordered by creation date descending.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account.", + "operationId": "list_experiments_api_models_playground_experiments_get", "parameters": [ { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { + "description": "Look-back window in days.", "in": "query", "name": "days", "required": false, "schema": { "default": 30, + "description": "Look-back window in days.", "maximum": 730, "minimum": 1, "title": "Days", @@ -12203,6 +13473,7 @@ } }, { + "description": "Explicit start date (overrides days).", "in": "query", "name": "start_date", "required": false, @@ -12216,10 +13487,12 @@ "type": "null" } ], + "description": "Explicit start date (overrides days).", "title": "Start Date" } }, { + "description": "Explicit end date (overrides days).", "in": "query", "name": "end_date", "required": false, @@ -12233,9 +13506,37 @@ "type": "null" } ], + "description": "Explicit end date (overrides days).", "title": "End Date" } }, + { + "description": "Page size.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "description": "Page size.", + "maximum": 50, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "description": "Pagination offset.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "description": "Pagination offset.", + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, { "$ref": "#/components/parameters/X-Account-Id" } @@ -12246,7 +13547,7 @@ "application/json": { "schema": { "additionalProperties": true, - "title": "Response Get Memory Bank Entry Stats Api Memory Banks Memory Bank Id Stats Get", + "title": "Response List Experiments Api Models Playground Experiments Get", "type": "object" } } @@ -12264,26 +13565,15 @@ "description": "Validation Error" } }, - "summary": "Get Memory Bank Entry Stats", + "summary": "List Experiments", "tags": [ - "memory_banks" + "models" ] - } - }, - "/memory_banks/{memory_bank_id}/test-compaction": { + }, "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post", + "description": "Create and schedule a model playground experiment.\n\nRuns the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", + "operationId": "create_experiment_api_models_playground_experiments_post", "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, { "$ref": "#/components/parameters/X-Account-Id" } @@ -12292,7 +13582,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestCompactionRequest" + "$ref": "#/components/schemas/PlaygroundCreateRequest" } } }, @@ -12303,7 +13593,9 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" + "additionalProperties": true, + "title": "Response Create Experiment Api Models Playground Experiments Post", + "type": "object" } } }, @@ -12320,72 +13612,25 @@ "description": "Validation Error" } }, - "summary": "Test Compaction Prompt", + "summary": "Create Experiment", "tags": [ - "memory_banks" + "models" ] } }, - "/models/alerts": { + "/models/playground/experiments/{experiment_id}": { "get": { - "description": "List model lifecycle alerts for the account.\n\nReturns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account.", - "operationId": "list_alerts_api_models_alerts_get", + "description": "Get details and results for a specific model playground experiment.\n\nReturns the full experiment payload including prompt, model outputs, and evaluation results (if available).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account.", + "operationId": "get_experiment_api_models_playground_experiments__experiment_id__get", "parameters": [ { - "description": "Filter alerts to a specific agent UUID.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter alerts to a specific agent UUID.", - "title": "Agent Id" - } - }, - { - "description": "When true, only return unread alerts.", - "in": "query", - "name": "unread_only", - "required": false, - "schema": { - "default": false, - "description": "When true, only return unread alerts.", - "title": "Unread Only", - "type": "boolean" - } - }, - { - "description": "Maximum number of alerts to return (1-100).", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Maximum number of alerts to return (1-100).", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, + "in": "path", + "name": "experiment_id", + "required": true, "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" + "format": "uuid", + "title": "Experiment Id", + "type": "string" } }, { @@ -12398,7 +13643,7 @@ "application/json": { "schema": { "additionalProperties": true, - "title": "Response List Alerts Api Models Alerts Get", + "title": "Response Get Experiment Api Models Playground Experiments Experiment Id Get", "type": "object" } } @@ -12416,37 +13661,27 @@ "description": "Validation Error" } }, - "summary": "List Alerts", + "summary": "Get Experiment", "tags": [ "models" ] } }, - "/models/alerts/mark-all-read": { + "/models/playground/experiments/{experiment_id}/cancel": { "post": { - "description": "Mark all model lifecycle alerts as read for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account.", - "operationId": "mark_all_read_api_models_alerts_mark_all_read_post", + "description": "Cancel a running or pending model playground experiment.\n\nSignals running model calls to abort and marks the experiment as canceled.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account.", + "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", "parameters": [ { - "$ref": "#/components/parameters/X-Account-Id" - } - ], - "responses": { - "204": { - "description": "Successful Response" - } - }, - "summary": "Mark All Read", - "tags": [ - "models" - ] - } - }, - "/models/alerts/unread-count": { - "get": { - "description": "Get the count of unread model lifecycle alerts.\n\nUseful for badge indicators in UIs and dashboards.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account.", - "operationId": "get_alert_unread_count_api_models_alerts_unread_count_get", - "parameters": [ + "in": "path", + "name": "experiment_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Experiment Id", + "type": "string" + } + }, { "$ref": "#/components/parameters/X-Account-Id" } @@ -12457,32 +13692,41 @@ "application/json": { "schema": { "additionalProperties": true, - "title": "Response Get Alert Unread Count Api Models Alerts Unread Count Get", + "title": "Response Cancel Experiment Endpoint Api Models Playground Experiments Experiment Id Cancel Post", "type": "object" } } }, "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" } }, - "summary": "Get Alert Unread Count", + "summary": "Cancel Experiment Endpoint", "tags": [ "models" ] } }, - "/models/alerts/{alert_id}/read": { - "patch": { - "description": "Mark a single model lifecycle alert as read (dismissed).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account.", - "operationId": "mark_read_api_models_alerts__alert_id__read_patch", + "/models/{model_id}/details": { + "get": { + "description": "Get detailed information about a specific model.\n\nReturns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nThe `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6').\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", + "operationId": "get_model_api_models__model_id__details_get", "parameters": [ { "in": "path", - "name": "alert_id", + "name": "model_id", "required": true, "schema": { - "format": "uuid", - "title": "Alert Id", + "title": "Model Id", "type": "string" } }, @@ -12491,7 +13735,14 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" + } + } + }, "description": "Successful Response" }, "422": { @@ -12505,7 +13756,7 @@ "description": "Validation Error" } }, - "summary": "Mark Read", + "summary": "Get Model", "tags": [ "models" ] @@ -13817,7 +15068,7 @@ }, "/sources": { "post": { - "description": "Create a new content source.\n\nSource types: `rss`, `website`, `file_uploads`, `custom_index`.\n\nFor RSS and website sources, provide the URL. For file upload and custom index sources, the URL is created automatically.", + "description": "Create a new content source.\n\nSource types: `rss`, `website`, `custom_index`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", "operationId": "create_source_api_sources_post", "parameters": [ { @@ -13846,6 +15097,18 @@ "description": "Successful Response" }, "402": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "detail": { + "type": "object" + } + } + } + } + }, "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." }, "422": { @@ -13867,7 +15130,7 @@ }, "/sources/": { "get": { - "description": "List content sources for your account.\n\nA *source* is where Seclai pulls or receives content from (for example RSS feeds, websites, file uploads, or custom indexes). Sources are the inputs that power your agents and knowledge base workflows.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.\n- The optional `account_id` query param is only allowed when it matches the caller's account.", + "description": "List content sources for your account.\n\nA *source* is where Seclai pulls or receives content from \u2014 RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``).\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.\n- The optional `account_id` query param is only allowed when it matches the caller's account.", "operationId": "list_sources_api_sources__get", "parameters": [ { @@ -14728,7 +15991,7 @@ }, "/sources/{source_connection_id}/upload": { "post": { - "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/msword`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.", + "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes.\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.", "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", "parameters": [ { diff --git a/src/client.ts b/src/client.ts index 6891ffe..349b7ac 100644 --- a/src/client.ts +++ b/src/client.ts @@ -89,6 +89,10 @@ import type { MemoryBankResponse, NonManualEvaluationSummaryResponse, OrganizationAlertPreferenceListResponse, + PlaygroundCreateRequest, + CreateExperimentInput, + PromptModelResponse, + ProviderGroupResponse, SolutionConversationResponse, SolutionListResponse, SolutionResponse, @@ -2307,6 +2311,68 @@ export class Seclai { return await this.request("GET", `/models/${modelId}/recommendations`); } + /** + * List all enabled LLM models grouped by provider. + * + * @param opts - Optional filters. + */ + async listModels(opts: { provider?: string; supportsToolUse?: boolean; supportsThinking?: boolean } = {}): Promise { + return (await this.request("GET", "/models", { + query: { provider: opts.provider, supports_tool_use: opts.supportsToolUse, supports_thinking: opts.supportsThinking }, + })) as ProviderGroupResponse[]; + } + + /** + * Get full details for a specific model. + * + * @param modelId - Model identifier. + */ + async getModel(modelId: string): Promise { + return (await this.request("GET", `/models/${modelId}/details`)) as PromptModelResponse; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Model Playground Experiments + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * List model playground experiments. + * + * @param opts - Optional filters and pagination. + */ + async listExperiments(opts: { days?: number; startDate?: string; endDate?: string; limit?: number; offset?: number } = {}): Promise { + return await this.request("GET", "/models/playground/experiments", { + query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }, + }); + } + + /** + * Create a model playground experiment. + * + * @param body - Experiment configuration. + */ + async createExperiment(body: CreateExperimentInput): Promise { + return await this.request("POST", "/models/playground/experiments", { json: body }); + } + + /** + * Get a model playground experiment by ID. + * + * @param experimentId - Experiment identifier. + */ + async getExperiment(experimentId: string): Promise { + return await this.request("GET", `/models/playground/experiments/${experimentId}`); + } + + /** + * Cancel a running model playground experiment. + * + * @param experimentId - Experiment identifier. + */ + async cancelExperiment(experimentId: string): Promise { + return await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`); + } + // ═══════════════════════════════════════════════════════════════════════════ // Search // ═══════════════════════════════════════════════════════════════════════════ diff --git a/src/index.ts b/src/index.ts index ac90997..01d1a7e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -220,6 +220,16 @@ export type { // Models PromptModelAutoUpgradeStrategy, + ProviderGroupResponse, + PromptModelResponse, + PromptToolResponse, + VariantCategoryResponse, + VariantOptionResponse, + PlaygroundCreateRequest, + CreateExperimentInput, + + // Sources (enums) + SourceIndexMode, // Enums PendingProcessingCompletedFailedStatus, diff --git a/src/openapi.ts b/src/openapi.ts index de32b6e..33d782e 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -407,7 +407,7 @@ export interface paths { * - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) * - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`) * - `insight`: Progressively read and analyze large input - * - `extract_json` / `extract_html` / `extract_xml`: Extract structured data + * - `extract_content`: Extract structured data (JSON, HTML, XML) * - `send_email`: Send email with step output * - `webhook_call`: POST data to an external URL * - `write_aws_s3_object`: Write output to S3 @@ -416,6 +416,7 @@ export interface paths { * - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`) * - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`) * - `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional) + * - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` trigger; `priority: true` enables real-time streaming) * - `display_result`: Show output to the user * - `join`: Merge parallel branches * - `combinator`: Combine multiple inputs @@ -431,7 +432,7 @@ export interface paths { * * Uses **optimistic locking**: provide `expected_change_id` from the last `GET /api/agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read. * - * The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `transform`, `gate`, `retry`, `evaluate_step`, `insight`, `extract_json`, `extract_html`, `extract_xml`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `combinator`, and `text`. Non-composite step types (`display_result`, `join`, `retry`, `evaluate_step`) cannot contain child steps. + * The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `transform`, `gate`, `retry`, `evaluate_step`, `insight`, `extract_content`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `combinator`, and `text`. Non-composite step types (`display_result`, `join`, `retry`, `evaluate_step`, `streaming_result`) cannot contain child steps. * * **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step before the retry to make retries conditional. * @@ -573,9 +574,7 @@ export interface paths { * - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download. * * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - When using OAuth, you may target a different organization account with `X-Account-Id`; for API keys, the key's account is always used. - * - You can only export agents belonging to the resolved account. + * - Requires `X-API-Key`. You can only export agents belonging to your account. */ get: operations["export_agent_api_agents__agent_id__export_get"]; put?: never; @@ -647,7 +646,7 @@ export interface paths { * Key fields: * - `input`: text input for agents with a `dynamic_input` trigger. * - `input_upload_id`: alternatively, reference a file previously uploaded via `POST /agents/{agent_id}/upload-input` (mutually exclusive with `input`). - * - `priority`: set true for latency-sensitive, user-facing work. + * - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming. * - `metadata`: a JSON object that becomes available to agent steps for string substitution. * * After starting: @@ -682,6 +681,7 @@ export interface paths { * How it works: * - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. * - Subsequent events are forwarded from the run event stream (status changes, step events, etc). + * - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. * - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). * * Input options (for `dynamic_input` triggers): @@ -1336,7 +1336,6 @@ export interface paths { * **Supported MIME types:** * - `application/epub+zip` * - `application/json` - * - `application/msword` * - `application/pdf` * - `application/vnd.ms-excel` * - `application/vnd.ms-outlook` @@ -1834,6 +1833,36 @@ export interface paths { patch?: never; trace?: never; }; + "/models": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List Models + * @description List all enabled LLM models with full details. + * + * Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + * + * Optional query parameters: + * - `provider`: filter by provider (e.g. 'anthropic', 'openai') + * - `supports_tool_use`: filter to models with tool calling support + * - `supports_thinking`: filter to models with extended thinking support + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. + */ + get: operations["list_models_api_models_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/models/alerts": { parameters: { query?: never; @@ -1930,6 +1959,117 @@ export interface paths { patch: operations["mark_read_api_models_alerts__alert_id__read_patch"]; trace?: never; }; + "/models/playground/experiments": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List Experiments + * @description List model playground experiments for the account. + * + * Returns a paginated, time-filtered list of experiments ordered by creation date descending. + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account. + */ + get: operations["list_experiments_api_models_playground_experiments_get"]; + put?: never; + /** + * Create Experiment + * @description Create and schedule a model playground experiment. + * + * Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge. + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. + */ + post: operations["create_experiment_api_models_playground_experiments_post"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/models/playground/experiments/{experiment_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get Experiment + * @description Get details and results for a specific model playground experiment. + * + * Returns the full experiment payload including prompt, model outputs, and evaluation results (if available). + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account. + */ + get: operations["get_experiment_api_models_playground_experiments__experiment_id__get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/models/playground/experiments/{experiment_id}/cancel": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Cancel Experiment Endpoint + * @description Cancel a running or pending model playground experiment. + * + * Signals running model calls to abort and marks the experiment as canceled. + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account. + */ + post: operations["cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/models/{model_id}/details": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get Model + * @description Get detailed information about a specific model. + * + * Returns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. + * + * The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). + * + * Auth & scoping: + * - Requires `X-API-Key` header or OAuth Bearer token. + */ + get: operations["get_model_api_models__model_id__details_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/models/{model_id}/recommendations": { parameters: { query?: never; @@ -2304,9 +2444,11 @@ export interface paths { * Create Source * @description Create a new content source. * - * Source types: `rss`, `website`, `file_uploads`, `custom_index`. + * Source types: `rss`, `website`, `custom_index`. + * + * For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. * - * For RSS and website sources, provide the URL. For file upload and custom index sources, the URL is created automatically. + * For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. */ post: operations["create_source_api_sources_post"]; delete?: never; @@ -2326,7 +2468,7 @@ export interface paths { * List sources * @description List content sources for your account. * - * A *source* is where Seclai pulls or receives content from (for example RSS feeds, websites, file uploads, or custom indexes). Sources are the inputs that power your agents and knowledge base workflows. + * A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). * * Parameters: * - Pagination: `page` and `limit`. @@ -2583,7 +2725,6 @@ export interface paths { * **Supported MIME types:** * - `application/epub+zip` * - `application/json` - * - `application/msword` * - `application/pdf` * - `application/vnd.ms-excel` * - `application/vnd.ms-outlook` @@ -2663,7 +2804,7 @@ export interface components { change_id: string; /** * Definition - * @description The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, transform, gate, retry, evaluate_step, insight, extract_json, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, and others. + * @description The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, transform, gate, retry, evaluate_step, insight, extract_content, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, and others. */ definition: { [key: string]: unknown; @@ -3679,6 +3820,8 @@ export interface components { * @description Embedding model override. */ embedding_model?: string | null; + /** @description Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom. */ + index_mode?: components["schemas"]["SourceIndexMode"] | null; /** * Name * @description Source name. @@ -3706,7 +3849,7 @@ export interface components { retention?: number | null; /** * Source Type - * @description Source type: rss, website, file_uploads, or custom_index. + * @description Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index. */ source_type: string; /** @@ -4666,11 +4809,96 @@ export interface components { * @enum {string} */ PendingProcessingCompletedFailedStatus: "pending" | "processing" | "completed" | "failed"; + /** + * PlaygroundCreateRequest + * @description Create a model playground experiment via the public API. + */ + PlaygroundCreateRequest: { + /** + * Evaluation Complexity + * @description simple, medium, or complex + * @default medium + * @enum {string} + */ + evaluation_complexity: "simple" | "medium" | "complex"; + /** + * Evaluation Mode + * @description manual or prompt + * @default manual + * @enum {string} + */ + evaluation_mode: "manual" | "prompt"; + /** + * Evaluator Model Id + * @description Evaluator model ID when evaluation_mode is prompt. + */ + evaluator_model_id?: string | null; + /** + * Include Step Output In Evaluation + * @description Whether to include selected step output as evaluator context. + * @default false + */ + include_step_output_in_evaluation: boolean; + /** + * Json Template + * @description Optional JSON template for advanced mode. + */ + json_template?: string | null; + /** + * Model Ids + * @description Selected model IDs (1-10). + */ + model_ids: string[]; + /** + * Prompt + * @description Prompt text for the experiment. + */ + prompt: string; + /** + * Selected Step Output + * @description Optional step output text for evaluator context. + */ + selected_step_output?: string | null; + /** + * System Prompt + * @description Optional system prompt. + * @default + */ + system_prompt: string; + }; /** * PromptModelAutoUpgradeStrategy * @enum {string} */ PromptModelAutoUpgradeStrategy: "none" | "early_adopter" | "middle_of_road" | "cautious_adopter"; + /** + * PromptToolResponse + * @description Response model for a prompt tool. + */ + PromptToolResponse: { + /** Description */ + description?: string | null; + /** Documentation Url */ + documentation_url?: string | null; + /** Example */ + example?: string | null; + /** Headers */ + headers?: { + [key: string]: string; + } | null; + /** Id */ + id: string; + /** Name */ + name: string; + /** Notes */ + notes?: string | null; + /** Tool Name */ + tool_name?: string | null; + /** Tool Type */ + tool_type: string; + /** Tool Type Pattern */ + tool_type_pattern?: string | null; + }; /** * ProposedActionResponse * @description A single proposed action. @@ -4858,6 +5086,22 @@ export interface components { /** Updated At */ updated_at: string; }; + /** + * SourceIndexMode + * @description Embedding quality / cost trade-off preset for custom_index sources. + * + * Each preset controls the default embedding dimensions, chunk size, and + * chunk overlap. The embedding model is always the account-level default + * (currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``). + * + * Presets: + * FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap. + * BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap. + * SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap. + * CUSTOM: Caller supplies embedding model, dimensions, and chunk config. + * @enum {string} + */ + SourceIndexMode: "fast_and_cheap" | "balanced" | "slow_and_thorough" | "custom"; /** * SourceResponse * @description Response model for source data. @@ -4951,6 +5195,8 @@ export interface components { * @description Unique identifier for the source connection. */ id: string; + /** @description Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom. */ + index_mode?: components["schemas"]["SourceIndexMode"] | null; /** * Name * @description Name of the source connection. @@ -5425,6 +5671,54 @@ export interface components { /** Error Type */ type: string; }; + /** + * VariantCategoryResponse + * @description Response model for a variant category + */ + VariantCategoryResponse: { + /** Category */ + category: string; + /** Configurable */ + configurable: boolean; + /** Description */ + description: string; + /** Options */ + options: components["schemas"]["VariantOptionResponse"][]; + /** Title */ + title: string; + }; + /** + * VariantOptionResponse + * @description Response model for a variant option + */ + VariantOptionResponse: { + /** Default */ + default: boolean; + /** Description */ + description?: string | null; + /** Input 1H Cache Write Credits Per 1000 Tokens */ + input_1h_cache_write_credits_per_1000_tokens?: number | null; + /** Input 5M Cache Write Credits Per 1000 Tokens */ + input_5m_cache_write_credits_per_1000_tokens?: number | null; + /** Input Cache Hit Credits Per 1000 Tokens */ + input_cache_hit_credits_per_1000_tokens?: number | null; + /** Input Credits Per 1000 Tokens */ + input_credits_per_1000_tokens?: number | null; + /** Long Context Input Cache Hit Credits Per 1000 Tokens */ + long_context_input_cache_hit_credits_per_1000_tokens?: number | null; + /** Long Context Input Credits Per 1000 Tokens */ + long_context_input_credits_per_1000_tokens?: number | null; + /** Long Context Output Credits Per 1000 Tokens */ + long_context_output_credits_per_1000_tokens?: number | null; + /** Long Context Threshold */ + long_context_threshold?: number | null; + /** Output Credits Per 1000 Tokens */ + output_credits_per_1000_tokens?: number | null; + /** Title */ + title: string; + /** Value */ + value: string; + }; /** AgentListResponse */ routers__api__agents__AgentListResponse: { /** @@ -6323,6 +6617,135 @@ export interface components { data: components["schemas"]["SourceResponse"][]; pagination: components["schemas"]["PaginationResponse"]; }; + /** + * PromptModelResponse + * @description Response model for prompt model data + */ + schemas__model_responses__PromptModelResponse: { + /** Default */ + default: boolean; + /** Deprecated At */ + deprecated_at?: string | null; + /** Description */ + description: string; + /** Enabled */ + enabled: boolean; + /** Family */ + family?: string | null; + /** Family Generation */ + family_generation?: number | null; + /** Id */ + id: string; + /** Input 1H Cache Write Credits Per 1000 Tokens */ + input_1h_cache_write_credits_per_1000_tokens?: number | null; + /** Input 5M Cache Write Credits Per 1000 Tokens */ + input_5m_cache_write_credits_per_1000_tokens?: number | null; + /** Input Cache Hit Credits Per 1000 Tokens */ + input_cache_hit_credits_per_1000_tokens?: number | null; + /** Input Credits Per 1000 Tokens */ + input_credits_per_1000_tokens?: number | null; + /** + * Is New + * @default false + */ + is_new: boolean; + /** + * Last Used + * @default false + */ + last_used: boolean; + /** Max Context Tokens */ + max_context_tokens: number; + /** Max Conversation Length */ + max_conversation_length: number; + /** Max Output Tokens */ + max_output_tokens: number; + /** Model Id */ + model_id: string; + /** Name */ + name: string; + /** Output Credits Per 1000 Tokens */ + output_credits_per_1000_tokens?: number | null; + /** + * Payload Schema + * @description Model-specific JSON schema for advanced prompt_call json_template payloads. + */ + payload_schema?: { + [key: string]: unknown; + } | null; + /** + * Payload Schema Source Url + * @description Source URL used to derive payload_schema guidance for this model. + */ + payload_schema_source_url?: string | null; + /** Provider */ + provider: string; + /** Released At */ + released_at?: string | null; + /** + * Schema Documentation Url + * @description Model documentation URL with request/response payload details. + */ + schema_documentation_url?: string | null; + /** + * Schema Notes + * @description Human-readable notes about request payload compatibility. + */ + schema_notes?: string | null; + /** Successor Model Id */ + successor_model_id?: string | null; + /** Sunset At */ + sunset_at?: string | null; + /** Supported Input Media */ + supported_input_media?: string[] | null; + /** Supported Languages */ + supported_languages?: string[] | null; + /** + * Supports Openai Arguments + * @default false + */ + supports_openai_arguments: boolean; + /** + * Supports Streaming + * @default false + */ + supports_streaming: boolean; + /** + * Supports Structured Output + * @default true + */ + supports_structured_output: boolean; + /** + * Supports Thinking + * @default false + */ + supports_thinking: boolean; + /** + * Supports Tool Use + * @default true + */ + supports_tool_use: boolean; + /** Tools Disabled */ + tools_disabled?: components["schemas"]["PromptToolResponse"][]; + /** Tools Enabled */ + tools_enabled?: components["schemas"]["PromptToolResponse"][]; + /** Training Cutoff At */ + training_cutoff_at?: string | null; + /** Url */ + url?: string | null; + /** Variants */ + variants?: components["schemas"]["VariantCategoryResponse"][] | null; + }; + /** + * ProviderGroupResponse + * @description Response model for provider group with models + */ + schemas__model_responses__ProviderGroupResponse: { + /** Models */ + models: components["schemas"]["schemas__model_responses__PromptModelResponse"][]; + /** Provider */ + provider: string; + }; /** * NonManualEvaluationModeStatResponse * @description Per-mode rollup for evaluation activity. @@ -6442,7 +6865,11 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: Record; + }; + }; }; /** @description Validation Error */ 422: { @@ -7522,6 +7949,21 @@ export interface operations { "application/json": components["schemas"]["AgentRunResponse"]; }; }; + /** @description Insufficient credits — the account has exhausted its credits. The response body is `{"detail": {"error": "insufficient_credits", "message": ..., "account_id": ...}}`. */ + 402: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + detail?: { + error?: string; + message?: string; + account_id?: string; + }; + }; + }; + }; /** @description Validation Error */ 422: { headers: { @@ -7578,6 +8020,21 @@ export interface operations { "text/event-stream": string; }; }; + /** @description Insufficient credits — the account has exhausted its credits. The response body is `{"detail": {"error": "insufficient_credits", "message": ..., "account_id": ...}}`. */ + 402: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + detail?: { + error?: string; + message?: string; + account_id?: string; + }; + }; + }; + }; /** @description Validation Error */ 422: { headers: { @@ -8924,7 +9381,11 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: Record; + }; + }; }; /** @description Validation Error */ 422: { @@ -9610,6 +10071,45 @@ export interface operations { }; }; }; + list_models_api_models_get: { + parameters: { + query?: { + /** @description Filter by provider name */ + provider?: string | null; + /** @description Filter to models that support tool use */ + supports_tool_use?: boolean | null; + /** @description Filter to models that support extended thinking */ + supports_thinking?: boolean | null; + }; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["schemas__model_responses__ProviderGroupResponse"][]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; list_alerts_api_models_alerts_get: { parameters: { query?: { @@ -9731,6 +10231,195 @@ export interface operations { }; }; }; + list_experiments_api_models_playground_experiments_get: { + parameters: { + query?: { + /** @description Look-back window in days. */ + days?: number; + /** @description Explicit start date (overrides days). */ + start_date?: string | null; + /** @description Explicit end date (overrides days). */ + end_date?: string | null; + /** @description Page size. */ + limit?: number; + /** @description Pagination offset. */ + offset?: number; + }; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: unknown; + }; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + create_experiment_api_models_playground_experiments_post: { + parameters: { + query?: never; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["PlaygroundCreateRequest"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: unknown; + }; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + get_experiment_api_models_playground_experiments__experiment_id__get: { + parameters: { + query?: never; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path: { + experiment_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: unknown; + }; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post: { + parameters: { + query?: never; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path: { + experiment_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: unknown; + }; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + get_model_api_models__model_id__details_get: { + parameters: { + query?: never; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + }; + path: { + model_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["schemas__model_responses__PromptModelResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; get_recommendations_api_models__model_id__recommendations_get: { parameters: { query?: { @@ -10555,7 +11244,11 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: Record; + }; + }; }; /** @description Validation Error */ 422: { diff --git a/src/types.ts b/src/types.ts index e9669e5..f884389 100644 --- a/src/types.ts +++ b/src/types.ts @@ -414,6 +414,38 @@ export type AiAssistantFeedbackResponse = components["schemas"]["AiAssistantFeed /** Prompt model auto-upgrade strategy. */ export type PromptModelAutoUpgradeStrategy = components["schemas"]["PromptModelAutoUpgradeStrategy"]; +/** Models grouped by provider. */ +export type ProviderGroupResponse = components["schemas"]["schemas__model_responses__ProviderGroupResponse"]; + +/** Full model details including capabilities, pricing, and lifecycle status. */ +export type PromptModelResponse = components["schemas"]["schemas__model_responses__PromptModelResponse"]; + +/** Prompt tool configuration within a model. */ +export type PromptToolResponse = components["schemas"]["PromptToolResponse"]; + +/** Variant category for model pricing tiers. */ +export type VariantCategoryResponse = components["schemas"]["VariantCategoryResponse"]; + +/** Variant option with credit pricing and context limits. */ +export type VariantOptionResponse = components["schemas"]["VariantOptionResponse"]; + +/** Request body for creating a model playground experiment. */ +export type PlaygroundCreateRequest = components["schemas"]["PlaygroundCreateRequest"]; + +/** + * Input type for {@link SeclaiClient.createExperiment}. + * + * Only `model_ids` and `prompt` are required — every other field has a + * server-side default and can be omitted. + */ +export type CreateExperimentInput = Pick & + Partial>; + +// ─── Sources (enums) ───────────────────────────────────────────────────────── + +/** Source index mode: fast_and_cheap, balanced, slow_and_thorough, or custom. */ +export type SourceIndexMode = components["schemas"]["SourceIndexMode"]; + // ─── Enums ─────────────────────────────────────────────────────────────────── /** Processing status: pending, processing, completed, or failed. */