{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Product Management Service API","description":"API documentation for Product Management Service","contact":{"name":"Galtea AI"}},"externalDocs":{"description":"Galtea Platform Documentation","url":"https://docs.galtea.ai"},"servers":[{"url":"https://api.galtea.ai"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer gsk-...`."}},"schemas":{"Product":{"type":"object","properties":{"id":{"type":"string","example":"prod_123"},"organizationId":{"type":"string","example":"org_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"Sample Product"},"description":{"type":"string","example":"Sample product description"},"riskLevel":{"type":"string","enum":["PROHIBITED","GPAI","GPAI_SYSTEMIC","HIGH","SPECIAL_SYSTEM"],"nullable":true,"description":"EU AI Act risk classification. PROHIBITED: banned AI use cases. GPAI: general-purpose AI. GPAI_SYSTEMIC: GPAI with systemic risk. HIGH: high-risk AI system. SPECIAL_SYSTEM: special-category system.","example":"HIGH"},"operatorType":{"type":"string","enum":["AUTHORISED_REPRESENTATIVE","DEPLOYER","DISTRIBUTER","IMPORTER","PRODUCT_MANUFACTURER","PROVIDER"],"nullable":true,"description":"EU AI Act operator role classification.","example":"PROVIDER"},"securityBoundaries":{"type":"string","nullable":true,"example":"Internal use only"},"capabilities":{"type":"string","nullable":true,"example":"Can process and analyze data"},"inabilities":{"type":"string","nullable":true,"example":"Cannot process sensitive financial data"},"policies":{"type":"string","nullable":true,"example":"Must comply with data protection regulations"},"tags":{"type":"array","items":{"type":"string"},"example":["internal","beta"],"description":"Free-form labels for organizing products. Normalized to lowercase and trimmed on save."},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Test":{"type":"object","properties":{"id":{"type":"string","example":"test_123"},"productId":{"type":"string","nullable":true,"example":"prod_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"Quality Test"},"type":{"type":"string","enum":["QUALITY","RED_TEAMING","SCENARIOS"],"example":"QUALITY"},"groundTruthUri":{"type":"string","nullable":true,"example":"s3://my-bucket/tests/test_123/ground-truth.csv","description":"Canonical storage URI of the ground-truth file, derived from the presigned URL supplied at creation. S3: `s3://<bucket>/<key>`. Azure Blob: blob URL with the SAS query stripped (e.g. `https://<account>.blob.core.windows.net/<container>/<path>`)."},"uri":{"type":"string","nullable":true,"example":"s3://my-bucket/tests/test_123/test.csv","description":"Canonical storage URI of the uploaded custom test file. Same format rules as `groundTruthUri`."},"error":{"type":"string","nullable":true},"status":{"type":"string","enum":["PENDING","SUCCESS","FAILED","AUGMENTING"],"example":"SUCCESS"},"fewShot":{"type":"string","nullable":true,"example":"Example few-shot learning data","description":"Optional few-shot examples (input/output pairs) used to guide test-case generation for QUALITY tests."},"languageCode":{"type":"string","nullable":true,"example":"en"},"variants":{"type":"array","items":{"type":"string"},"example":["rag","summarization"],"description":"Test variants. QUALITY: rag, entity_extraction, summarization, classification, translation, correction, other. RED_TEAMING: data_leakage, financial_attacks, illegal_activities, misuse, toxicity, custom."},"customVariantDescription":{"type":"string","nullable":true,"example":"Custom variant description"},"strategies":{"type":"array","items":{"type":"string"},"example":["original"],"description":"Generation strategies. \"original\" is the default for RED_TEAMING. At least one strategy is required for SCENARIOS tests."},"customUserPersona":{"type":"string","nullable":true,"example":"Business analyst"},"maxTestCases":{"type":"integer","nullable":true,"example":100},"models":{"type":"array","items":{"type":"string"},"example":["gpt-4","claude-3"]},"sourceTestId":{"type":"string","nullable":true},"dataCatalogUri":{"type":"string","nullable":true,"example":"s3://my-bucket/tests/test_123/data-catalog.json","description":"Canonical storage URI of the data-catalog file (SCENARIOS tests only). Same format rules as `groundTruthUri`."},"metadata":{"type":"object","nullable":true,"example":{"key":"value"}},"specificationId":{"type":"string","nullable":true,"example":"spec_123"},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"TestInput":{"type":"object","required":["productId","name","type"],"properties":{"productId":{"type":"string","description":"Product ID","example":"prod_123"},"name":{"type":"string","description":"Test name","example":"Quality Test"},"type":{"type":"string","enum":["QUALITY","RED_TEAMING","SCENARIOS"],"example":"QUALITY"},"specificationId":{"type":"string","description":"Specification ID (can auto-derive type/variants)","example":"spec_123"},"groundTruthUri":{"type":"string","description":"Presigned GET URL (S3 `X-Amz-*` query or Azure Blob SAS) for a ground-truth file previously uploaded via the storage PUT-presign endpoint. The server strips the signing query and persists the underlying storage URI. Cannot be combined with `sourceTestId`.","example":"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."},"uri":{"type":"string","description":"Presigned GET URL for a fully prepared custom test file previously uploaded via the storage PUT-presign endpoint. When provided, no test-case generation runs: the file is ingested as-is, the test is created in `SUCCESS` state, and `maxTestCases`, generator-related fields, and credit checks are skipped. Cannot be combined with `sourceTestId` or `dataCatalogUri`. Must be non-empty.","example":"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."},"fewShot":{"type":"string","description":"Optional few-shot examples used to guide test-case generation for QUALITY tests.","example":"Q: What is 2+2? A: 4"},"languageCode":{"type":"string","example":"en"},"variants":{"type":"array","items":{"type":"string"},"example":["rag"],"description":"Test variants. QUALITY: rag, entity_extraction, summarization, classification, translation, correction, other. RED_TEAMING: data_leakage, financial_attacks, illegal_activities, misuse, toxicity, custom."},"customVariantDescription":{"type":"string","description":"Custom variant description","example":"Custom test variant"},"strategies":{"type":"array","items":{"type":"string"},"example":["original"],"description":"Generation strategies. \"original\" is the default for RED_TEAMING. At least one strategy is required for SCENARIOS tests."},"customUserPersona":{"type":"string","example":"Business analyst"},"maxTestCases":{"type":"integer","example":100},"maxIterations":{"type":"integer","minimum":1,"description":"SCENARIOS only. Maximum number of conversation turns per generated scenario when scenario generation is executed. If omitted, the scenario-generator default is used. If `uri` is provided, no scenario generation runs, so this field is ignored at test-creation time. When generation runs, the value is forwarded to the scenario-generator and persisted on each generated test case. Ignored for QUALITY and RED_TEAMING tests.","example":10},"models":{"type":"array","items":{"type":"string"},"example":["gpt-4"]},"sourceTestId":{"type":"string","description":"Source QUALITY test ID whose approved test cases seed a SCENARIOS test. Only valid when `type = SCENARIOS`. Cannot be combined with `uri` or `groundTruthUri`.","example":"test_123"},"dataCatalogUri":{"type":"string","description":"Presigned GET URL for a data-catalog file previously uploaded via the storage PUT-presign endpoint. Only valid when `type = SCENARIOS`. Cannot be combined with `uri`.","example":"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."},"metadata":{"type":"object","nullable":true,"description":"Arbitrary key-value metadata","example":{"key":"value"}}}},"TestUpdateInput":{"type":"object","additionalProperties":false,"description":"Test update payload. Only `name` and `metadata` are mutable post-creation — any other field (type, variants, URIs, strategies, etc.) will be rejected with a 400.","properties":{"name":{"type":"string","description":"New test name. Must be a non-empty string; leading/trailing whitespace is trimmed.","example":"Quality Test (renamed)"},"metadata":{"type":"object","nullable":true,"description":"Arbitrary key-value metadata. Replaces the existing metadata object wholesale.","example":{"key":"value"}}}},"Version":{"type":"object","properties":{"id":{"type":"string","example":"ver_123"},"productId":{"type":"string","example":"prod_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"1.0.0"},"description":{"type":"string","nullable":true,"example":"Version description"},"modelId":{"type":"string","nullable":true,"example":"model_123"},"systemPrompt":{"type":"string","nullable":true,"example":"You are a helpful assistant"},"datasetUri":{"type":"string","nullable":true,"example":"https://example.com/dataset.csv"},"datasetDescription":{"type":"string","nullable":true,"example":"Training dataset"},"guardrails":{"type":"string","nullable":true,"example":"Safety guidelines"},"initializationEndpointConnectionId":{"type":"string","nullable":true,"example":"ec_123"},"conversationEndpointConnectionId":{"type":"string","nullable":true,"example":"ec_123"},"finalizationEndpointConnectionId":{"type":"string","nullable":true,"example":"ec_123"},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"TestCase":{"type":"object","properties":{"id":{"type":"string","example":"tc_123"},"testId":{"type":"string","example":"test_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"input":{"type":"object","nullable":true,"description":"Structured input data. For plain text input, format is { user_message: \"...\" }","example":{"user_message":"What is the capital of France?"}},"expectedOutput":{"type":"string","nullable":true,"example":"Paris"},"expectedTools":{"type":"array","items":{"type":"string"},"example":["search","calculator"]},"context":{"type":"object","nullable":true,"description":"Structured context data. For plain text context, format is { value: \"...\" }","example":{"value":"Geography question"}},"source":{"type":"string","nullable":true,"example":"manual"},"sourceFile":{"type":"string","nullable":true},"confidence":{"type":"number","nullable":true,"example":0.95},"confidenceReason":{"type":"string","nullable":true,"example":"High quality data"},"variant":{"type":"string","nullable":true,"example":"VARIANT_1"},"strategy":{"type":"string","nullable":true,"example":"STRATEGY_1"},"languageCode":{"type":"string","nullable":true,"example":"en"},"userPersona":{"type":"string","nullable":true,"example":"Student"},"scenario":{"type":"string","nullable":true,"example":"Educational quiz"},"goal":{"type":"string","nullable":true,"example":"Test geographical knowledge"},"stoppingCriterias":{"type":"array","items":{"type":"string"},"example":["MAX_ITERATIONS","GOAL_ACHIEVED"]},"maxIterations":{"type":"integer","nullable":true,"example":10},"isAugmented":{"type":"boolean","example":false},"reviewedById":{"type":"string","nullable":true,"example":"user_456"},"userScore":{"type":"integer","nullable":true,"example":5},"userScoreReason":{"type":"string","nullable":true,"example":"Accurate and complete"},"creditsUsed":{"type":"integer","nullable":true,"example":1},"sourceTestCaseId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Evaluation":{"type":"object","properties":{"id":{"type":"string","example":"eval_123"},"metricId":{"type":"string","example":"metric_123"},"sessionId":{"type":"string","example":"session_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"status":{"type":"string","enum":["PENDING","PENDING_HUMAN","SUCCESS","FAILED","SKIPPED"],"example":"SUCCESS"},"testCaseId":{"type":"string","nullable":true,"example":"tc_123"},"inferenceResultId":{"type":"string","nullable":true,"example":"ir_123"},"score":{"type":"number","nullable":true,"example":0.95},"reason":{"type":"string","nullable":true,"example":"High quality response"},"error":{"type":"string","nullable":true},"canRetry":{"type":"boolean","nullable":true,"example":false},"creditsUsed":{"type":"integer","nullable":true,"example":1},"conversationSimulatorVersion":{"type":"string","nullable":true,"example":"1.0.0"},"humanEvaluatorId":{"type":"string","nullable":true,"description":"User ID of the human evaluator"},"humanEvaluatorStartedAt":{"type":"string","format":"date-time","nullable":true},"humanScore":{"type":"number","nullable":true,"description":"Human-provided annotation score"},"humanReason":{"type":"string","nullable":true,"description":"Human-provided annotation reason"},"humanEvaluatorFinishedAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when human evaluation was submitted"},"failedTurns":{"type":"array","items":{"type":"string"},"description":"Conversation turns that failed"},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true},"evaluatedAt":{"type":"string","format":"date-time","nullable":true},"metricLegacyAt":{"type":"string","format":"date-time","nullable":true},"metricDisabledAt":{"type":"string","format":"date-time","nullable":true}}},"User":{"type":"object","properties":{"id":{"type":"string","example":"user_123"},"email":{"type":"string","format":"email","example":"user@example.com"},"name":{"type":"string","nullable":true,"example":"John Doe"},"role":{"type":"string","enum":["ADMIN","OWNER","MEMBER"],"nullable":true,"example":"MEMBER"},"organizationId":{"type":"string","example":"org_123"},"hasPassword":{"type":"boolean","description":"Whether the user has a password set"},"hasGoogleId":{"type":"boolean","description":"Whether the user has a linked Google account"},"hasGithubId":{"type":"boolean","description":"Whether the user has a linked GitHub account"},"hasGitlabId":{"type":"boolean","description":"Whether the user has a linked GitLab account"},"hasSamlId":{"type":"boolean","description":"Whether the user has a linked SAML account"},"analyticsConsent":{"type":"boolean","nullable":true,"example":null},"marketingConsent":{"type":"boolean","example":false},"mfaSource":{"type":"string","enum":["EMAIL"],"nullable":true,"example":null,"description":"Preferred MFA source; non-null enables MFA, null disables it. Currently only \"EMAIL\" is supported."},"firstSignInAt":{"type":"string","format":"date-time","nullable":true},"latestSignInAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Organization":{"type":"object","properties":{"id":{"type":"string","example":"org_123"},"name":{"type":"string","example":"Example Organization"},"remainingSubscriptionCredits":{"type":"integer","nullable":true,"example":1000},"extraCredits":{"type":"integer","example":500},"lastWarningAt":{"type":"string","format":"date-time","nullable":true},"warningAt":{"type":"integer","nullable":true},"stripeCustomerId":{"type":"string","nullable":true,"example":"cus_123"},"samlEntrypointUrl":{"type":"string","nullable":true},"samlEntityId":{"type":"string","nullable":true},"samlIssuerId":{"type":"string","nullable":true},"samlPublicCertificate":{"type":"string","nullable":true},"samlSignedResponse":{"type":"boolean","nullable":true},"samlSignedAssertions":{"type":"boolean","nullable":true},"samlTeamSlug":{"type":"string","nullable":true},"enforceMfa":{"type":"boolean","default":false,"description":"When true, every member of the organization must complete an MFA challenge to sign in. Settable by Owners (via update) and Admins (via create or update)."},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Model":{"type":"object","properties":{"id":{"type":"string","example":"model_123"},"organizationId":{"type":"string","nullable":true,"example":"org_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"GPT-4"},"inputCostPerToken":{"type":"number","nullable":true,"example":0.00001},"outputCostPerToken":{"type":"number","nullable":true,"example":0.00003},"cacheReadInputTokenCost":{"type":"number","nullable":true,"example":0.000005},"cacheCreationInputTokenCost":{"type":"number","nullable":true,"example":0.000015},"inputCostPerTokenAbove128kTokens":{"type":"number","nullable":true,"example":0.00002},"outputCostPerTokenAbove128kTokens":{"type":"number","nullable":true,"example":0.00006},"tokenizerProvider":{"type":"string","nullable":true,"example":"OPENAI"},"source":{"type":"string","enum":["PREDEFINED","CUSTOM"],"nullable":true,"example":"PREDEFINED"},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Metric":{"type":"object","properties":{"id":{"type":"string","example":"metric_123"},"metricGroupId":{"type":"string","readOnly":true,"example":"metric_123","description":"Identifier shared by every metric in the same revision family. Server-managed — derived from `parentMetricId` on create (or generated for roots). Cannot be set by the caller."},"parentMetricId":{"type":"string","nullable":true,"example":"metric_122","description":"Id of the direct parent metric. On create, providing this value turns the new metric into a revision: it joins the parent's family and (if the parent is active) flips the parent to legacy. Omit or null to create a root metric in a fresh group. On responses, this is the recorded parent edge (null for roots)."},"organizationId":{"type":"string","nullable":true,"example":"org_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"Accuracy"},"evaluationParams":{"type":"array","items":{"type":"string"},"example":["input","actualOutput","expectedOutput"],"description":"Ordered list of inference-result fields the evaluator needs (e.g. input, actualOutput, expectedOutput, retrievalContext). Determines which data the evaluation engine extracts from each inference result."},"source":{"type":"string","enum":["SELF_HOSTED","FULL_PROMPT","PARTIAL_PROMPT","HUMAN_EVALUATION","GEVAL","DEEPEVAL","DETERMINISTIC"],"nullable":true,"example":"FULL_PROMPT"},"judgePrompt":{"type":"string","nullable":true,"example":"Evaluate the accuracy of the response"},"tags":{"type":"array","items":{"type":"string"},"example":["accuracy","quality"]},"description":{"type":"string","nullable":true,"example":"Measures the accuracy of responses"},"documentationUrl":{"type":"string","nullable":true,"example":"https://docs.example.com/metrics/accuracy"},"evaluatorModelName":{"type":"string","nullable":true,"example":"GPT-4"},"areEvalParamsTop":{"type":"boolean","nullable":true,"description":"When true, evaluationParams are injected at the top level of the evaluator prompt instead of nested inside the conversation context."},"isBeingOptimized":{"type":"boolean","readOnly":true,"description":"Whether the metric is currently being optimized."},"specificationIds":{"type":"array","items":{"type":"string"},"example":["spec_123"]},"userGroupIds":{"type":"array","items":{"type":"string"},"example":["ug_123"]},"createdAt":{"type":"string","format":"date-time"},"legacyAt":{"type":"string","format":"date-time","nullable":true},"disabledAt":{"type":"string","format":"date-time","nullable":true}}},"CompatibleMetric":{"type":"object","description":"Metric annotated with compatibility against the evaluation context (product metadata + conversation endpoint connection output mapping). Trace-dependent and runtime-only params are out of scope and treated as always satisfied.","properties":{"id":{"type":"string","example":"metric_123"},"name":{"type":"string","example":"Accuracy"},"source":{"type":"string","enum":["SELF_HOSTED","FULL_PROMPT","PARTIAL_PROMPT","HUMAN_EVALUATION","GEVAL","DEEPEVAL","DETERMINISTIC"],"nullable":true,"example":"FULL_PROMPT"},"description":{"type":"string","nullable":true,"example":"Measures the accuracy of responses"},"isCompatible":{"type":"boolean","description":"Whether the metric can be satisfied by the resolved product metadata and conversation endpoint connection output mapping."},"incompatibilityReason":{"type":"string","nullable":true,"description":"Human-readable explanation of why the metric is incompatible. Non-null iff `isCompatible === false`.","example":"Missing required parameters: product_capabilities, retrieval_context"}},"required":["id","name","isCompatible"]},"Session":{"type":"object","properties":{"id":{"type":"string","example":"session_123"},"customId":{"type":"string","nullable":true,"example":"custom_session_123"},"versionId":{"type":"string","example":"ver_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"testCaseId":{"type":"string","nullable":true,"example":"tc_123"},"context":{"type":"object","nullable":true,"description":"Structured context data. For plain text context, format is { value: \"...\" }","example":{"value":"Session context information"}},"stoppingReason":{"type":"string","nullable":true,"example":"GOAL_ACHIEVED"},"error":{"type":"string","nullable":true,"example":"External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"],"example":"PENDING"},"metadata":{"type":"object","nullable":true,"example":{"key":"value"}},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"SessionInput":{"description":"Session creation input. For non-production sessions, testCaseId is required and context is not allowed. For production sessions (isProduction=true), testCaseId must be omitted and context is allowed.","oneOf":[{"type":"object","required":["versionId","testCaseId"],"properties":{"versionId":{"type":"string","description":"Version ID to create the session for","example":"ver_123"},"customId":{"type":"string","description":"Optional caller-defined identifier for the session","example":"my-session-1"},"testCaseId":{"type":"string","description":"Test case to link this session to. Required for non-production sessions.","example":"tc_123"},"isProduction":{"type":"boolean","enum":[false],"description":"When false (default), creates a non-production session linked to a test case.","default":false},"metadata":{"type":"object","description":"Arbitrary key-value metadata","example":{"key":"value"}},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"],"default":"COMPLETED","description":"Initial session status"}}},{"type":"object","required":["versionId"],"properties":{"versionId":{"type":"string","description":"Version ID to create the session for","example":"ver_123"},"customId":{"type":"string","description":"Optional caller-defined identifier for the session","example":"my-session-1"},"isProduction":{"type":"boolean","enum":[true],"description":"When true, creates a production session with no test case. testCaseId must be omitted and context may be provided."},"context":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}],"description":"Additional context for the session. Accepts a plain string or a structured JSON object. Only allowed for production sessions."},"metadata":{"type":"object","description":"Arbitrary key-value metadata","example":{"key":"value"}},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"],"default":"COMPLETED","description":"Initial session status"}}}]},"InferenceResult":{"type":"object","properties":{"id":{"type":"string","example":"ir_123"},"sessionId":{"type":"string","example":"session_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"index":{"type":"integer","example":0,"description":"Order index within the session"},"status":{"type":"string","enum":["PENDING","GENERATED","FAILED","SKIPPED"],"example":"PENDING"},"error":{"type":"string","nullable":true,"description":"Error message explaining why this inference result failed or was skipped","example":null},"input":{"type":"object","nullable":true,"description":"Structured input data. For plain text input, format is { user_message: \"...\" }","example":{"user_message":"User input text"}},"actualOutput":{"type":"string","nullable":true,"example":"Model response"},"retrievalContext":{"type":"string","nullable":true,"description":"The RAG retrieval context (retrieved documents/snippets) used to generate the actual output. Used by RAG-aware evaluation metrics."},"latency":{"type":"integer","nullable":true,"example":150},"inputTokens":{"type":"integer","nullable":true,"example":100},"outputTokens":{"type":"integer","nullable":true,"example":50},"cacheReadInputTokens":{"type":"integer","nullable":true,"example":20},"tokens":{"type":"integer","nullable":true,"example":150,"description":"Total tokens"},"costPerInputToken":{"type":"number","nullable":true,"example":0.00001},"costPerOutputToken":{"type":"number","nullable":true,"example":0.00003},"costPerCacheReadInputToken":{"type":"number","nullable":true,"example":0.000005},"cost":{"type":"number","nullable":true,"example":0.001},"creditsUsed":{"type":"integer","nullable":true,"example":1},"conversationSimulatorVersion":{"type":"string","nullable":true,"example":"1.0.0"},"traceId":{"type":"string","nullable":true,"example":"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4","description":"W3C trace ID for the root span created during direct inference. The same trace ID is propagated to the user endpoint via the traceparent header."},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Trace":{"type":"object","properties":{"id":{"type":"string","example":"trace_123"},"inferenceResultId":{"type":"string","example":"ir_123"},"name":{"type":"string","example":"fetch_user_data"},"type":{"type":"string","enum":["SPAN","GENERATION","EVENT","AGENT","TOOL","CHAIN","RETRIEVER","EVALUATOR","EMBEDDING","GUARDRAIL"],"nullable":true,"example":"TOOL"},"description":{"type":"string","nullable":true,"example":"Fetches user data from the database by ID","description":"Human-readable description of the operation. Maximum 1MB."},"inputData":{"type":"object","nullable":true,"example":{"user_id":"123"},"description":"Input parameters passed to the operation"},"outputData":{"type":"object","nullable":true,"example":{"name":"John Doe","email":"john@example.com"},"description":"Result returned by the operation"},"error":{"type":"string","nullable":true,"example":"Connection timeout","description":"Error message if failed"},"latencyMs":{"type":"number","nullable":true,"example":45.5,"description":"Execution time in milliseconds"},"metadata":{"type":"object","nullable":true,"example":{"model":"gpt-4","temperature":0.7},"description":"Additional custom metadata"},"parentTraceId":{"type":"string","nullable":true,"example":"trace_parent_123","description":"ID of parent trace for hierarchical relationships"},"startTime":{"type":"string","format":"date-time","nullable":true},"endTime":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"Specification":{"type":"object","properties":{"id":{"type":"string","example":"spec_123"},"productId":{"type":"string","example":"prod_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"description":{"type":"string","example":"Product must respond accurately to user queries"},"type":{"type":"string","enum":["CAPABILITY","INABILITY","POLICY"],"example":"CAPABILITY"},"testType":{"type":"string","nullable":true,"enum":["QUALITY","RED_TEAMING","SCENARIOS"],"example":"QUALITY","description":"Only applicable for POLICY specifications. Must be null for CAPABILITY and INABILITY."},"testVariant":{"type":"string","nullable":true,"example":"rag","description":"Only applicable for POLICY specifications. QUALITY: rag, entity_extraction, summarization, classification, translation, correction, other. RED_TEAMING: data_leakage, financial_attacks, illegal_activities, misuse, toxicity, custom."},"useForTestAlignment":{"type":"boolean","example":true},"metricIds":{"type":"array","items":{"type":"string"},"example":["metric_123"]},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}},"UserGroup":{"type":"object","properties":{"id":{"type":"string","example":"ug_123"},"organizationId":{"type":"string","example":"org_123"},"name":{"type":"string","example":"QA Team"},"type":{"type":"string","enum":["EVALUATOR"],"example":"EVALUATOR"},"description":{"type":"string","nullable":true,"example":"Quality assurance team"},"createdAt":{"type":"string","format":"date-time"},"userIds":{"type":"array","items":{"type":"string"},"example":["user_123"]},"metricIds":{"type":"array","items":{"type":"string"},"example":["metric_123"]}}},"Error":{"type":"object","properties":{"error":{"type":"string","example":"Error type"},"message":{"type":"string","example":"Error message description"}}},"EndpointConnection":{"type":"object","required":["productId","name","url","httpMethod","authType","inputTemplate","outputMapping"],"properties":{"id":{"type":"string","example":"ec_123"},"productId":{"type":"string","example":"prod_123"},"userId":{"type":"string","nullable":true,"example":"user_123"},"name":{"type":"string","example":"My API Connection"},"url":{"type":"string","example":"https://api.example.com/v1/chat/completions"},"httpMethod":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"example":"POST"},"authType":{"type":"string","enum":["NONE","BEARER","API_KEY","BASIC","OAUTH2"],"example":"BEARER"},"hasAuthToken":{"type":"boolean","description":"Whether an auth token is configured (token value is not exposed)"},"username":{"type":"string","nullable":true,"description":"Username for Basic auth"},"hasPassword":{"type":"boolean","description":"Whether a password is configured (password value is not exposed)"},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"example":{"Content-Type":"application/json"}},"inputTemplate":{"type":"string","nullable":true,"description":"Jinja2/Nunjucks template for request body. Must contain {{ input.user_message }} placeholder.","example":"{\"prompt\": \"{{ input.user_message }}\"}"},"inputSchema":{"type":"object","nullable":true,"description":"Optional JSON Schema (draft 2020-12) defining the structure of input fields, their types, and valid values. Must have type \"object\" with a \"properties\" key.","example":{"type":"object","properties":{"user_message":{"type":"string","description":"The main user message to the agent"},"reasoning_level":{"type":"string","enum":["low","medium","high"],"description":"How much reasoning the agent should apply"},"topic":{"type":"string","enum":["billing","shipping","returns","account"],"description":"Conversation topic"},"customer_id":{"type":"string","pattern":"^C-\\d{3,6}$","description":"Customer identifier"}},"required":["user_message"]}},"outputMapping":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"JSONPath expressions to extract values from API response. Must include \"output\" key.","example":{"output":"$.choices[0].message.content"}},"type":{"type":"string","enum":["INITIALIZATION","CONVERSATION","FINALIZATION"],"example":"CONVERSATION"},"timeout":{"type":"integer","nullable":true,"default":60,"example":60,"description":"Timeout in seconds"},"rateLimit":{"type":"integer","nullable":true,"example":60,"description":"Maximum requests per minute"},"retryEnabled":{"type":"boolean","default":false,"description":"Whether automatic retry is enabled for failed requests"},"retryMaxAttempts":{"type":"integer","nullable":true,"minimum":0,"maximum":10,"default":3,"description":"Maximum number of retry attempts (applied when retryEnabled is true)"},"retryInitialDelayMs":{"type":"integer","nullable":true,"minimum":0,"default":1000,"description":"Initial delay in milliseconds before first retry"},"retryBackoffStrategy":{"type":"string","nullable":true,"enum":["FIXED","EXPONENTIAL","LINEAR"],"default":"EXPONENTIAL","description":"Strategy for increasing delay between retries"},"retryMaxDelayMs":{"type":"integer","nullable":true,"minimum":0,"default":30000,"description":"Maximum delay cap in milliseconds"},"retryableStatusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"default":[429,500,502,503,504],"description":"HTTP status codes that should trigger a retry"},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}}}},"security":[{"bearerAuth":[]}],"paths":{"/health":{"get":{"summary":"Health check","description":"Health check endpoint to verify API is running. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"healthCheck","x-cli-name":"health","security":[],"responses":{"200":{"description":"API is running","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"message":{"type":"string","example":"API is running"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/auth/user":{"get":{"tags":["auth"],"summary":"Get current user","description":"Get the currently authenticated user. See [Registration & Authentication](https://docs.galtea.ai/registration).","operationId":"getCurrentUser","x-cli-name":"get-current-user","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations":{"get":{"tags":["organizations"],"summary":"Get organizations","description":"Get list of organizations with pagination and filtering. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"getOrganizations","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by organization name","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Organizations retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{id}":{"get":{"tags":["organizations"],"summary":"Get organization by ID","description":"Get a specific organization by ID. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"getOrganizationById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Organization ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{id}/creditStatus":{"get":{"tags":["organizations"],"summary":"Get credit status","description":"Returns the current credit status for the organization, used for the credit warning badge. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"getOrganizationCreditStatus","x-cli-name":"get-credit-status","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Organization ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Credit status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"totalCredits":{"type":"number"},"usedCredits":{"type":"number"},"remainingCredits":{"type":"number"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/userGroups":{"get":{"tags":["user-groups"],"summary":"Get user groups","description":"Get list of user groups with pagination and filtering. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"getUserGroups","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by user group IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"types","in":"query","style":"form","explode":true,"description":"Filter by user group types","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"userIds","in":"query","style":"form","explode":true,"description":"Filter by user IDs (groups containing these users)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"metricIds","in":"query","style":"form","explode":true,"description":"Filter by metric IDs (groups linked to these metrics)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by user group names","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"fromCreatedAt","in":"query","description":"Filter groups created at or after this timestamp (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter groups created at or before this timestamp (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"User groups retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserGroup"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["user-groups"],"summary":"Create user group","description":"Create a new user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"createUserGroup","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","organizationId"],"properties":{"name":{"type":"string","example":"Example Name"},"organizationId":{"type":"string","example":"org_123"},"type":{"type":"string"},"description":{"type":"string","example":"A description"}}}}}},"responses":{"201":{"description":"User group created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroup"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/userGroups/{id}":{"get":{"tags":["user-groups"],"summary":"Get user group by ID","description":"Get a specific user group by ID. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"getUserGroupById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User group retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroup"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["user-groups"],"summary":"Update user group","description":"Update an existing user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"updateUserGroup","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"example":"Example Name","type":"string"}}}}}},"responses":{"200":{"description":"User group updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserGroup"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["user-groups"],"summary":"Delete user group","description":"Soft delete a user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"deleteUserGroup","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"User group deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/userGroups/{id}/users":{"post":{"tags":["user-groups"],"summary":"Link users to user group","description":"Add users to a user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"linkUsersToUserGroup","x-cli-name":"link-users","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userIds"],"properties":{"userIds":{"type":"array","example":["user_123","user_456"],"items":{"type":"string"}}}}}}},"responses":{"204":{"description":"Users linked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["user-groups"],"summary":"Unlink users from user group","description":"Remove users from a user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"unlinkUsersFromUserGroup","x-cli-name":"unlink-users","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userIds"],"properties":{"userIds":{"type":"array","example":["user_123","user_456"],"items":{"type":"string"}}}}}}},"responses":{"204":{"description":"Users unlinked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/userGroups/{id}/metrics":{"post":{"tags":["user-groups"],"summary":"Link metrics to user group","description":"Add metrics to a user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"linkMetricsToUserGroup","x-cli-name":"link-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metricIds"],"properties":{"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"}}}}}}},"responses":{"204":{"description":"Metrics linked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["user-groups"],"summary":"Unlink metrics from user group","description":"Remove metrics from a user group. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"unlinkMetricsFromUserGroup","x-cli-name":"unlink-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"User group ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metricIds"],"properties":{"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"}}}}}}},"responses":{"204":{"description":"Metrics unlinked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"User group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/userGroups/batch":{"delete":{"tags":["user-groups"],"summary":"Delete multiple user groups","description":"Soft delete multiple user groups by their IDs. See [User Groups](https://docs.galtea.ai/concepts/user-group).","operationId":"deleteUserGroups","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of user group IDs to delete"}}}}}},"responses":{"204":{"description":"User groups deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics":{"get":{"tags":["metrics"],"summary":"Get metrics","description":"Get list of metrics with pagination and filtering. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"getMetrics","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by metric IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by metric names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by metric name (partial match)","required":false,"schema":{"type":"string"}},{"name":"description","in":"query","description":"Filter by metric description (partial match)","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","style":"form","explode":true,"description":"Filter by tags","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sources","in":"query","style":"form","explode":true,"description":"Filter by metric sources","required":false,"schema":{"type":"array","items":{"type":"string","enum":["SELF_HOSTED","FULL_PROMPT","PARTIAL_PROMPT","HUMAN_EVALUATION","GEVAL","DEEPEVAL","DETERMINISTIC"]}}},{"name":"specificationIds","in":"query","style":"form","explode":true,"description":"Filter by specification IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"userGroupIds","in":"query","style":"form","explode":true,"description":"Filter by user group IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"fromCreatedAt","in":"query","description":"Filter metrics created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter metrics created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"includeDefaultEntities","in":"query","description":"Include default/predefined metrics","required":false,"schema":{"type":"boolean"}},{"name":"includeOwnEntities","in":"query","description":"Include metrics owned by the user's organization","required":false,"schema":{"type":"boolean"}},{"name":"includeLegacy","in":"query","description":"Include legacy/deprecated metrics","required":false,"schema":{"type":"boolean"}},{"name":"suitableForMonitoring","in":"query","description":"Filter metrics suitable for monitoring","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Metrics retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["metrics"],"summary":"Create metric","description":"Create a new metric. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"createMetric","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"responses":{"201":{"description":"Metric created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/{id}":{"get":{"tags":["metrics"],"summary":"Get metric by ID","description":"Get a specific metric by ID. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"getMetricById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Metric ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metric retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["metrics"],"summary":"Update metric","description":"Update an existing metric. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"updateMetric","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Metric ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"responses":{"200":{"description":"Metric updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["metrics"],"summary":"Delete metric","description":"Soft delete a metric. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"deleteMetric","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Metric ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Metric deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/batch":{"delete":{"tags":["metrics"],"summary":"Delete multiple metrics","description":"Soft delete multiple metrics by their IDs. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"deleteMetrics","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of metric IDs to delete"}}}}}},"responses":{"204":{"description":"Metrics deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["metrics"],"summary":"Create multiple metrics","description":"Create multiple metrics at once. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"batchCreateMetrics","x-cli-name":"create-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metrics"],"properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}}}},"responses":{"201":{"description":"Metrics created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/generate-config":{"post":{"tags":["metrics"],"summary":"Generate metric configuration from specifications","description":"Generates metric configurations using AI for the given specifications. Optionally creates metrics automatically. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"generateMetricConfig","x-cli-name":"generate-config","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["specificationIds"],"properties":{"specificationIds":{"type":"array","example":["spec_123","spec_456"],"items":{"type":"string"},"description":"IDs of the specifications to generate metrics for"},"automaticCreation":{"type":"boolean","description":"When true, creates metrics from generated config","example":false},"maxMetricsPerSpecification":{"type":"integer","description":"Maximum number of metrics to generate per specification"},"isOnboarding":{"type":"boolean","description":"Whether this is an onboarding flow","example":false}}}}}},"responses":{"200":{"description":"Metric configuration generated successfully","content":{"application/json":{"schema":{"type":"object","description":"Generated metric configuration suggestion"}}}},"201":{"description":"Metrics created from generated configuration","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/{id}/human-annotation-count":{"get":{"tags":["metrics"],"summary":"Get human annotation count and optimization eligibility","description":"Returns the optimization-eligibility snapshot for a metric.\n\n`count` is the number of evaluations that have both an AI score and a\nhuman-provided score (annotation). For FULL_PROMPT/PARTIAL_PROMPT metrics\nthis means the AI judged the evaluation and a human later reviewed it.\nFor HUMAN_EVALUATION metrics both fields hold the same human-provided\nvalue (for analytics compatibility).\n\n`disagreementCount` is the subset of `count` where the human score differs\nfrom the AI score: these are the rows the optimizer learns from.\n\n`minAnnotations` and `minDisagreements` are the api-enforced thresholds\n(mirrored from the metrics-generator hard thresholds). Optimize is rejected\nearly unless `count >= minAnnotations` AND `disagreementCount >= minDisagreements`.\n","operationId":"getMetricHumanAnnotationCount","x-cli-name":"get-annotation-count","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Metric ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Annotation/disagreement counts and thresholds retrieved successfully","content":{"application/json":{"schema":{"type":"object","required":["count","disagreementCount","minAnnotations","minDisagreements"],"properties":{"count":{"type":"integer","description":"Evaluations with both an AI score and a human score."},"disagreementCount":{"type":"integer","description":"Subset of `count` where the human score differs from the AI score."},"minAnnotations":{"type":"integer","description":"Minimum annotations required to optimize this metric."},"minDisagreements":{"type":"integer","description":"Minimum disagreements required to optimize this metric."}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/{id}/replay-candidate-count":{"get":{"tags":["metrics"],"summary":"Count replay candidates per product for a metric revision","description":"For each requested product, returns how many historical evaluations in this metric's group would be replayed against this revision. Any `(sessionId, inferenceResultId)` pair already evaluated with this metric is excluded. Products with no candidates return `count: 0`.\n","operationId":"getReplayCandidateCount","x-cli-name":"get-replay-candidate-count","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Metric revision ID","required":true,"schema":{"type":"string"}},{"name":"productIds","in":"query","required":true,"description":"Repeated query param; one value per product.","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Candidate counts per product","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"count":{"type":"integer"}}}}}}},"400":{"description":"Invalid query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric or product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/metrics/{id}/optimize":{"post":{"tags":["metrics"],"summary":"Optimize metric","description":"Creates an optimized copy of a metric by sending its human-annotated evaluations to the metrics-generator service, which uses the gap between AI and human scores to produce a better judge prompt. Only FULL_PROMPT and PARTIAL_PROMPT metrics owned by an organization can be optimized. Rejected with 400 unless the metric has at least `minAnnotations` evaluations annotated by a human AND `minDisagreements` of those disagree with the AI score; both thresholds are returned by `GET /metrics/{id}/human-annotation-count` (defaults `10` and `5`, configurable via the `OPTIMIZE_MIN_ANNOTATIONS_HARD` / `OPTIMIZE_MIN_DISAGREEMENTS_HARD` env vars). 30+ annotations recommended for best optimizer signal. Returns a placeholder metric with isBeingOptimized=true. See [Metrics](https://docs.galtea.ai/concepts/metric).","operationId":"optimizeMetric","x-cli-name":"optimize","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Source Metric ID","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Optimized metric placeholder created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"400":{"description":"Metric is not eligible for optimization (wrong source, no organizationId, fewer than `minAnnotations` annotated evaluations, or fewer than `minDisagreements` annotations where the human score differs from the AI score). Read both thresholds and the current counts from `GET /metrics/{id}/human-annotation-count`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications":{"get":{"tags":["specifications"],"summary":"Get specifications","description":"Get list of specifications with pagination and filtering. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"getSpecifications","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by specification IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"types","in":"query","style":"form","explode":true,"description":"Filter by specification types (CAPABILITY, INABILITY, POLICY)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testTypes","in":"query","style":"form","explode":true,"description":"Filter by test types","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"metricIds","in":"query","style":"form","explode":true,"description":"Filter by linked metric IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"fromCreatedAt","in":"query","description":"Filter by creation date (from)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter by creation date (to)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Specifications retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Specification"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["specifications"],"summary":"Create specification","description":"Create a new specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"createSpecification","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"responses":{"201":{"description":"Specification created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications/{id}":{"get":{"tags":["specifications"],"summary":"Get specification by ID","description":"Get a specific specification by ID. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"getSpecificationById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Specification retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["specifications"],"summary":"Update specification","description":"Update an existing specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"updateSpecification","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"responses":{"200":{"description":"Specification updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Specification"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["specifications"],"summary":"Delete specification","description":"Soft delete a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"deleteSpecification","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Specification deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications/batch":{"post":{"tags":["specifications"],"summary":"Create multiple specifications","description":"Create multiple specifications at once. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"batchCreateSpecifications","x-cli-name":"create-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["specifications"],"properties":{"specifications":{"type":"array","items":{"$ref":"#/components/schemas/Specification"}}}}}}},"responses":{"201":{"description":"Specifications created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Specification"}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["specifications"],"summary":"Delete multiple specifications","description":"Soft delete multiple specifications by their IDs. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"deleteSpecifications","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of specification IDs to delete"}}}}}},"responses":{"204":{"description":"Specifications deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications/generate-config":{"post":{"tags":["specifications"],"summary":"Generate specification configuration","description":"Uses AI to suggest the specification type, test type, and test variant for a given description. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"generateSpecificationConfig","x-cli-name":"generate-config","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["description"],"properties":{"description":{"type":"string","description":"The policy specification description","example":"A description"},"productId":{"type":"string","description":"Optional product ID for additional context","example":"prod_123"}}}}}},"responses":{"200":{"description":"Configuration suggestion returned successfully","content":{"application/json":{"schema":{"type":"object","description":"Suggested specification configuration based on provided context"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications/{id}/metrics":{"post":{"tags":["specifications"],"summary":"Link metrics to specification","description":"Link one or more metrics to a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"linkMetricsToSpecification","x-cli-name":"link-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metricIds"],"properties":{"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"},"description":"Array of metric IDs to link"}}}}}},"responses":{"204":{"description":"Metrics linked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["specifications"],"summary":"Unlink metrics from specification","description":"Unlink one or more metrics from a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"unlinkMetricsFromSpecification","x-cli-name":"unlink-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metricIds"],"properties":{"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"},"description":"Array of metric IDs to unlink"}}}}}},"responses":{"204":{"description":"Metrics unlinked successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["specifications"],"summary":"Get linked metrics","description":"Get all metrics linked to a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"getSpecificationMetrics","x-cli-name":"list-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metrics retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Specification not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/specifications/{id}/tests":{"post":{"tags":["specifications"],"summary":"Link tests to specification","description":"Link one or more tests to a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"linkTestsToSpecification","x-cli-name":"link-tests","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testIds"],"properties":{"testIds":{"type":"array","items":{"type":"string"},"description":"Array of test IDs to link"}}}}}},"responses":{"204":{"description":"Tests linked successfully"},"400":{"description":"Invalid request body"},"401":{"description":"Unauthorized"},"404":{"description":"Specification not found"}}},"delete":{"tags":["specifications"],"summary":"Unlink tests from specification","description":"Unlink one or more tests from a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"unlinkTestsFromSpecification","x-cli-name":"unlink-tests","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testIds"],"properties":{"testIds":{"type":"array","items":{"type":"string"},"description":"Array of test IDs to unlink"}}}}}},"responses":{"204":{"description":"Tests unlinked successfully"},"400":{"description":"Invalid request body"},"401":{"description":"Unauthorized"},"404":{"description":"Specification not found"}}},"get":{"tags":["specifications"],"summary":"Get linked tests","description":"Get all tests linked to a specification. See [Specifications](https://docs.galtea.ai/concepts/product/specification).","operationId":"getSpecificationTests","x-cli-name":"list-tests","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Specification ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tests retrieved successfully"},"401":{"description":"Unauthorized"},"404":{"description":"Specification not found"}}}},"/models":{"get":{"tags":["models"],"summary":"Get models","description":"Get list of models with pagination and filtering. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"getModels","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by model IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by model names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by model name (partial match)","required":false,"schema":{"type":"string"}},{"name":"includeDefaultEntities","in":"query","description":"Include default/predefined models","required":false,"schema":{"type":"boolean"}},{"name":"includeOwnEntities","in":"query","description":"Include models owned by the user's organization","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter models created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter models created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Models retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["models"],"summary":"Create model","description":"Create a new model. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"createModel","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"responses":{"201":{"description":"Model created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models/{id}":{"get":{"tags":["models"],"summary":"Get model by ID","description":"Get a specific model by ID. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"getModelById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Model ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Model retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["models"],"summary":"Update model","description":"Update an existing model. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"updateModel","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Model ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"responses":{"200":{"description":"Model updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["models"],"summary":"Delete model","description":"Soft delete a model. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"deleteModel","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Model ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Model deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models/batch":{"delete":{"tags":["models"],"summary":"Delete multiple models","description":"Soft delete multiple models by their IDs. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"deleteModels","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of model IDs to delete"}}}}}},"responses":{"204":{"description":"Models deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"tags":["products"],"summary":"Get products","description":"Get list of products with pagination and filtering options. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"getProducts","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by product names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by product name (partial match)","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","style":"form","explode":true,"description":"Filter by tags (returns products with at least one matching tag)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"fromCreatedAt","in":"query","description":"Filter products created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter products created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort parameters","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results to return","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Products retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["products"],"summary":"Create product","description":"Create a new product. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"createProduct","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"description":"Product data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"201":{"description":"Product created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/tags":{"get":{"tags":["products"],"summary":"List distinct product tags","description":"Returns the sorted, distinct set of tags used across products in the requested\norganizations. Tags are returned lowercase and trimmed. Powers tag-suggestion\nUIs in the dashboard and the product-list tag filter.\n\nPer ADR 0006, callers must supply `organizationIds` (or be ADMIN). Non-admin\nusers requesting tags for an organization they cannot read receive 403.\n","operationId":"listProductTags","x-cli-name":"list-tags","security":[{"bearerAuth":[]}],"parameters":[{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs. Required for non-admin callers.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Tags retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"example":["beta","internal"]}}}},"400":{"description":"Missing tenant-scoping filter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to view tags for the requested organizations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/{id}":{"get":{"tags":["products"],"summary":"Get product by ID","description":"Get a specific product by ID. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"getProductById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["products"],"summary":"Update product","description":"Update an existing product. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"updateProduct","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Updated product data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"description":"Product updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["products"],"summary":"Delete product","description":"Soft delete a product. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"deleteProduct","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Product deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/batch":{"delete":{"tags":["products"],"summary":"Delete multiple products","description":"Soft delete multiple products by their IDs. See [Products](https://docs.galtea.ai/concepts/product).","operationId":"deleteProducts","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of product IDs to delete"}}}}}},"responses":{"204":{"description":"Products deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/generate-config":{"post":{"tags":["products"],"summary":"Generate product configuration using AI","description":"Uses AI to generate a refined product description and testable specifications\nfrom a product name and user description.\nOptionally accepts product specification files (documents, images, audio, video, code) to enrich the generation.\nSee [Products](https://docs.galtea.ai/concepts/product).\n","operationId":"generateProductConfig","x-cli-name":"generate-config","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"description":"Product name, user description, and optional specification files","content":{"multipart/form-data":{"schema":{"type":"object","required":["productName","userDescription"],"properties":{"productName":{"type":"string","description":"The name of the product","example":"Mobile Sales Assistant"},"userDescription":{"type":"string","description":"A brief description of what the product does","example":"A mobile sales assistant that helps customers find and compare smartphones based on their needs and budget"},"useDetailedGeneration":{"type":"string","description":"Whether to use detailed generation mode (uses heavier model)","example":"true"},"productSpecs":{"type":"array","items":{"type":"string","format":"binary"},"description":"Optional product specification files (max 50 files, 200MB total)"}}}}}},"responses":{"200":{"description":"Product configuration generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"specifications":{"type":"array"}}}}}},"400":{"description":"Bad request - missing required fields or invalid files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"AI generation failed"}}}},"/versions":{"get":{"tags":["versions"],"summary":"Get versions","description":"Get list of versions with pagination and filtering options. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"getVersions","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"conversationEndpointConnectionIds","in":"query","style":"form","explode":true,"description":"Filter by conversation endpoint connection IDs (include only). Use an empty string (\"\") to select versions without a conversation endpoint connection","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"excludeConversationEndpointConnectionIds","in":"query","style":"form","explode":true,"description":"Omit versions with the specified conversation endpoint connection IDs. Use an empty string (\"\") to omit versions without a conversation endpoint connection","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by version names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by version name (partial match)","required":false,"schema":{"type":"string"}},{"name":"existentInEvaluations","in":"query","description":"Filter versions that have evaluations","required":false,"schema":{"type":"boolean"}},{"name":"hasInferenceResults","in":"query","description":"Filter versions that have inference results","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter versions created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter versions created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Versions retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Version"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["versions"],"summary":"Create version","description":"Create a new version. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"createVersion","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}},"responses":{"201":{"description":"Version created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/versions/{id}":{"get":{"tags":["versions"],"summary":"Get version by ID","description":"Get a specific version by ID. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"getVersionById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Version ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Version retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["versions"],"summary":"Update version","description":"Update an existing version. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"updateVersion","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Version ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}},"responses":{"200":{"description":"Version updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["versions"],"summary":"Delete version","description":"Soft delete a version. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"deleteVersion","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Version ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Version deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/versions/{id}/compatible-metrics":{"get":{"tags":["versions"],"summary":"List metrics annotated with compatibility for a version","description":"Returns evaluable metrics annotated with whether they can be satisfied by the version's product metadata and conversation endpoint connection output mapping. Trace-dependent and runtime-only params are out of scope and treated as always satisfied.","operationId":"listCompatibleMetricsByVersion","x-cli-name":"list-compatible-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Version ID to evaluate compatibility against","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of metrics to return (default 100)","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of metrics with compatibility annotations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompatibleMetric"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/versions/batch":{"delete":{"tags":["versions"],"summary":"Delete multiple versions","description":"Soft delete multiple versions by their IDs. See [Versions](https://docs.galtea.ai/concepts/product/version).","operationId":"deleteVersions","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of version IDs to delete"}}}}}},"responses":{"204":{"description":"Versions deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/endpointConnections":{"get":{"tags":["endpoint-connections"],"summary":"Get endpoint connections","description":"Get list of endpoint connections with pagination and filtering. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"getEndpointConnections","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by endpoint connection IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by endpoint connection names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by endpoint connection name (partial match)","required":false,"schema":{"type":"string"}},{"name":"url","in":"query","description":"Filter by URL (partial match)","required":false,"schema":{"type":"string"}},{"name":"types","in":"query","style":"form","explode":true,"description":"Filter by endpoint connection types","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"httpMethods","in":"query","style":"form","explode":true,"description":"Filter by HTTP methods","required":false,"schema":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]}}},{"name":"authTypes","in":"query","style":"form","explode":true,"description":"Filter by authentication types","required":false,"schema":{"type":"array","items":{"type":"string","enum":["NONE","BEARER","API_KEY","BASIC"]}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter endpoint connections created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter endpoint connections created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Endpoint connections retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EndpointConnection"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["endpoint-connections"],"summary":"Create endpoint connection","description":"Create a new endpoint connection. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"createEndpointConnection","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointConnection"}}}},"responses":{"201":{"description":"Endpoint connection created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointConnection"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/endpointConnections/{id}":{"get":{"tags":["endpoint-connections"],"summary":"Get endpoint connection by ID","description":"Get a specific endpoint connection by ID. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"getEndpointConnectionById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"EndpointConnection ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Endpoint connection retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointConnection"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Endpoint connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["endpoint-connections"],"summary":"Update endpoint connection","description":"Update an existing endpoint connection. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"updateEndpointConnection","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"EndpointConnection ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointConnection"}}}},"responses":{"200":{"description":"Endpoint connection updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointConnection"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Endpoint connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["endpoint-connections"],"summary":"Delete endpoint connection","description":"Soft delete an endpoint connection. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"deleteEndpointConnection","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"EndpointConnection ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Endpoint connection deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Endpoint connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/endpointConnections/testConnection":{"post":{"tags":["endpoint-connections"],"summary":"Test endpoint connection","description":"Test an endpoint connection by making a sample request. Can be used in two modes: (1) Without an ID — all connection fields are required (creation flow). (2) With an ID — fetches the stored connection and applies any provided fields as overrides (update flow). See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).\n","operationId":"testEndpointConnection","x-cli-name":"test","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Optional ID of an existing endpoint connection. When provided, stored connection data is used as base and remaining fields act as overrides.","example":"id_123"},"url":{"type":"string","description":"The endpoint URL to test","example":"https://api.example.com"},"httpMethod":{"type":"string","description":"HTTP method (GET, POST, etc.)"},"authType":{"type":"string","description":"Authentication type (NONE, BEARER, API_KEY, BASIC)"},"authToken":{"type":"string","description":"Authentication token (for BEARER or API_KEY)"},"username":{"type":"string","description":"Username (for BASIC auth)"},"password":{"type":"string","description":"Password (for BASIC auth)","example":"securePass123!"},"headers":{"type":"object","description":"Custom headers as key-value pairs"},"inputTemplate":{"type":"string","description":"Input template with Jinja2 placeholders"},"timeout":{"type":"number","description":"Request timeout in seconds"}}}}}},"responses":{"200":{"description":"Test connection result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":"number"},"latency":{"type":"number"},"response":{"type":"object"},"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Endpoint connection not found (when id is provided)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/endpointConnections/batch":{"delete":{"tags":["endpoint-connections"],"summary":"Delete multiple endpoint connections","description":"Soft delete multiple endpoint connections by their IDs. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).","operationId":"deleteEndpointConnections","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of endpoint connection IDs to delete"}}}}}},"responses":{"204":{"description":"Endpoint connections deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tests":{"get":{"tags":["tests"],"summary":"Get tests","description":"Get list of tests with pagination and filtering options. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTests","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by test IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testCaseIds","in":"query","style":"form","explode":true,"description":"Filter by test case IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"versionIds","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by test names (exact match, multiple)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by test name (partial match)","required":false,"schema":{"type":"string"}},{"name":"types","in":"query","style":"form","explode":true,"description":"Filter by test types","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"specificationIds","in":"query","style":"form","explode":true,"description":"Filter by specification IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"existentInEvaluations","in":"query","description":"Filter tests that have evaluations","required":false,"schema":{"type":"boolean"}},{"name":"hasInferenceResults","in":"query","description":"Filter tests that have inference results","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter tests created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter tests created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Tests retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Test"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["tests"],"summary":"Create test","description":"Create a new test. See [Tests](https://docs.galtea.ai/concepts/product/test).\n\n**File uploads.** The `uri`, `groundTruthUri`, and `dataCatalogUri` fields of `TestInput`\neach expect a presigned GET URL (S3 `X-Amz-*` or Azure Blob SAS) for a file that was\nalready uploaded via the storage PUT-presign endpoint. The server strips the signing\nquery and persists the underlying storage URI (`s3://<bucket>/<key>` for S3, or the\nquery-less blob URL for Azure) on the created test.\n\nProviding `uri` switches the request into \"custom test file\" mode: generation is\nskipped, the test is created in `SUCCESS` state, and credit checks / `maxTestCases`\n/ generator-specific validations are bypassed.\n","operationId":"createTest","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"description":"Test data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestInput"}}}},"responses":{"201":{"description":"Test created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tests/types":{"get":{"tags":["tests"],"summary":"Get test types used by the organization","description":"Retrieves the non-repeated test types of all the products of the user's organization. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTestTypes","x-cli-name":"list-types","security":[{"bearerAuth":[]}],"parameters":[{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Test types retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"example":["QUALITY","RED_TEAMING","SCENARIOS"]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tests/batch":{"post":{"tags":["tests"],"summary":"Create multiple tests","description":"Create multiple tests at once. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"batchCreateTests","x-cli-name":"create-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tests"],"properties":{"tests":{"type":"array","items":{"$ref":"#/components/schemas/TestInput"}}}}}}},"responses":{"201":{"description":"Tests created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Test"}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["tests"],"summary":"Delete multiple tests","description":"Soft delete multiple tests by their IDs. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"deleteTests","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of test IDs to delete"}}}}}},"responses":{"204":{"description":"Tests deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tests/generate-config":{"post":{"tags":["tests"],"summary":"Generate test configuration from specifications","description":"Derives test type, variant, and name from specifications (rule-based). Optionally creates tests automatically. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"generateTestConfig","x-cli-name":"generate-config","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["specificationIds"],"properties":{"specificationIds":{"type":"array","example":["spec_123","spec_456"],"items":{"type":"string"},"description":"IDs of the specifications to generate test configs for"},"automaticCreation":{"type":"boolean","description":"When true, creates tests from generated config","example":false}}}}}},"responses":{"200":{"description":"Test configuration generated successfully","content":{"application/json":{"schema":{"type":"object","description":"Generated test configuration suggestion"}}}},"201":{"description":"Tests created from generated configuration","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Test"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tests/{id}":{"get":{"tags":["tests"],"summary":"Get test by ID","description":"Get a specific test by ID. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTestById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Test retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["tests"],"summary":"Update test","description":"Apply a partial update to an existing test. See [Tests](https://docs.galtea.ai/concepts/product/test).\n\n**Only `name` and `metadata` are mutable** post-creation. Attempting to update any\nother field (`type`, `variants`, `strategies`, `uri`, `groundTruthUri`,\n`dataCatalogUri`, `sourceTestId`, `maxTestCases`, etc.) returns a 400. Those are\nfixed for the lifetime of the test because they drive generation, credit accounting,\nand stored test-case shape.\n","operationId":"updateTest","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Fields to update. Only `name` and `metadata` are accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestUpdateInput"}}}},"responses":{"200":{"description":"Test updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Test"}}}},"400":{"description":"Bad request — disallowed field in payload or invalid value for `name` / `metadata`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["tests"],"summary":"Delete test","description":"Soft delete a test. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"deleteTest","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Test deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/testCases":{"get":{"tags":["test-cases"],"summary":"Get test cases","description":"Get list of test cases with pagination and filtering options. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTestCases","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by test case IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testIds","in":"query","style":"form","explode":true,"description":"Filter by test IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"input","in":"query","description":"Case-insensitive substring filter applied across the test case input JSON values","required":false,"schema":{"type":"string"}},{"name":"reviewed","in":"query","description":"Filter by review status","required":false,"schema":{"type":"boolean"}},{"name":"userScore","in":"query","description":"Filter by user score","required":false,"schema":{"type":"integer"}},{"name":"variants","in":"query","style":"form","explode":true,"description":"Filter by variants","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"strategies","in":"query","style":"form","explode":true,"description":"Filter by strategies","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"languages","in":"query","style":"form","explode":true,"description":"Filter by language codes","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sourceFiles","in":"query","style":"form","explode":true,"description":"Filter by source files","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"expectedTools","in":"query","style":"form","explode":true,"description":"Filter by expected tools","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"isAugmented","in":"query","description":"Filter by augmentation status","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter test cases created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter test cases created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Test cases retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TestCase"}}}}},"400":{"description":"Missing required filter. Provide at least one of the scoping filters (e.g. testIds, ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["test-cases"],"summary":"Create test case","description":"Create a new test case. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"createTestCase","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"}}}},"responses":{"201":{"description":"Test case created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/testCases/languages":{"get":{"tags":["test-cases"],"summary":"Get test case languages","description":"Get all available languages for test cases. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTestCaseLanguages","x-cli-name":"list-languages","security":[{"bearerAuth":[]}],"parameters":[{"name":"productId","in":"query","description":"Product ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Languages retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"string"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/testCases/export":{"post":{"tags":["test-cases"],"summary":"Export test cases as CSV","description":"Generate a CSV from the current DB state of the given test cases, upload to storage, and return a presigned download URL. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"exportTestCasesCsv","x-cli-name":"export-csv","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"testCaseIds":{"type":"array","example":["tc_123","tc_456"],"items":{"type":"string"},"description":"Array of test case IDs to export. Provide either `testCaseIds` or `testIds`."},"testIds":{"type":"array","example":["test_123","test_456"],"items":{"type":"string"},"description":"Array of test IDs for which to export test cases. Provide either `testCaseIds` or `testIds`."}}}}}},"responses":{"200":{"description":"CSV exported successfully","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"type":"string","description":"Presigned URL to download the CSV file"}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/testCases/{id}":{"get":{"tags":["test-cases"],"summary":"Get test case by ID","description":"Get a specific test case by ID. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getTestCaseById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test case ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Test case retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test case not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["test-cases"],"summary":"Update test case","description":"Update an existing test case. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"updateTestCase","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test case ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"}}}},"responses":{"200":{"description":"Test case updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test case not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["test-cases"],"summary":"Delete test case","description":"Soft delete a test case. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"deleteTestCase","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Test case ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Test case deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Test case not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/testCases/batch":{"delete":{"tags":["test-cases"],"summary":"Delete multiple test cases","description":"Soft delete multiple test cases by their IDs. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"deleteTestCases","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of test case IDs to delete"}}}}}},"responses":{"204":{"description":"Test cases deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions":{"get":{"tags":["sessions"],"summary":"Get sessions","description":"Get list of sessions with pagination and filtering. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"getSessions","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by session IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"customIds","in":"query","style":"form","explode":true,"description":"Filter by session custom IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testIds","in":"query","style":"form","explode":true,"description":"Filter by test IDs (include only). Use an empty string (\"\") to select sessions without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"excludeTestIds","in":"query","style":"form","explode":true,"description":"Omit sessions linked to the specified test IDs. Use an empty string (\"\") to omit sessions without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"versionIds","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testCaseIds","in":"query","style":"form","explode":true,"description":"Filter by test case IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter sessions created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter sessions created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Sessions retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}},"400":{"description":"Missing required filter. Provide at least one of the scoping filters (e.g. productIds, versionIds, ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["sessions"],"summary":"Create session","description":"Create a new session. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"createSession","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInput"}}}},"responses":{"201":{"description":"Session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/{id}":{"get":{"tags":["sessions"],"summary":"Get session by ID","description":"Get a specific session by ID. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"getSessionById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Session retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["sessions"],"summary":"Update session","description":"Update an existing session. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"updateSession","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"responses":{"200":{"description":"Session updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["sessions"],"summary":"Delete session","description":"Soft delete a session. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"deleteSession","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Session deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/{id}/compatible-metrics":{"get":{"tags":["sessions"],"summary":"List metrics annotated with compatibility for a session","description":"Returns evaluable metrics annotated with whether they can be satisfied by the session's product metadata and conversation endpoint connection output mapping. Trace-dependent and runtime-only params are out of scope and treated as always satisfied.","operationId":"listCompatibleMetricsBySession","x-cli-name":"list-compatible-metrics","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Session ID to evaluate compatibility against","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of metrics to return (default 100)","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of metrics with compatibility annotations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompatibleMetric"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/{id}/finish":{"patch":{"tags":["sessions"],"summary":"Finish session","description":"Marks a session as COMPLETED (stoppingReason provided) or FAILED (error provided). At least one of stoppingReason or error must be provided. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"finishSession","x-cli-name":"finish","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Session ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"stoppingReason":{"type":"string","description":"Reason the session stopped (sets status to COMPLETED)","example":"GOAL_ACHIEVED"},"error":{"type":"string","description":"Error message (sets status to FAILED)"}}}}}},"responses":{"200":{"description":"Session finished successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Neither stoppingReason nor error provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions/batch":{"delete":{"tags":["sessions"],"summary":"Delete multiple sessions","description":"Soft delete multiple sessions by their IDs. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"deleteSessions","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of session IDs to delete"}}}}}},"responses":{"204":{"description":"Sessions deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inferenceResults":{"get":{"tags":["inference-results"],"summary":"Get inference results","description":"Get list of inference results with pagination and filtering. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"getInferenceResults","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by inference result IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sessionIds","in":"query","style":"form","explode":true,"description":"Filter by session IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"evaluationIds","in":"query","style":"form","explode":true,"description":"Filter by evaluation IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"fromCreatedAt","in":"query","description":"Filter inference results created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter inference results created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Inference results retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InferenceResult"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["inference-results"],"summary":"Create inference result","description":"Create a new inference result. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"createInferenceResult","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","description":"ID of the session","example":"session_123"},"userId":{"type":"string","nullable":true,"description":"ID of the user","example":"user_123"},"index":{"type":"integer","description":"Index of the inference result","example":0},"status":{"type":"string","enum":["PENDING","GENERATED","FAILED","SKIPPED"],"description":"Status of the inference result"},"error":{"type":"string","nullable":true,"description":"Error message explaining why this inference result failed or was skipped"},"input":{"type":"object","nullable":true,"description":"Structured input data. For plain text, use { user_message: \"...\" }"},"actualOutput":{"type":"string","nullable":true,"description":"Actual output text","example":"Model response text"},"retrievalContext":{"type":"string","nullable":true,"description":"Retrieval context information","example":"Retrieved context document"},"latency":{"type":"number","nullable":true,"description":"Latency in milliseconds"},"inputTokens":{"type":"integer","nullable":true,"description":"Number of input tokens"},"outputTokens":{"type":"integer","nullable":true,"description":"Number of output tokens"},"cacheReadInputTokens":{"type":"integer","nullable":true,"description":"Number of cache read input tokens"},"tokens":{"type":"integer","nullable":true,"description":"Total number of tokens"},"costPerInputToken":{"type":"number","nullable":true,"description":"Cost per input token"},"costPerOutputToken":{"type":"number","nullable":true,"description":"Cost per output token"},"costPerCacheReadInputToken":{"type":"number","nullable":true,"description":"Cost per cache read input token"},"cost":{"type":"number","nullable":true,"description":"Total cost"},"conversationSimulatorVersion":{"type":"string","nullable":true,"description":"Version of the conversation simulator"}}}}}},"responses":{"201":{"description":"Inference result created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResult"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inferenceResults/aggregatedData":{"get":{"tags":["inference-results"],"summary":"Get aggregated performance data","description":"Get aggregated performance metrics data. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"getAggregatedData","x-cli-name":"get-aggregated-data","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by inference result IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationIds","in":"query","style":"form","explode":true,"description":"Filter by organization IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"versionIds","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sessionIds","in":"query","style":"form","explode":true,"description":"Filter by session IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testIds","in":"query","style":"form","explode":true,"description":"Filter by test IDs (include only). Use an empty string (\"\") to select inference results from sessions without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"excludeTestIds","in":"query","style":"form","explode":true,"description":"Omit inference results from sessions linked to the specified test IDs. Use an empty string (\"\") to omit inference results from sessions without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Aggregated data retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"Aggregated inference result data with evaluation scores"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inferenceResults/{id}":{"get":{"tags":["inference-results"],"summary":"Get inference result by ID","description":"Get a specific inference result by ID. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"getInferenceResultById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Inference result ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Inference result retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResult"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Inference result not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["inference-results"],"summary":"Update inference result","description":"Update an existing inference result. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"updateInferenceResult","x-cli-name":"update","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Inference result ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"actualOutput":{"type":"string","example":"Model response text"},"retrievalContext":{"type":"string","example":"Retrieved context document"},"error":{"type":"string","nullable":true,"description":"Error message explaining why this inference result failed or was skipped"},"latency":{"type":"integer"}}}}}},"responses":{"200":{"description":"Inference result updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResult"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Inference result not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["inference-results"],"summary":"Delete inference result","description":"Soft delete an inference result. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"deleteInferenceResult","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Inference result ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Inference result deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Inference result not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inferenceResults/batch":{"post":{"tags":["inference-results"],"summary":"Create inference results batch","description":"Create multiple inference results from conversation turns. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"createInferenceResultsBatch","x-cli-name":"create-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","conversationTurns"],"properties":{"sessionId":{"type":"string","example":"session_123"},"conversationTurns":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"201":{"description":"Inference results created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InferenceResult"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["inference-results"],"summary":"Delete multiple inference results","description":"Soft delete multiple inference results by their IDs. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"deleteInferenceResults","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of inference result IDs to delete"}}}}}},"responses":{"204":{"description":"Inference results deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/inferenceResults/generate":{"post":{"tags":["inference-results"],"summary":"Generate inference results from test cases","description":"Triggers async inference generation for specified test cases using the version's endpoint connection. See [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).","operationId":"generateInferenceResults","x-cli-name":"generate","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"testIds":{"type":"array","example":["test_123","test_456"],"items":{"type":"string"},"description":"Array of test IDs to generate inferences for (will process all test cases in these tests)"},"testCaseIds":{"type":"array","example":["tc_123","tc_456"],"items":{"type":"string"},"description":"Array of test case IDs to generate inferences for"},"versionId":{"type":"string","description":"Version ID containing the endpoint connection configuration","example":"ver_123"},"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"},"description":"Optional array of metric IDs to evaluate after inference generation. If provided, evaluations will be triggered automatically."}}}}}},"responses":{"202":{"description":"Inference generation job queued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"message":{"type":"string"},"testCaseCount":{"type":"integer"}}}}}},"400":{"description":"Bad request - missing required parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/traces":{"get":{"tags":["traces"],"summary":"Get traces","description":"Get a list of traces with filtering and pagination. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"getTraces","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by trace IDs","schema":{"type":"array","items":{"type":"string"}}},{"name":"inferenceResultIds","in":"query","style":"form","explode":true,"description":"Filter by inference result IDs","schema":{"type":"array","items":{"type":"string"}}},{"name":"sessionIds","in":"query","style":"form","explode":true,"description":"Filter by session IDs (via inference result relationship)","schema":{"type":"array","items":{"type":"string"}}},{"name":"types","in":"query","style":"form","explode":true,"description":"Filter by trace types (SPAN, GENERATION, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL)","schema":{"type":"array","items":{"type":"string","enum":["SPAN","GENERATION","EVENT","AGENT","TOOL","CHAIN","RETRIEVER","EVALUATOR","EMBEDDING","GUARDRAIL"]}}},{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by trace names","schema":{"type":"array","items":{"type":"string"}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort format createdAt,asc or createdAt,desc","schema":{"type":"array","items":{"type":"string"}}},{"name":"offset","in":"query","description":"Number of items to skip","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Maximum number of items to return","schema":{"type":"integer"}},{"name":"fromStartTime","in":"query","description":"Filter traces started at or after this timestamp (ISO 8601 format)","schema":{"type":"string","format":"date-time"}},{"name":"toStartTime","in":"query","description":"Filter traces started at or before this timestamp (ISO 8601 format)","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Traces retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Trace"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["traces"],"summary":"Create trace","description":"Create a new trace for a tool/function call. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"createTrace","x-cli-name":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["inferenceResultId","name"],"properties":{"inferenceResultId":{"type":"string","example":"ir_123"},"name":{"type":"string","example":"Example Name"},"type":{"type":"string","enum":["SPAN","GENERATION","EVENT","AGENT","TOOL","CHAIN","RETRIEVER","EVALUATOR","EMBEDDING","GUARDRAIL"]},"inputData":{"type":"object"},"outputData":{"type":"object"},"error":{"type":"string","example":"Error message"},"latencyMs":{"type":"number"},"metadata":{"type":"object"}}}}}},"responses":{"200":{"description":"Trace created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trace"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/traces/{id}":{"get":{"tags":["traces"],"summary":"Get trace by ID","description":"Get a specific trace by its ID. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"getTraceById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Trace ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Trace retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trace"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Trace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["traces"],"summary":"Delete trace","description":"Soft delete a trace by its ID. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"deleteTrace","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Trace ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Trace deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Trace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/traces/batch":{"post":{"tags":["traces"],"summary":"Create traces batch","description":"Create multiple traces in a single API call (transactional). See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"createTracesBatch","x-cli-name":"create-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["inferenceResultId","name"],"properties":{"id":{"type":"string","description":"Optional custom trace ID","example":"id_123"},"inferenceResultId":{"type":"string","description":"ID of the inference result this trace belongs to","example":"ir_123"},"name":{"type":"string","description":"Name of the trace"},"description":{"example":"Example Name","type":"string","nullable":true,"description":"Optional description of the trace"},"type":{"type":"string","enum":["SPAN","GENERATION","EVENT","AGENT","TOOL","CHAIN","RETRIEVER","EVALUATOR","EMBEDDING","GUARDRAIL"],"nullable":true,"description":"Type of trace"},"inputData":{"type":"object","nullable":true,"description":"Input data for the trace"},"outputData":{"type":"object","nullable":true,"description":"Output data from the trace"},"error":{"type":"string","nullable":true,"description":"Error message if the trace failed","example":"Error message"},"latencyMs":{"type":"number","nullable":true,"description":"Duration in milliseconds"},"metadata":{"type":"object","nullable":true,"description":"Additional trace attributes"},"parentTraceId":{"type":"string","nullable":true,"description":"Parent trace ID for hierarchical traces (references id of another trace in batch)"},"startTime":{"type":"string","format":"date-time","nullable":true,"description":"Start time of the trace"},"endTime":{"type":"string","format":"date-time","nullable":true,"description":"End time of the trace"}}}}}}},"responses":{"200":{"description":"Traces created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Trace"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["traces"],"summary":"Delete multiple traces","description":"Soft delete multiple traces by their IDs. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).","operationId":"deleteTraces","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of trace IDs to delete"}}}}}},"responses":{"204":{"description":"Traces deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations":{"get":{"tags":["evaluations"],"summary":"Get evaluations","description":"Get list of evaluations with pagination and filtering. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"getEvaluations","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"ids","in":"query","style":"form","explode":true,"description":"Filter by evaluation IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sessionIds","in":"query","style":"form","explode":true,"description":"Filter by session IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"inferenceResultIds","in":"query","style":"form","explode":true,"description":"Filter by inference result IDs (for single-turn evaluations)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"metricIds","in":"query","style":"form","explode":true,"description":"Filter by metric IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"metricGroupIds","in":"query","description":"Filter by metric group IDs (matches all revisions of a metric)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testCaseIds","in":"query","style":"form","explode":true,"description":"Filter by test case IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testIds","in":"query","style":"form","explode":true,"description":"Filter by test IDs (include only). Use an empty string (\"\") to select evaluations without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"excludeTestIds","in":"query","style":"form","explode":true,"description":"Omit evaluations linked to the specified test IDs. Use an empty string (\"\") to omit evaluations without a test","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"versionIds","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"specificationIds","in":"query","style":"form","explode":true,"description":"Filter by specification IDs (returns evaluations whose metric is linked to any of the given specifications)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"statuses","in":"query","style":"form","explode":true,"description":"Filter by evaluation statuses (PENDING, SUCCESS, FAILED)","required":false,"schema":{"type":"array","items":{"type":"string","enum":["PENDING","PENDING_HUMAN","SUCCESS","FAILED","SKIPPED"]}}},{"name":"canRetry","in":"query","description":"Filter evaluations that can be retried","required":false,"schema":{"type":"boolean"}},{"name":"evaluationTypes","in":"query","style":"form","explode":true,"description":"Filter by evaluation types","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"humanEvaluatorId","in":"query","description":"Filter by human evaluator user ID","required":false,"schema":{"type":"string"}},{"name":"metricSources","in":"query","style":"form","explode":true,"description":"Filter by metric sources","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"augmentedTestCase","in":"query","description":"Filter evaluations by whether their test case is augmented","required":false,"schema":{"type":"boolean"}},{"name":"fromCreatedAt","in":"query","description":"Filter evaluations created at or after this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toCreatedAt","in":"query","description":"Filter evaluations created at or before this timestamp (ISO 8601 format)","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Evaluations retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}}}}},"400":{"description":"Missing required filter. Provide at least one of the scoping filters (e.g. productIds, sessionIds, versionIds, ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/{id}":{"get":{"tags":["evaluations"],"summary":"Get evaluation by ID","description":"Get a specific evaluation by ID. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"getEvaluationById","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Evaluation retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["evaluations"],"summary":"Delete evaluation","description":"Soft delete an evaluation. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"deleteEvaluation","x-cli-name":"delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Evaluation deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/fromSession":{"post":{"tags":["evaluations"],"summary":"Create evaluations from session","description":"Create evaluations from a session. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"createEvaluationsFromSession","x-cli-name":"create-from-session","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId"],"properties":{"metrics":{"type":"array","description":"Metrics to evaluate. Optional if specificationIds is provided or the product has specifications with linked metrics.","items":{"type":"object","properties":{"id":{"type":"string","example":"id_123"},"name":{"type":"string","example":"Example Name"},"score":{"type":"number","example":0.95}}}},"sessionId":{"type":"string","example":"session_123"},"specificationIds":{"type":"array","description":"Specification IDs whose linked metrics will be evaluated. Can be combined with metrics; the API merges and deduplicates.","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Evaluations created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/fromInferenceResult":{"post":{"tags":["evaluations"],"summary":"Create evaluations for a single inference result","description":"Create evaluations for a specific turn in a conversation. This is useful for production monitoring where you want to evaluate turn-by-turn performance. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"createEvaluationsFromInferenceResult","x-cli-name":"create-from-inference-result","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["inferenceResultId"],"properties":{"metrics":{"type":"array","description":"Metrics to evaluate. Optional if specificationIds is provided or the product has specifications with linked metrics.","items":{"type":"object","properties":{"id":{"type":"string","example":"id_123"},"name":{"type":"string","example":"Example Name"},"score":{"type":"number","example":0.95}}}},"inferenceResultId":{"type":"string","description":"The ID of the inference result (turn) to evaluate","example":"ir_123"},"specificationIds":{"type":"array","description":"Specification IDs whose linked metrics will be evaluated. Can be combined with metrics; the API merges and deduplicates.","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Evaluations created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Inference result not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/singleTurn":{"post":{"tags":["evaluations"],"summary":"Create single-turn evaluations","description":"Create evaluations for single-turn interactions. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"createSingleTurnEvaluations","x-cli-name":"create-single-turn","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["metrics","versionId","actualOutput"],"properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"id_123"},"name":{"type":"string","example":"Example Name"},"score":{"type":"number","example":0.95}}}},"versionId":{"type":"string","example":"ver_123"},"testCaseId":{"type":"string","description":"Required when isProduction is false. Must be omitted when isProduction is true.","example":"tc_123"},"actualOutput":{"type":"string","example":"Model response text"},"input":{"type":"string","description":"User input/prompt. Required when isProduction is true. Must be omitted when isProduction is false.","example":"What is the capital of France?"},"retrievalContext":{"type":"string","description":"RAG retrieval context used to generate the actual output","example":"Retrieved context document"},"isProduction":{"type":"boolean","description":"When true, creates a production evaluation (input required, testCaseId must be omitted). When false (default), testCaseId is required and input must be omitted."}}}}}},"responses":{"201":{"description":"Evaluations created successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/retry":{"post":{"tags":["evaluations"],"summary":"Retry failed evaluations","description":"Retry one or more failed evaluations. Non-admin users are limited by EVALUATION_MAX_RETRIES. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"retryEvaluations","x-cli-name":"retry","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of evaluation IDs to retry"}}}}}},"responses":{"202":{"description":"Retry request accepted","content":{"application/json":{"schema":{"type":"object","properties":{"retried":{"type":"integer","description":"Number of evaluations successfully queued for retry"},"skipped":{"type":"integer","description":"Number of evaluations skipped (not FAILED or exceeded max retries)"},"errors":{"type":"array","items":{"type":"string"},"description":"Error messages for failed retries"}}}}}},"400":{"description":"Bad request - invalid evaluation IDs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/fromVersion":{"post":{"tags":["evaluations"],"summary":"Evaluate a version","description":"Automatically evaluates a version by resolving its product's specifications, their linked metrics, and their linked tests. Creates inference generation jobs for every test case across all linked tests. Specifications without tests or without metrics are silently skipped. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).\n","operationId":"evaluateVersion","x-cli-name":"create-from-version","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["versionId"],"properties":{"versionId":{"type":"string","description":"The version ID to evaluate","example":"ver_123"},"specificationIds":{"type":"array","description":"Optional list of specification IDs to evaluate. If omitted, all product specifications with linked metrics and tests are used.","example":["spec_123","spec_456"],"items":{"type":"string"}}}}}}},"responses":{"202":{"description":"Evaluation job queued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"testCaseCount":{"type":"integer"},"message":{"type":"string"},"specifications":{"type":"array","description":"Summary of specifications that were evaluated","items":{"type":"object","properties":{"specificationId":{"type":"string"},"testCount":{"type":"integer"},"metricCount":{"type":"integer"}}}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/fromMetrics":{"post":{"tags":["evaluations"],"summary":"Replay evaluations onto a new metric revision","description":"Re-runs historical evaluations that used any metric in `metricGroupId` against the new metric revision `newMetricId`, scoped to the given products. Idempotent: any `(sessionId, inferenceResultId)` pair that already has an evaluation on `newMetricId` is skipped.\n","operationId":"evaluateFromMetrics","x-cli-name":"replay-from-metrics","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["newMetricId","metricGroupId","productIds"],"properties":{"newMetricId":{"type":"string","example":"metric_123"},"metricGroupId":{"type":"string","example":"group_123"},"productIds":{"type":"array","items":{"type":"string"},"example":["prod_1","prod_2"]}}}}}},"responses":{"202":{"description":"Replay job accepted","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"integer"},"skipped":{"type":"integer"},"errors":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Invalid body or metricGroupId does not match the metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Metric or product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/batch":{"delete":{"tags":["evaluations"],"summary":"Delete multiple evaluations","description":"Soft delete multiple evaluations by their IDs. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"deleteEvaluations","x-cli-name":"delete-batch","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","example":["id_1","id_2"],"items":{"type":"string"},"description":"Array of evaluation IDs to delete"}}}}}},"responses":{"204":{"description":"Evaluations deleted successfully"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/human/pending":{"get":{"tags":["evaluations"],"summary":"Get pending human evaluations","description":"Get list of pending human evaluations that the authenticated user can evaluate based on their user groups. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"getPendingHumanEvaluations","x-cli-name":"list-pending-human","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Pending human evaluations retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}},"total":{"type":"integer"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/human/completed":{"get":{"tags":["evaluations"],"summary":"Get completed human evaluations","description":"Get list of human evaluations completed by the authenticated user. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"getCompletedHumanEvaluations","x-cli-name":"list-completed-human","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"productIds","in":"query","style":"form","explode":true,"description":"Filter by product IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Completed human evaluations retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/Evaluation"}},"total":{"type":"integer"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/{id}/claim":{"post":{"tags":["evaluations"],"summary":"Claim an evaluation for human review or annotation","description":"Claim an evaluation to prevent concurrent editing. For HUMAN_EVALUATION metrics, enforces user group permissions (admins skip). For other metrics, works as an annotation claim open to all org members. Works on any evaluation status. Sets humanEvaluatorStartedAt timestamp. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"claimHumanEvaluation","x-cli-name":"claim","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Evaluation claimed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Evaluation is already being evaluated or not in PENDING_HUMAN status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"User not authorized to evaluate this metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/{id}/release":{"post":{"tags":["evaluations"],"summary":"Release a claimed evaluation or annotation","description":"Release a previously claimed evaluation or annotation without submitting a score. Works on any evaluation status. Clears humanEvaluatorStartedAt. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"releaseHumanEvaluation","x-cli-name":"release","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Evaluation released successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Evaluation is not being evaluated or not claimed by this user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/{id}/submit":{"post":{"tags":["evaluations"],"summary":"Submit a human evaluation or annotation score","description":"Submit a score and optional reason. For HUMAN_EVALUATION metrics, enforces user group permissions and updates both score sets. For PENDING_HUMAN evaluations, also sets status to SUCCESS. For other metrics, works as an annotation — writes only humanScore/humanReason/humanEvaluatorFinishedAt, leaving AI score/reason and status untouched. Works on any evaluation status. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"submitHumanEvaluation","x-cli-name":"submit","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["score"],"properties":{"score":{"type":"number","minimum":0,"maximum":1,"description":"The evaluation score (0-1)","example":0.95},"reason":{"type":"string","description":"Optional reason for the score","example":"Evaluation reason"}}}}}},"responses":{"200":{"description":"Evaluation submitted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid score or evaluation not in PENDING_HUMAN status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"User not authorized to evaluate this metric or evaluation not claimed by this user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluations/{id}/edit-human":{"post":{"tags":["evaluations"],"summary":"Edit a submitted human evaluation","description":"Edit the score and reason for a previously submitted human evaluation. Only the original evaluator can edit. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).","operationId":"editHumanEvaluation","x-cli-name":"edit-human","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","description":"Evaluation ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["score"],"properties":{"score":{"type":"number","minimum":0,"maximum":1,"example":0.95},"reason":{"type":"string","example":"Evaluation reason"}}}}}},"responses":{"200":{"description":"Evaluation updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid score or evaluation not eligible for editing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"User is not the original evaluator","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/generateFromFewShot/augment":{"post":{"tags":["test-cases"],"summary":"Augment test cases","description":"Submit test cases for augmentation using few-shot learning. The API automatically selects up to 5 random test cases from the given test as few-shot examples. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"augmentTestCases","x-cli-name":"augment","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testId","maxTestCases"],"properties":{"testId":{"type":"string","description":"ID of the test to augment","example":"test_123"},"maxTestCases":{"type":"integer","minimum":1,"example":100},"productDescription":{"type":"string","nullable":true,"example":"A product that helps users"}}}}}},"responses":{"202":{"description":"Augmentation task started successfully","content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string","example":"task_123"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/generateFromFewShot/status/{taskId}":{"get":{"tags":["test-cases"],"summary":"Get augmentation task status","description":"Retrieve the status of an augmentation task. See [Tests](https://docs.galtea.ai/concepts/product/test).","operationId":"getAugmentationStatus","x-cli-name":"augmentation-status","security":[{"bearerAuth":[]}],"parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"]},"result":{"type":"object","nullable":true}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/analytics":{"get":{"tags":["analytics"],"summary":"Get analytics data","description":"Get analytics data for a product with optional filtering. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"getAnalytics","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"productId","in":"query","description":"Product ID (required)","required":true,"schema":{"type":"string"}},{"name":"versionIds","in":"query","style":"form","explode":true,"description":"Filter by version IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"testIds","in":"query","style":"form","explode":true,"description":"Filter by test IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"metricIds","in":"query","style":"form","explode":true,"description":"Filter by metric IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"from","in":"query","description":"Start date for filtering","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End date for filtering","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"languages","in":"query","style":"form","explode":true,"description":"Filter by language codes","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Analytics data retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"Analytics data containing evaluation results and metrics"}}}},"400":{"description":"Missing required productId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/analytics/export":{"post":{"tags":["analytics"],"summary":"Export analytics data","description":"Export analytics data for a product with optional filtering. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"exportAnalytics","x-cli-name":"export","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productId"],"properties":{"productId":{"type":"string","description":"Product ID (required)","example":"prod_123"},"versionIds":{"type":"array","items":{"type":"string"},"description":"Filter by version IDs"},"testIds":{"type":"array","example":["test_123","test_456"],"items":{"type":"string"},"description":"Filter by test IDs"},"metricIds":{"type":"array","example":["metric_123","metric_456"],"items":{"type":"string"},"description":"Filter by metric IDs"},"languages":{"type":"array","items":{"type":"string"},"description":"Filter by language codes"},"from":{"type":"string","format":"date-time","description":"Start date for filtering"},"to":{"type":"string","format":"date-time","description":"End date for filtering"}}}}}},"responses":{"200":{"description":"Analytics data exported successfully","content":{"application/json":{"schema":{"type":"object","description":"Exported analytics data"}}}},"400":{"description":"Missing required productId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/generate-put-presigned-url":{"get":{"tags":["storage"],"summary":"Generate upload presigned URL","description":"Generate a presigned URL for uploading files to storage. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"generatePutPresignedUrl","x-cli-name":"generate-put-url","security":[{"bearerAuth":[]}],"parameters":[{"name":"key","in":"query","description":"Storage key","required":true,"schema":{"type":"string"}},{"name":"fileType","in":"query","description":"File type (default: groundTruth)","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Presigned URL generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/generate-get-presigned-url":{"get":{"tags":["storage"],"summary":"Generate download presigned URL","description":"Generate a presigned URL for downloading files from storage. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"generateGetPresignedUrl","x-cli-name":"generate-get-url","security":[{"bearerAuth":[]}],"parameters":[{"name":"uri","in":"query","description":"Storage URI","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Presigned URL generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/evaluatorModels":{"get":{"tags":["evaluator-models"],"summary":"Get evaluator models","description":"Get list of evaluator models with filtering options. See [Models](https://docs.galtea.ai/concepts/model).","operationId":"getEvaluatorModels","x-cli-name":"list","security":[{"bearerAuth":[]}],"parameters":[{"name":"names","in":"query","style":"form","explode":true,"description":"Filter by model names (exact match)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","description":"Filter by model name (case-insensitive contains)","required":false,"schema":{"type":"string"}},{"name":"selectable","in":"query","description":"Filter by selectable models","required":false,"schema":{"type":"boolean"}},{"name":"enabled","in":"query","description":"Filter by enabled models","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","style":"form","explode":true,"description":"Sort instructions (field and direction pairs)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Maximum number of results","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of results to skip","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Evaluator models retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"selectable":{"type":"boolean"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversationSimulator/generateNextUserMessage":{"post":{"tags":["sessions"],"summary":"Generate next user message","description":"Simulate the next user message in a conversation based on the provided scenario and turns. See [Sessions](https://docs.galtea.ai/concepts/product/version/session).","operationId":"generateNextUserMessage","x-cli-name":"generate-message","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scenario":{"type":"string","example":"Customer support"},"turns":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"Next user message generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The generated next user message"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/minimum-sdk-version":{"get":{"summary":"Get minimum SDK version","description":"Get minimum supported SDK version of the API and latest published version. See [Platform Overview](https://docs.galtea.ai/introduction).","operationId":"getMinimumSdkVersion","x-cli-name":"minimum-sdk-version","responses":{"200":{"description":"SDK version information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"latestSdkVersionPublished":{"type":"string","example":"1.0.0"},"minimumSdkVersionSupported":{"type":"string","example":"0.9.0"}}}}}}}}},"/jobs/{jobId}/status":{"get":{"tags":["jobs"],"summary":"Get job status","description":"Retrieve the status of an async job (e.g., inference generation). Returns the job state, progress, result, and any error information.","operationId":"getJobStatus","x-cli-name":"get","security":[{"bearerAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the job to check"}],"responses":{"200":{"description":"Job status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The job ID"},"state":{"type":"string","description":"The current state of the job","enum":["waiting","active","completed","failed","delayed","prioritized","waiting-children"]},"progress":{"oneOf":[{"type":"number"},{"type":"object"}],"description":"Job progress (0-100 or custom object)"},"result":{"type":"object","nullable":true,"description":"The job result when completed (e.g., sessionResults, inferenceResultIds, failedTestCaseIds)"},"error":{"type":"string","nullable":true,"description":"Error message if the job failed"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/otel/auth":{"post":{"tags":["traces"],"summary":"Validate credentials for OTel ingestion","description":"Validates the customer's API key and returns the user ID via x-customer-id header.\nUsed by the Istio gateway ext-authz filter to authenticate OTel data ingestion requests.\n","operationId":"otelAuth","x-cli-name":"otel-auth","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Credentials are valid","headers":{"x-customer-id":{"description":"The authenticated user's ID","schema":{"type":"string"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/otel/traces":{"post":{"tags":["traces"],"summary":"Ingest OTLP/JSON traces","description":"Receives an OTLP/JSON trace payload from the OTel Collector and persists spans as Galtea Trace records. Authenticated via standard API key (processAccessTokenMiddleware).\n","operationId":"ingestOtelTraces","x-cli-name":"ingest-otel","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["resourceSpans"],"properties":{"resourceSpans":{"type":"array","items":{"type":"object","properties":{"resource":{"type":"object","properties":{"attributes":{"type":"array","items":{"type":"object"}}}},"scopeSpans":{"type":"array","items":{"type":"object","properties":{"spans":{"type":"array","items":{"type":"object"}}}}}}}}}}}}},"responses":{"200":{"description":"Traces ingested (OTLP ExportTraceServiceResponse)","content":{"application/json":{"schema":{"type":"object","properties":{"partialSuccess":{"type":"object","properties":{"rejectedSpans":{"type":"integer","description":"Number of spans that failed ingestion"},"errorMessage":{"type":"string","description":"Error details when spans are rejected"}}}}}}}},"400":{"description":"Invalid OTLP payload or missing customer.id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"tags":[]}