openapi: 3.1.0 info: title: Opik REST Agent Insights Jobs API description: "The Opik REST API is currently in beta and subject to change. If you have any questions or feedback about the APIs, please reach out on GitHub: https://github.com/comet-ml/opik.\n\nAll of the methods listed in this documentation are used by either the SDK or the UI to interact with the Opik server. As a result,\nthe methods have been optimized for these use-cases in mind. If you are looking for a method that is not listed above, please create\nand issue on GitHub or raise a PR!\n\nOpik includes two main deployment options that results in slightly different API usage:\n\n- **Self-hosted Opik instance:** You will simply need to specify the URL as `http://localhost:5173/api/` or similar. This is the default option for the docs.\n- **Opik Cloud:** You will need to specify the Opik API Key and Opik Workspace in the header. The format of the header should be:\n\n ```\n {\n \"Comet-Workspace\": \"your-workspace-name\",\n \"authorization\": \"your-api-key\"\n }\n ```\n\n The full payload would therefore look like:\n \n ```\n curl -X GET 'https://www.comet.com/opik/api/v1/private/projects' \\\n -H 'Accept: application/json' \\\n -H 'Comet-Workspace: ' \\\n -H 'authorization: '\n ```\n\n Do take note here that the authorization header value does not include the `Bearer ` prefix. To switch to using the Opik Cloud in the documentation, you can\n click on the edit button displayed when hovering over the `Base URL` displayed on the right hand side of the docs.\n" contact: name: Github Repository url: https://github.com/comet-ml/opik license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 servers: - url: http://localhost:5173/api description: Local server - url: https://www.comet.com/opik/api description: Opik Cloud tags: - name: Agent Insights Jobs description: Per-(workspace, project) Agent Insights report configuration paths: /v1/private/agent-insights/jobs/{projectId}: get: tags: - Agent Insights Jobs summary: Get Agent Insights job description: Returns the Agent Insights job for the (workspace, project), or 404 if none exists. operationId: getAgentInsightsJob parameters: - name: projectId in: path required: true schema: type: string format: uuid responses: '200': description: Job content: application/json: schema: $ref: '#/components/schemas/AgentInsightsJob' '404': description: Job not found post: tags: - Agent Insights Jobs summary: Create Agent Insights job description: Creates the Agent Insights job for a project. 409 if one already exists. operationId: createAgentInsightsJob parameters: - name: projectId in: path required: true schema: type: string format: uuid responses: '201': description: Job created headers: Location: description: URI of the created job style: simple schema: type: string content: application/json: schema: $ref: '#/components/schemas/AgentInsightsJob' '404': description: Project not found '409': description: Job already exists patch: tags: - Agent Insights Jobs summary: Update Agent Insights job description: Partially updates the Agent Insights job for a project (e.g. status; never deletes). Returns the updated job, or 404 if none exists. operationId: updateAgentInsightsJob parameters: - name: projectId in: path required: true schema: type: string format: uuid requestBody: content: application/json: schema: $ref: '#/components/schemas/AgentInsightsJobUpdate' required: true responses: '200': description: Job updated content: application/json: schema: $ref: '#/components/schemas/AgentInsightsJob' '404': description: Job not found /v1/private/agent-insights/jobs/{projectId}/trigger: post: tags: - Agent Insights Jobs summary: Trigger Agent Insights job description: Triggers an immediate report run for an existing job (over the last 24h). Fire-and-forget; returns 202. 404 if none exists. operationId: triggerAgentInsightsJob parameters: - name: projectId in: path required: true schema: type: string format: uuid responses: '202': description: Run accepted '404': description: Job not found components: schemas: AgentInsightsJob: required: - project_id type: object properties: id: type: string format: uuid readOnly: true project_id: type: string format: uuid readOnly: true status: type: string readOnly: true enum: - enabled - disabled last_scan_at: type: string format: date-time readOnly: true last_failure_reason: type: string readOnly: true last_failure_detail: type: string readOnly: true last_failed_at: type: string format: date-time readOnly: true created_at: type: string format: date-time readOnly: true created_by: type: string readOnly: true last_updated_at: type: string format: date-time readOnly: true last_updated_by: type: string readOnly: true AgentInsightsJobUpdate: required: - status type: object properties: status: type: string description: New status for the job enum: - enabled - disabled