From 038861ab1de399efa0cea711060c02eed47a8bd0 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 1 Apr 2026 21:26:36 -0700 Subject: [PATCH 1/4] Added support for exporting agent definitions --- .github/copilot-instructions.md | 23 ++- openapi/seclai.openapi.json | 179 ++++++++++++++++++ src/client.ts | 18 ++ src/index.ts | 1 + src/openapi.ts | 326 +++++++++++++++++++++++--------- src/types.ts | 3 + 6 files changed, 459 insertions(+), 91 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b285eb6..5df7eed 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,12 +7,33 @@ npm run build # tsup — produces CJS, ESM, and DTS bundles npm test # vitest ``` +## Quality gates (must pass to report completion) + +- **ALL tests must pass with ZERO failures. No exceptions.** CI/CD runs the full test suite on every PR. A test failure blocks the build. +- **`npm run build` must succeed with ZERO errors.** The DTS build is strict — type errors in `.d.ts` generation will fail the build even if runtime JS works fine. +- **Do not dismiss test or build failures as pre-existing or unrelated.** The `main` branch CI/CD is green. Any failure on a feature branch was caused by changes on that branch. +- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a type, build, or test error appears, **fix it immediately**. Do NOT run `git diff`, `git log`, `git show`, `git blame`, or any other command to determine whether the error is "pre-existing" or "from our changes". There is no scenario where knowing the origin of an error changes what you must do: **fix it**. +- **CRITICAL — NEVER PIPE TEST OR BUILD OUTPUT**: Do not append `| tail`, `| head`, `| grep`, or any pipe to `npm test`, `npm run build`, or similar commands. Piping hides errors. Always run with full unfiltered output. + ## Key Rules - After ANY change to `openapi/seclai.openapi.json`, run `npm run generate` to regenerate `src/openapi.ts`. Forgetting this causes type errors in the DTS build. - `src/types.ts` maps user-facing type aliases to `components["schemas"][...]`. Schema names can change between API versions (e.g. `routers__api__*__` prefixes may be added or removed). Verify names against `src/openapi.ts` after regeneration. - `tsconfig.json` uses `exactOptionalPropertyTypes: true` — optional properties must use `prop?: T | undefined`, not just `prop?: T`. -- The DTS build is strict — type errors in `.d.ts` generation will fail the build even if runtime JS works fine. - The OpenAPI spec here is NOT identical to `seclai-go`/`seclai-python` (different version baseline). Apply equivalent description changes separately. - `writeSsoCache` uses atomic rename; on Windows, must `fs.unlink` the destination before `fs.rename`. - Auth: streaming methods must use resolved auth headers, not `this.apiKey` directly. +- Do not run ad-hoc scripts; add tests instead. + +## Git rules + +- **NEVER use `git stash`.** Use `git diff`, `git log`, or `git show` instead. +- Do not run `git checkout` to switch branches, `git reset`, or any other destructive git operation without explicit user approval. + +## Editing rules + +- Do not use CLI text tools (sed/awk). Use the editor-based patch tool. + +## Self-correction rules + +- **NEVER promise to "do better" without updating these instruction files.** If a recurring mistake is identified, edit this file with a concrete rule that prevents the mistake. Do that FIRST, then continue work. diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index a20fe19..68b3863 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -107,6 +107,114 @@ "title": "AgentEvaluationTier", "type": "string" }, + "AgentExportResponse": { + "description": "Portable JSON snapshot of an agent definition.", + "properties": { + "agent": { + "additionalProperties": true, + "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at.", + "title": "Agent", + "type": "object" + }, + "alert_configs": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Alert configurations.", + "title": "Alert Configs" + }, + "dependencies": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users \u2014 each a list of {id, name, description, \u2026}.", + "title": "Dependencies" + }, + "evaluation_criteria": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Evaluation criteria for agent steps.", + "title": "Evaluation Criteria" + }, + "export_version": { + "description": "Schema version of the export format (currently \"2\").", + "title": "Export Version", + "type": "string" + }, + "exported_at": { + "description": "ISO-8601 timestamp of when the export was generated.", + "title": "Exported At", + "type": "string" + }, + "governance_policies": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Agent-scoped governance policies.", + "title": "Governance Policies" + }, + "software_version": { + "description": "Application version that produced this export.", + "title": "Software Version", + "type": "string" + }, + "trigger": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Trigger configuration with schedules.", + "title": "Trigger" + } + }, + "required": [ + "export_version", + "exported_at", + "software_version", + "agent" + ], + "title": "AgentExportResponse", + "type": "object" + }, "AgentRunAttemptResponse": { "properties": { "duration": { @@ -354,6 +462,18 @@ "description": "Timestamp when the step attempt ended.", "title": "Ended At" }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Input provided to the step, if any.", + "title": "Input" + }, "output": { "anyOf": [ { @@ -404,6 +524,7 @@ "agent_step_id", "step_type", "status", + "input", "output", "output_content_type", "started_at", @@ -8871,6 +8992,64 @@ ] } }, + "/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`. You can only export agents belonging to your account.", + "operationId": "export_agent_api_agents__agent_id__export_get", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + }, + { + "description": "Return as file download", + "in": "query", + "name": "download", + "required": false, + "schema": { + "default": true, + "description": "Return as file download", + "title": "Download", + "type": "boolean" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentExportResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Export agent definition", + "tags": [ + "agents" + ] + } + }, "/agents/{agent_id}/input-uploads/{upload_id}": { "get": { "description": "Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`.\n\nPossible `status` values: `processing`, `ready`, `failed`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", diff --git a/src/client.ts b/src/client.ts index eb1b9c1..6891ffe 100644 --- a/src/client.ts +++ b/src/client.ts @@ -20,6 +20,7 @@ import { resolveCredentialChain, resolveAuthHeaders } from "./auth"; import type { AgentRunEvent, AgentDefinitionResponse, + AgentExportResponse, AgentListResponse, AgentRunListResponse, AgentRunRequest, @@ -682,6 +683,23 @@ export class Seclai { await this.request("DELETE", `/agents/${agentId}`); } + // ═══════════════════════════════════════════════════════════════════════════ + // Agent Export + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Export an agent definition as a portable JSON snapshot. + * + * @param agentId - Agent identifier. + * @param download - When true (default), the server sets Content-Disposition: attachment. + * @returns The exported agent snapshot. + */ + async exportAgent(agentId: string, download = true): Promise { + return (await this.request("GET", `/agents/${agentId}/export`, { + query: { download }, + })) as AgentExportResponse; + } + // ═══════════════════════════════════════════════════════════════════════════ // Agent Definitions // ═══════════════════════════════════════════════════════════════════════════ diff --git a/src/index.ts b/src/index.ts index 9914cb9..ac90997 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,6 +72,7 @@ export type { // Agents AgentListResponse, AgentDefinitionResponse, + AgentExportResponse, AgentSummaryResponse, CreateAgentRequest, UpdateAgentRequest, diff --git a/src/openapi.ts b/src/openapi.ts index 96504b6..53e1c16 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -16,7 +16,7 @@ export interface paths { * @description List agents for the account with pagination. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ get: operations["list_agents_api_agents_get"]; put?: never; @@ -33,7 +33,7 @@ export interface paths { * Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` * * Auth & scoping: - * - Requires authentication (API key or bearer token). Agent is created in the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. */ post: operations["create_agent_api_agents_post"]; delete?: never; @@ -199,7 +199,7 @@ export interface paths { * Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed. * * Auth & scoping: - * - Requires authentication (API key or bearer token). Searches only within your account's traces. + * - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. */ post: operations["search_agent_runs_api_agents_runs_search_post"]; delete?: never; @@ -222,7 +222,7 @@ export interface paths { * The response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access runs belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account. */ get: operations["get_agent_run_api_agents_runs__run_id__get"]; put?: never; @@ -234,7 +234,7 @@ export interface paths { * If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only cancel runs belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account. */ delete: operations["delete_agent_run_api_agents_runs__run_id__delete"]; options?: never; @@ -254,7 +254,7 @@ export interface paths { * @description Fetch an agent's metadata (name, description, trigger type, timestamps). * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access agents belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. */ get: operations["get_agent_metadata_api_agents__agent_id__get"]; /** @@ -268,7 +268,7 @@ export interface paths { * At least one field must be provided. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only update agents belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. */ put: operations["update_agent_api_agents__agent_id__put"]; post?: never; @@ -277,7 +277,7 @@ export interface paths { * @description Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only delete agents belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account. */ delete: operations["delete_agent_api_agents__agent_id__delete"]; options?: never; @@ -299,7 +299,7 @@ export interface paths { * Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance. * * Auth & scoping: - * - Requires a user-scoped `X-API-Key`. Only agents belonging to your account can be queried. + * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried. */ get: operations["get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get"]; put?: never; @@ -327,7 +327,7 @@ export interface paths { * Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. * * Auth & scoping: - * - Requires a user-scoped `X-API-Key`. Only agents belonging to your account can be used. + * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. */ post: operations["generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post"]; delete?: never; @@ -352,7 +352,7 @@ export interface paths { * Provide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint. * * Auth & scoping: - * - Requires a user-scoped `X-API-Key`. Only agents belonging to your account can be used. + * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. */ post: operations["generate_step_config_api_agents__agent_id__ai_assistant_step_config_post"]; delete?: never; @@ -381,7 +381,7 @@ export interface paths { * This only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately. * * Auth & scoping: - * - Requires a user-scoped `X-API-Key`. The conversation must belong to one of your agents. + * - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents. */ patch: operations["mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch"]; trace?: never; @@ -422,7 +422,7 @@ export interface paths { * - `text`: Static text literal * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access agents belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. */ get: operations["get_agent_definition_api_agents__agent_id__definition_get"]; /** @@ -436,7 +436,7 @@ export interface paths { * **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. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only update agents belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. */ put: operations["update_agent_definition_api_agents__agent_id__definition_put"]; post?: never; @@ -546,6 +546,44 @@ export interface paths { patch?: never; trace?: never; }; + "/agents/{agent_id}/export": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Export agent definition + * @description Export an agent definition as a portable JSON snapshot. + * + * The 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. + * + * Response shape: + * - `export_version`: schema version (currently `"2"`) + * - `exported_at`: ISO-8601 timestamp + * - `agent`: name, description, schema_version, definition, timestamps + * - `trigger`: trigger type, input template, schedules + * - `alert_configs`: alert type, thresholds, recipients + * - `evaluation_criteria`: evaluation settings per step + * - `governance_policies`: agent-scoped governance policies + * - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users + * + * Query params: + * - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download. + * + * Auth & scoping: + * - 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; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/agents/{agent_id}/input-uploads/{upload_id}": { parameters: { query?: never; @@ -560,7 +598,7 @@ export interface paths { * Possible `status` values: `processing`, `ready`, `failed`. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ get: operations["api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get"]; put?: never; @@ -590,7 +628,7 @@ export interface paths { * - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only list runs for agents in your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account. */ get: operations["list_agent_runs_api_agents__agent_id__runs_get"]; put?: never; @@ -615,7 +653,7 @@ export interface paths { * - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ post: operations["run_agent_api_agents__agent_id__runs_post"]; delete?: never; @@ -653,7 +691,7 @@ export interface paths { * - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ post: operations["run_streaming_agent_api_agents__agent_id__runs_stream_post"]; delete?: never; @@ -707,7 +745,7 @@ export interface paths { * After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ post: operations["api_upload_agent_input_api_agents__agent_id__upload_input_post"]; delete?: never; @@ -729,7 +767,7 @@ export interface paths { * Submit AI assistant feedback * @description Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_feedback_api_ai_assistant_feedback_post"]; delete?: never; @@ -751,7 +789,7 @@ export interface paths { * Generate a knowledge base plan (standalone) * @description Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_knowledge_base_api_ai_assistant_knowledge_base_post"]; delete?: never; @@ -773,7 +811,7 @@ export interface paths { * Generate a memory bank configuration (standalone) * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_memory_bank_api_ai_assistant_memory_bank_post"]; delete?: never; @@ -793,7 +831,7 @@ export interface paths { * Fetch memory bank AI conversation history * @description Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ get: operations["api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get"]; put?: never; @@ -821,7 +859,7 @@ export interface paths { * Accept or decline a memory bank AI suggestion * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ patch: operations["api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch"]; trace?: never; @@ -839,7 +877,7 @@ export interface paths { * Generate a solution plan (standalone) * @description Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_solution_api_ai_assistant_solution_post"]; delete?: never; @@ -861,7 +899,7 @@ export interface paths { * Generate a source plan (standalone) * @description Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_source_api_ai_assistant_source_post"]; delete?: never; @@ -883,7 +921,7 @@ export interface paths { * Accept and execute a standalone plan * @description Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_accept_api_ai_assistant__conversation_id__accept_post"]; delete?: never; @@ -905,7 +943,7 @@ export interface paths { * Decline a standalone plan * @description Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined. * - * Auth: requires ``X-API-Key``. + * Auth: requires ``X-API-Key`` header or OAuth Bearer token. */ post: operations["api_ai_decline_api_ai_assistant__conversation_id__decline_post"]; delete?: never; @@ -932,7 +970,7 @@ export interface paths { * - `time_from` / `time_to`: ISO 8601 date range * * Auth & scoping: - * - Requires authentication (API key or bearer token). Results are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. */ get: operations["list_alerts_api_alerts_get"]; put?: never; @@ -963,7 +1001,7 @@ export interface paths { * Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ get: operations["list_alert_configs_api_alerts_configs_get"]; put?: never; @@ -977,7 +1015,7 @@ export interface paths { * Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ post: operations["create_alert_config_api_alerts_configs_post"]; delete?: never; @@ -1000,7 +1038,7 @@ export interface paths { * Returns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ get: operations["get_alert_config_api_alerts_configs__config_id__get"]; put?: never; @@ -1010,7 +1048,7 @@ export interface paths { * @description Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ delete: operations["delete_alert_config_api_alerts_configs__config_id__delete"]; options?: never; @@ -1020,7 +1058,7 @@ export interface paths { * @description Update an alert configuration. Only provided fields are updated. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ patch: operations["update_alert_config_api_alerts_configs__config_id__patch"]; trace?: never; @@ -1034,12 +1072,12 @@ export interface paths { }; /** * List organization alert delivery preferences - * @description List per-organization alert delivery preferences for the API key's associated user. + * @description List per-organization alert delivery preferences for the authenticated user. * * By default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. * - Only organizations where the user is an owner or administrator are included. */ get: operations["list_organization_preferences_api_alerts_organization_preferences_list_get"]; @@ -1066,12 +1104,12 @@ export interface paths { head?: never; /** * Update organization alert delivery preference - * @description Update the API key user's personal delivery preference for one alert type in one organization. + * @description Update the authenticated user's personal delivery preference for one alert type in one organization. * * Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. * - Only owners and administrators can update preferences for an organization. */ patch: operations["update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch"]; @@ -1089,7 +1127,7 @@ export interface paths { * @description Get full alert detail including history, comments, and subscribers. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ get: operations["get_alert_detail_api_alerts__alert_id__get"]; put?: never; @@ -1114,7 +1152,7 @@ export interface paths { * @description Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ post: operations["add_alert_comment_api_alerts__alert_id__comments_post"]; delete?: never; @@ -1137,7 +1175,7 @@ export interface paths { * @description Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ post: operations["change_alert_status_api_alerts__alert_id__status_post"]; delete?: never; @@ -1160,7 +1198,7 @@ export interface paths { * @description Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ post: operations["subscribe_to_alert_api_alerts__alert_id__subscribe_post"]; delete?: never; @@ -1183,7 +1221,7 @@ export interface paths { * @description Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ post: operations["unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post"]; delete?: never; @@ -1211,7 +1249,7 @@ export interface paths { * - `start` and `end` control the character range returned in `text_content` so clients can page through large documents. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access content belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. */ get: operations["get_content_detail_api_contents__source_connection_content_version__get"]; /** @@ -1243,7 +1281,7 @@ export interface paths { * Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only delete content belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. */ delete: operations["delete_content_api_contents__source_connection_content_version__delete"]; options?: never; @@ -1265,7 +1303,7 @@ export interface paths { * Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access embeddings for content belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account. */ get: operations["list_content_embeddings_api_contents__source_connection_content_version__embeddings_get"]; put?: never; @@ -1334,7 +1372,7 @@ export interface paths { * - For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only replace content belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account. */ post: operations["upload_file_to_content_api_contents__source_connection_content_version__upload_post"]; delete?: never; @@ -1356,7 +1394,7 @@ export interface paths { * Generate a governance plan * @description Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined. * - * Auth: requires `X-API-Key` with governance access. + * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. */ post: operations["governance_ai_generate_api_governance_ai_assistant_post"]; delete?: never; @@ -1376,7 +1414,7 @@ export interface paths { * List AI assistant conversations * @description Return recent governance AI assistant conversations for the account, ordered by most recent first. * - * Auth: requires `X-API-Key` with governance access. + * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. */ get: operations["list_governance_ai_conversations_api_governance_ai_assistant_conversations_get"]; put?: never; @@ -1400,7 +1438,7 @@ export interface paths { * Accept a governance plan * @description Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned. * - * Auth: requires `X-API-Key` with governance access. + * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. */ post: operations["governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post"]; delete?: never; @@ -1422,7 +1460,7 @@ export interface paths { * Decline a governance plan * @description Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made. * - * Auth: requires `X-API-Key` with governance access. + * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. */ post: operations["governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post"]; delete?: never; @@ -1443,7 +1481,7 @@ export interface paths { * @description List knowledge bases for the account. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ get: operations["list_knowledge_bases_api_knowledge_bases_get"]; put?: never; @@ -1472,7 +1510,7 @@ export interface paths { * @description Fetch a knowledge base by ID. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access knowledge bases belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account. */ get: operations["get_knowledge_base_api_knowledge_bases__knowledge_base_id__get"]; /** @@ -1480,7 +1518,7 @@ export interface paths { * @description Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only update knowledge bases belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account. */ put: operations["update_knowledge_base_api_knowledge_bases__knowledge_base_id__put"]; post?: never; @@ -1505,7 +1543,7 @@ export interface paths { }; /** * Get current user identity - * @description Returns the authenticated user's personal account ID and a list of organizations they belong to. Each organization entry includes the organization's own id, name, and account_id. Useful for CLI tooling that needs to let the user pick an organization context. + * @description Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context. */ get: operations["get_me_api_me_get"]; put?: never; @@ -1528,7 +1566,7 @@ export interface paths { * @description List memory banks for the account. * * Auth & scoping: - * - Requires authentication (API key or bearer token). All resources are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. */ get: operations["list_memory_banks_api_memory_banks_get"]; put?: never; @@ -1558,7 +1596,7 @@ export interface paths { * Generate a memory bank configuration * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description. * - * Auth: requires `X-API-Key`. + * Auth: requires `X-API-Key` header or OAuth Bearer token. */ post: operations["memory_bank_ai_generate_api_memory_banks_ai_assistant_post"]; delete?: never; @@ -1578,7 +1616,7 @@ export interface paths { * Fetch memory bank AI conversation history * @description Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset. * - * Auth: requires `X-API-Key`. + * Auth: requires `X-API-Key` header or OAuth Bearer token. */ get: operations["memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get"]; put?: never; @@ -1606,7 +1644,7 @@ export interface paths { * Accept or decline a memory bank AI suggestion * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. * - * Auth: requires `X-API-Key`. + * Auth: requires `X-API-Key` header or OAuth Bearer token. */ patch: operations["memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch"]; trace?: never; @@ -1665,7 +1703,7 @@ export interface paths { * @description Fetch a memory bank by ID. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access memory banks belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account. */ get: operations["get_memory_bank_api_memory_banks__memory_bank_id__get"]; /** @@ -1808,7 +1846,7 @@ export interface paths { * Returns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination. * * Auth & scoping: - * - Requires authentication (API key or bearer token). Alerts are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. */ get: operations["list_alerts_api_models_alerts_get"]; put?: never; @@ -1833,7 +1871,7 @@ export interface paths { * @description Mark all model lifecycle alerts as read for the account. * * Auth & scoping: - * - Requires authentication (API key or bearer token). Scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account. */ post: operations["mark_all_read_api_models_alerts_mark_all_read_post"]; delete?: never; @@ -1856,7 +1894,7 @@ export interface paths { * Useful for badge indicators in UIs and dashboards. * * Auth & scoping: - * - Requires authentication (API key or bearer token). Count is scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. */ get: operations["get_alert_unread_count_api_models_alerts_unread_count_get"]; put?: never; @@ -1885,7 +1923,7 @@ export interface paths { * @description Mark a single model lifecycle alert as read (dismissed). * * Auth & scoping: - * - Requires authentication (API key or bearer token). The alert must belong to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. */ patch: operations["mark_read_api_models_alerts__alert_id__read_patch"]; trace?: never; @@ -1904,7 +1942,7 @@ export interface paths { * Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives. * * Auth & scoping: - * - Requires authentication (API key or bearer token). + * - Requires `X-API-Key` header or OAuth Bearer token. */ get: operations["get_recommendations_api_models__model_id__recommendations_get"]; put?: never; @@ -1954,15 +1992,15 @@ export interface paths { * - Filtering: `search` to filter by solution name (case-insensitive partial match). * * Auth & scoping: - * - Requires authentication (API key or bearer token). Results are scoped to the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. */ get: operations["list_solutions_api_solutions_get"]; put?: never; /** * Create a solution - * @description Create a new solution for the authenticated account. + * @description Create a new solution for the caller's account. * - * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body. Requires authentication (API key or bearer token). + * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body. */ post: operations["create_solution_api_solutions_post"]; delete?: never; @@ -1982,7 +2020,7 @@ export interface paths { * Get a solution * @description Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. * - * Returns the full solution detail with nested resource information. Requires authentication (API key or bearer token). + * Returns the full solution detail with nested resource information. */ get: operations["get_solution_api_solutions__solution_id__get"]; put?: never; @@ -1991,7 +2029,7 @@ export interface paths { * Delete a solution * @description Delete a solution by its ID. * - * This permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted. Requires authentication (API key or bearer token). + * This permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted. */ delete: operations["delete_solution_api_solutions__solution_id__delete"]; options?: never; @@ -2000,7 +2038,7 @@ export interface paths { * Update a solution * @description Update an existing solution's name or description. * - * Pass the fields you wish to change in the request body. Fields not included remain unchanged. Requires authentication (API key or bearer token). + * Pass the fields you wish to change in the request body. Fields not included remain unchanged. */ patch: operations["update_solution_api_solutions__solution_id__patch"]; trace?: never; @@ -2018,14 +2056,14 @@ export interface paths { * Link agents * @description Link one or more agents to a solution by their IDs. * - * Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources. */ post: operations["link_agents_api_solutions__solution_id__agents_post"]; /** * Unlink agents * @description Unlink one or more agents from a solution by their IDs. * - * Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources. */ delete: operations["unlink_agents_api_solutions__solution_id__agents_delete"]; options?: never; @@ -2046,7 +2084,7 @@ export interface paths { * Generate solution plan * @description Generate a comprehensive solution management plan via the solution AI assistant. * - * This is the most powerful assistant — it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint. Requires authentication (API key or bearer token). + * This is the most powerful assistant — it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint. * * Supports SSE streaming when `Accept: text/event-stream` is set. */ @@ -2070,7 +2108,7 @@ export interface paths { * Generate knowledge base plan * @description Generate a knowledge base plan via the KB AI assistant. * - * Describe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint. Requires authentication (API key or bearer token). + * Describe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint. */ post: operations["ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post"]; delete?: never; @@ -2092,7 +2130,7 @@ export interface paths { * Generate source plan * @description Generate a content source plan via the source AI assistant. * - * Describe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan. Requires authentication (API key or bearer token). + * Describe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan. */ post: operations["ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post"]; delete?: never; @@ -2114,7 +2152,7 @@ export interface paths { * Accept plan * @description Accept and execute a proposed plan generated by one of the AI assistant endpoints. * - * Executes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status. Requires authentication (API key or bearer token). + * Executes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status. */ post: operations["ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post"]; delete?: never; @@ -2136,7 +2174,7 @@ export interface paths { * Decline plan * @description Decline a proposed plan generated by one of the AI assistant endpoints. * - * Marks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed. Requires authentication (API key or bearer token). + * Marks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed. */ post: operations["ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post"]; delete?: never; @@ -2156,7 +2194,7 @@ export interface paths { * List conversations * @description List AI assistant conversation history for a solution. * - * Returns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status. Requires authentication (API key or bearer token). + * Returns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status. */ get: operations["list_conversations_api_solutions__solution_id__conversations_get"]; put?: never; @@ -2164,7 +2202,7 @@ export interface paths { * Add conversation turn * @description Add a conversation turn to a solution's AI assistant history. * - * Records a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions. Requires authentication (API key or bearer token). + * Records a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions. */ post: operations["add_conversation_turn_api_solutions__solution_id__conversations_post"]; delete?: never; @@ -2190,7 +2228,7 @@ export interface paths { * Mark conversation turn * @description Mark a conversation turn as accepted or declined. * - * Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user. Requires authentication (API key or bearer token). + * Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user. */ patch: operations["mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch"]; trace?: never; @@ -2208,14 +2246,14 @@ export interface paths { * Link knowledge bases * @description Link one or more knowledge bases to a solution by their IDs. * - * Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources. */ post: operations["link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post"]; /** * Unlink knowledge bases * @description Unlink one or more knowledge bases from a solution by their IDs. * - * Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution. */ delete: operations["unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete"]; options?: never; @@ -2236,14 +2274,14 @@ export interface paths { * Link source connections * @description Link one or more source connections to a solution by their IDs. * - * Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources. */ post: operations["link_source_connections_api_solutions__solution_id__source_connections_post"]; /** * Unlink source connections * @description Unlink one or more source connections from a solution by their IDs. * - * Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution. Requires authentication (API key or bearer token). + * Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution. */ delete: operations["unlink_source_connections_api_solutions__solution_id__source_connections_delete"]; options?: never; @@ -2293,8 +2331,8 @@ export interface paths { * - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). * * Auth & scoping: - * - Requires authentication (API key or bearer token). Results are scoped to the authenticated account. - * - The optional `account_id` query param is only allowed when it matches the authenticated account. + * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. + * - The optional `account_id` query param is only allowed when it matches the caller's account. */ get: operations["list_sources_api_sources__get"]; put?: never; @@ -2317,7 +2355,7 @@ export interface paths { * @description Fetch a content source by ID. * * Auth & scoping: - * - Requires authentication (API key or bearer token). You can only access sources belonging to your account. + * - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account. */ get: operations["get_source_api_sources__source_connection_id__get"]; /** @@ -2652,6 +2690,69 @@ export interface components { * @enum {string} */ AgentEvaluationTier: "fast" | "balanced" | "thorough"; + /** + * AgentExportResponse + * @description Portable JSON snapshot of an agent definition. + */ + AgentExportResponse: { + /** + * Agent + * @description Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at. + */ + agent: { + [key: string]: unknown; + }; + /** + * Alert Configs + * @description Alert configurations. + */ + alert_configs?: { + [key: string]: unknown; + }[] | null; + /** + * Dependencies + * @description Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users — each a list of {id, name, description, …}. + */ + dependencies?: { + [key: string]: unknown; + } | null; + /** + * Evaluation Criteria + * @description Evaluation criteria for agent steps. + */ + evaluation_criteria?: { + [key: string]: unknown; + }[] | null; + /** + * Export Version + * @description Schema version of the export format (currently "2"). + */ + export_version: string; + /** + * Exported At + * @description ISO-8601 timestamp of when the export was generated. + */ + exported_at: string; + /** + * Governance Policies + * @description Agent-scoped governance policies. + */ + governance_policies?: { + [key: string]: unknown; + }[] | null; + /** + * Software Version + * @description Application version that produced this export. + */ + software_version: string; + /** + * Trigger + * @description Trigger configuration with schedules. + */ + trigger?: { + [key: string]: unknown; + } | null; + }; /** AgentRunAttemptResponse */ AgentRunAttemptResponse: { /** @@ -2770,6 +2871,11 @@ export interface components { * @description Timestamp when the step attempt ended. */ ended_at: string | null; + /** + * Input + * @description Input provided to the step, if any. + */ + input: string | null; /** * Output * @description Output produced by the step, if any. @@ -7274,6 +7380,43 @@ export interface operations { }; }; }; + export_agent_api_agents__agent_id__export_get: { + parameters: { + query?: { + /** @description Return as file download */ + download?: boolean; + }; + 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: { + agent_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AgentExportResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get: { parameters: { query?: never; @@ -8899,7 +9042,10 @@ export interface operations { get_me_api_me_get: { parameters: { query?: never; - header?: 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; }; @@ -10431,7 +10577,7 @@ export interface operations { sort?: string; /** @description Sort order */ order?: string; - /** @description List sources for the given account. Defaults to the api key's account. */ + /** @description List sources for the given account. Defaults to the caller's account. */ account_id?: string | null; }; header?: { diff --git a/src/types.ts b/src/types.ts index 70d4ef0..e9669e5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -37,6 +37,9 @@ export type AgentListResponse = components["schemas"]["routers__api__agents__Age /** Full agent configuration including definition and metadata. */ export type AgentDefinitionResponse = components["schemas"]["AgentDefinitionResponse"]; +/** Portable JSON snapshot of an agent definition. */ +export type AgentExportResponse = components["schemas"]["AgentExportResponse"]; + /** Summary of an agent (returned on create/update). */ export type AgentSummaryResponse = components["schemas"]["AgentSummaryResponse"]; From fc376e7bfee13275f06dd8b07fff2ebaa372b31a Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Wed, 1 Apr 2026 21:56:54 -0700 Subject: [PATCH 2/4] Addressed review comments --- .github/copilot-instructions.md | 4 +++- openapi/seclai.openapi.json | 4 ++-- src/openapi.ts | 6 ++++-- tests/client.test.ts | 26 ++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5df7eed..5ff359d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -12,7 +12,7 @@ npm test # vitest - **ALL tests must pass with ZERO failures. No exceptions.** CI/CD runs the full test suite on every PR. A test failure blocks the build. - **`npm run build` must succeed with ZERO errors.** The DTS build is strict — type errors in `.d.ts` generation will fail the build even if runtime JS works fine. - **Do not dismiss test or build failures as pre-existing or unrelated.** The `main` branch CI/CD is green. Any failure on a feature branch was caused by changes on that branch. -- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a type, build, or test error appears, **fix it immediately**. Do NOT run `git diff`, `git log`, `git show`, `git blame`, or any other command to determine whether the error is "pre-existing" or "from our changes". There is no scenario where knowing the origin of an error changes what you must do: **fix it**. +- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a type, build, or test error appears, **fix it immediately**. Do NOT run `git blame` or use git history to argue that an error is "pre-existing" or not your responsibility. Tools like `git diff`, `git log`, and `git show` may be used to understand and review changes, but never to avoid fixing an error. There is no scenario where knowing the origin of an error changes what you must do: **fix it**. - **CRITICAL — NEVER PIPE TEST OR BUILD OUTPUT**: Do not append `| tail`, `| head`, `| grep`, or any pipe to `npm test`, `npm run build`, or similar commands. Piping hides errors. Always run with full unfiltered output. ## Key Rules @@ -21,6 +21,8 @@ npm test # vitest - `src/types.ts` maps user-facing type aliases to `components["schemas"][...]`. Schema names can change between API versions (e.g. `routers__api__*__` prefixes may be added or removed). Verify names against `src/openapi.ts` after regeneration. - `tsconfig.json` uses `exactOptionalPropertyTypes: true` — optional properties must use `prop?: T | undefined`, not just `prop?: T`. - The OpenAPI spec here is NOT identical to `seclai-go`/`seclai-python` (different version baseline). Apply equivalent description changes separately. +- OpenAPI specs are generated from the main `seclai` app repo. Description or endpoint changes made here must also be applied upstream, or they will be overwritten on the next generation. +- `.github/copilot-instructions.md` shares common sections (quality gates, git rules, editing rules, self-correction rules) across all SDK repos. When updating shared rules, apply the same change to all repos: `seclai-python`, `seclai-javascript`, `seclai-go`, `seclai-csharp`, `seclai-cli`, `seclai-mcp`. - `writeSsoCache` uses atomic rename; on Windows, must `fs.unlink` the destination before `fs.rename`. - Auth: streaming methods must use resolved auth headers, not `this.apiKey` directly. - Do not run ad-hoc scripts; add tests instead. diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 68b3863..6e6e6f8 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -8994,7 +8994,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`. You can only export agents belonging to your 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` 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.", "operationId": "export_agent_api_agents__agent_id__export_get", "parameters": [ { @@ -11469,7 +11469,7 @@ }, "/me": { "get": { - "description": "Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context.", + "description": "Returns the authenticated user's personal account ID and a list of organizations they belong to. Each organization entry includes the organization's id, name, and account_id. Useful for CLI tooling that needs to let the user pick an organization context.", "operationId": "get_me_api_me_get", "parameters": [ { diff --git a/src/openapi.ts b/src/openapi.ts index 53e1c16..de32b6e 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -573,7 +573,9 @@ 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`. You can only export agents belonging to your account. + * - 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. */ get: operations["export_agent_api_agents__agent_id__export_get"]; put?: never; @@ -1543,7 +1545,7 @@ export interface paths { }; /** * Get current user identity - * @description Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context. + * @description Returns the authenticated user's personal account ID and a list of organizations they belong to. Each organization entry includes the organization's id, name, and account_id. Useful for CLI tooling that needs to let the user pick an organization context. */ get: operations["get_me_api_me_get"]; put?: never; diff --git a/tests/client.test.ts b/tests/client.test.ts index b2326fc..65d2358 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -239,6 +239,32 @@ describe("Agents — CRUD", () => { }); }); +// ───────────────────────────────────────────────────────────────────────────── +// Agent Export +// ───────────────────────────────────────────────────────────────────────────── + +describe("Agent Export", () => { + test("exportAgent sends GET /agents/:id/export with download=true by default", async () => { + const client = makeClient((req) => { + expect(req.method).toBe("GET"); + const url = new URL(req.url); + expect(url.pathname).toBe("/agents/ag_1/export"); + expect(url.searchParams.get("download")).toBe("true"); + return jsonResponse({ export_version: "2", agent: {} }); + }); + await client.exportAgent("ag_1"); + }); + + test("exportAgent passes download=false when specified", async () => { + const client = makeClient((req) => { + const url = new URL(req.url); + expect(url.searchParams.get("download")).toBe("false"); + return jsonResponse({ export_version: "2", agent: {} }); + }); + await client.exportAgent("ag_1", false); + }); +}); + // ───────────────────────────────────────────────────────────────────────────── // Agent Definitions // ───────────────────────────────────────────────────────────────────────────── From 478d37e0e5c4b99bf579b0ab55e7940ef286bd14 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 23 Apr 2026 22:58:13 -0700 Subject: [PATCH 3/4] New step types, merged content source types, playground --- openapi/seclai.openapi.json | 1849 ++++++++++++++++++++++++++++------- src/client.ts | 65 ++ src/index.ts | 9 + src/openapi.ts | 693 ++++++++++++- src/types.ts | 23 + 5 files changed, 2291 insertions(+), 348 deletions(-) diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 6e6e6f8..ecc90b5 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" }, @@ -8458,7 +9229,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 +9273,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 +9765,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 +9967,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": [ { @@ -9233,6 +10004,9 @@ }, "description": "Successful Response" }, + "402": { + "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": { @@ -9252,7 +10026,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 +10067,9 @@ }, "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": { + "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 +11707,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": [ { @@ -11469,7 +12246,7 @@ }, "/me": { "get": { - "description": "Returns the authenticated user's personal account ID and a list of organizations they belong to. Each organization entry includes the organization's id, name, and account_id. Useful for CLI tooling that needs to let the user pick an organization context.", + "description": "Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context.", "operationId": "get_me_api_me_get", "parameters": [ { @@ -11899,10 +12676,248 @@ ] } }, - "/memory_banks/{memory_bank_id}": { + "/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": { + "202": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response Compact Memory Bank Api Memory Banks Memory Bank Id Compact Post", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Compact Memory Bank", + "tags": [ + "memory_banks" + ] + } + }, + "/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 +12947,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 +12967,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 +13022,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 +13041,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 +13069,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateMemoryBankBody" + "$ref": "#/components/schemas/TestCompactionRequest" } } }, @@ -12013,7 +13080,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" + "$ref": "#/components/schemas/CompactionTestResponseModel" } } }, @@ -12030,24 +13097,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,94 +13172,189 @@ "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" } } }, "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "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": "Get Agents Using Bank", + "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 +13377,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 +13403,7 @@ } }, { + "description": "Explicit start date (overrides days).", "in": "query", "name": "start_date", "required": false, @@ -12216,10 +13417,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 +13436,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 +13477,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 +13495,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 +13512,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestCompactionRequest" + "$ref": "#/components/schemas/PlaygroundCreateRequest" } } }, @@ -12303,7 +13523,9 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" + "additionalProperties": true, + "title": "Response Create Experiment Api Models Playground Experiments Post", + "type": "object" } } }, @@ -12320,72 +13542,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 +13573,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 +13591,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 +13622,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 +13665,14 @@ } ], "responses": { - "204": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" + } + } + }, "description": "Successful Response" }, "422": { @@ -12505,7 +13686,7 @@ "description": "Validation Error" } }, - "summary": "Mark Read", + "summary": "Get Model", "tags": [ "models" ] @@ -13817,7 +14998,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": [ { @@ -13867,7 +15048,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 +15909,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..38c3d23 100644 --- a/src/client.ts +++ b/src/client.ts @@ -89,6 +89,9 @@ import type { MemoryBankResponse, NonManualEvaluationSummaryResponse, OrganizationAlertPreferenceListResponse, + PlaygroundCreateRequest, + PromptModelResponse, + ProviderGroupResponse, SolutionConversationResponse, SolutionListResponse, SolutionResponse, @@ -2307,6 +2310,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; supports_tool_use?: boolean; supports_thinking?: boolean } = {}): Promise { + return (await this.request("GET", "/models", { + query: { provider: opts.provider, supports_tool_use: opts.supports_tool_use, supports_thinking: opts.supports_thinking }, + })) 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; start_date?: string; end_date?: string; limit?: number; offset?: number } = {}): Promise { + return await this.request("GET", "/models/playground/experiments", { + query: { days: opts.days, start_date: opts.start_date, end_date: opts.end_date, limit: opts.limit, offset: opts.offset }, + }); + } + + /** + * Create a model playground experiment. + * + * @param body - Experiment configuration. + */ + async createExperiment(body: PlaygroundCreateRequest): 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..9169b23 100644 --- a/src/index.ts +++ b/src/index.ts @@ -220,6 +220,15 @@ export type { // Models PromptModelAutoUpgradeStrategy, + ProviderGroupResponse, + PromptModelResponse, + PromptToolResponse, + VariantCategoryResponse, + VariantOptionResponse, + PlaygroundCreateRequest, + + // Sources (enums) + SourceIndexMode, // Enums PendingProcessingCompletedFailedStatus, diff --git a/src/openapi.ts b/src/openapi.ts index de32b6e..df389f7 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` @@ -1545,7 +1544,7 @@ export interface paths { }; /** * Get current user identity - * @description Returns the authenticated user's personal account ID and a list of organizations they belong to. Each organization entry includes the organization's id, name, and account_id. Useful for CLI tooling that needs to let the user pick an organization context. + * @description Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context. */ get: operations["get_me_api_me_get"]; put?: never; @@ -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 file upload and custom index sources, the URL is created automatically. + * For RSS and website sources, provide the URL. For 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. @@ -7522,6 +7945,13 @@ 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?: never; + }; /** @description Validation Error */ 422: { headers: { @@ -7578,6 +8008,13 @@ 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?: never; + }; /** @description Validation Error */ 422: { headers: { @@ -9610,6 +10047,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 +10207,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?: { diff --git a/src/types.ts b/src/types.ts index e9669e5..723b0e4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -414,6 +414,29 @@ 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"]; + +// ─── 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. */ From 333697778cfb83bcb1ba6c3f1a853cf39bc3bf2c Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 24 Apr 2026 00:05:19 -0700 Subject: [PATCH 4/4] Addressed review comments --- openapi/seclai.openapi.json | 82 +++++++++++++++++++++++++++++++++++++ src/client.ts | 11 ++--- src/index.ts | 1 + src/openapi.ts | 42 +++++++++++++++---- src/types.ts | 9 ++++ 5 files changed, 132 insertions(+), 13 deletions(-) diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index ecae8fa..8caf753 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -8108,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": { @@ -10005,6 +10017,29 @@ "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": "Insufficient credits \u2014 the account has exhausted its credits. The response body is `{\"detail\": {\"error\": \"insufficient_credits\", \"message\": ..., \"account_id\": ...}}`." }, "422": { @@ -10068,6 +10103,29 @@ "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": { @@ -12088,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": { @@ -15027,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": { diff --git a/src/client.ts b/src/client.ts index 38c3d23..349b7ac 100644 --- a/src/client.ts +++ b/src/client.ts @@ -90,6 +90,7 @@ import type { NonManualEvaluationSummaryResponse, OrganizationAlertPreferenceListResponse, PlaygroundCreateRequest, + CreateExperimentInput, PromptModelResponse, ProviderGroupResponse, SolutionConversationResponse, @@ -2315,9 +2316,9 @@ export class Seclai { * * @param opts - Optional filters. */ - async listModels(opts: { provider?: string; supports_tool_use?: boolean; supports_thinking?: boolean } = {}): Promise { + async listModels(opts: { provider?: string; supportsToolUse?: boolean; supportsThinking?: boolean } = {}): Promise { return (await this.request("GET", "/models", { - query: { provider: opts.provider, supports_tool_use: opts.supports_tool_use, supports_thinking: opts.supports_thinking }, + query: { provider: opts.provider, supports_tool_use: opts.supportsToolUse, supports_thinking: opts.supportsThinking }, })) as ProviderGroupResponse[]; } @@ -2339,9 +2340,9 @@ export class Seclai { * * @param opts - Optional filters and pagination. */ - async listExperiments(opts: { days?: number; start_date?: string; end_date?: string; limit?: number; offset?: number } = {}): Promise { + 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.start_date, end_date: opts.end_date, limit: opts.limit, offset: opts.offset }, + query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }, }); } @@ -2350,7 +2351,7 @@ export class Seclai { * * @param body - Experiment configuration. */ - async createExperiment(body: PlaygroundCreateRequest): Promise { + async createExperiment(body: CreateExperimentInput): Promise { return await this.request("POST", "/models/playground/experiments", { json: body }); } diff --git a/src/index.ts b/src/index.ts index 9169b23..01d1a7e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -226,6 +226,7 @@ export type { VariantCategoryResponse, VariantOptionResponse, PlaygroundCreateRequest, + CreateExperimentInput, // Sources (enums) SourceIndexMode, diff --git a/src/openapi.ts b/src/openapi.ts index 597ef2d..33d782e 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -574,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; @@ -6867,7 +6865,11 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: Record; + }; + }; }; /** @description Validation Error */ 422: { @@ -7952,7 +7954,15 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: { + error?: string; + message?: string; + account_id?: string; + }; + }; + }; }; /** @description Validation Error */ 422: { @@ -8015,7 +8025,15 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: { + error?: string; + message?: string; + account_id?: string; + }; + }; + }; }; /** @description Validation Error */ 422: { @@ -9363,7 +9381,11 @@ export interface operations { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": { + detail?: Record; + }; + }; }; /** @description Validation Error */ 422: { @@ -11222,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 723b0e4..f884389 100644 --- a/src/types.ts +++ b/src/types.ts @@ -432,6 +432,15 @@ 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. */