---
title: "POST /api/{org_id}/experiments/preview"
method: POST
path: "/api/{org_id}/experiments/preview"
tags: ["Experiments"]
---

# POST /api/{org_id}/experiments/preview

`POST /api/{org_id}/experiments/preview`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/experiments/preview`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/experiments/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `org_id` string, required

## Query parameters

- `sampleSize` integer, nullable

## Request body

- object
  - `confirmCostEstimate` boolean: Acknowledges a cost estimate above the organization's warning threshold. Without it, such a request is refused with `412`.
  - `datasetFilter` DatasetSnapshotFilterBody
    - `logicalIds` string[]
    - `metadata` object
    - `sources` DatasetItemSourceBody[]
    - `tags` string[]
  - `datasetId` string, required
  - `datasetVersion` integer, required
  - `description` string, nullable
  - `idempotencyKey` string, nullable
  - `metadata` unknown
  - `name` string, required
  - `scorers` ExperimentScorerRefBody[], required
    - `id` string, required
    - `version` integer, nullable
  - `task` union, required
    - object
      - `messages` PromptMessageBody[], required
        - `content` string, required
        - `role` string, required
      - `model` string, nullable
      - `params` unknown
      - `provider_id` string, required
      - `type` 'inline_prompt', required
    - object
      - `id` string, required
      - `params_overrides` PromptRefOverridesBody
        - `model` string, nullable
        - `params` unknown
        - `responseFormat` unknown
        - `tools` unknown
      - `provider_id` string, required
      - `type` 'prompt_ref', required
      - `version` integer, required
    - object
      - `overrides` RemoteTaskOverridesBody: The two runtime overrides an Experiment may set on a registered Remote Task.
        - `maxConcurrency` integer, nullable
        - `timeoutMs` integer, nullable
      - `task_ref` string, required: Pinned `name@version` of a published Remote Task. Never latest.
      - `type` 'remote', required
    - object
      - `config` unknown
      - `task_fingerprint` string, required: Immutable identity of the customer code under evaluation. Every execution record reported for this Experiment must repeat it.
      - `type` 'sdk', required
  - `trialCount` integer: Trials per Dataset Case. Omitted means one, which is the contract's default and the only value a caller who has not thought about dispersion should get.

## Response `200`

- object
  - `applicability` ExperimentApplicabilityPreviewBody, required
    - `eligibleScoringDimensionCount` integer, required
    - `eligibleTaskSlotCount` integer, required: Slots with at least one applicable Score Dimension — a scoring-side figure for the applicability preview, not a Task denominator.
    - `fullySkippedRowCount` integer, required
    - `fullySkippedSlotCount` integer, required
    - `partiallySkippedRowCount` integer, required
    - `partiallySkippedSlotCount` integer, required
    - `scorerApplicability` ExperimentScorerApplicabilityBody[], required
      - `eligibleRowCount` integer, required
      - `eligibleSlotCount` integer, required
      - `noReferenceRowCount` integer, required
      - `noReferenceSlotCount` integer, required
      - `scorerId` string, required
      - `scorerVersion` integer, required
    - `totalSlotCount` integer, required: Every pinned Slot, which is what Task progress counts against: a Slot runs whether or not a Scorer can judge it.
  - `costEstimate` ExperimentCostEstimateBody
    - `confirmationRequired` boolean, required: Creation of this plan requires `confirmCostEstimate: true`.
    - `currency` string, required
    - `dimensions` ExperimentCostDimensionBody[], required
      - `callCount` integer, required
      - `estimatedCost` number, double, nullable: Absent when no price is known for this model.
      - `inputTokensPerCall` integer, required
      - `model` string, nullable
      - `outputTokensPerCall` integer, required
      - `scorerId` string, nullable
      - `scorerVersion` integer, nullable
    - `estimatedCost` number, double, nullable: Sum of the dimensions that could be priced. Absent when none could.
    - `incomplete` boolean, required: At least one dimension had no known price, so the total is a floor.
    - `slotCount` integer, required
    - `taskCostEstimated` boolean, required: Whether the Task side is included. `false` for Remote and SDK Tasks, which run in the customer's own environment.
    - `warningThreshold` number, double, required
  - `datasetId` string, required
  - `datasetVersion` integer, required
  - `pinnedScorers` PinnedExperimentScorerBody[], required
    - `id` string, required
    - `version` integer, required
  - `rowCount` integer, required
  - `sampleSlots` ExperimentSlotBody[], required
    - `expectedOutput` unknown
    - `input` unknown, required
    - `logicalId` string, required
    - `metadata` unknown
    - `rowId` string, required
    - `trialIndex` integer, required
  - `slotCount` integer, required
  - `trialCount` integer, required

## Other responses

- `400`: Invalid Experiment definition
- `403`: A referenced Dataset, Scorer, Prompt, Provider or Remote Task is not accessible
- `404`: Dataset or scorer not found

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
