---
title: "Create Evaluation Assertion"
method: POST
path: "/sdk/v1/evaluation-assertions"
---

# Create Evaluation Assertion

`POST /sdk/v1/evaluation-assertions`

Creates a new evaluation assertion

## Request body

- union
  - EvaluationAssertionExactMatchBody
    - `type` 'EXACT_MATCH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValue` string, required — The value to match.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
  - EvaluationAssertionContainsAllBody
    - `type` 'CONTAINS_ALL', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValues` string[], required — List of values any of which may be present.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
  - EvaluationAssertionContainsAnyBody
    - `type` 'CONTAINS_ANY', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValues` string[], required — List of values any of which may be present.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
  - EvaluationAssertionStartsWithBody
    - `type` 'STARTS_WITH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValue` string, required — The value that the response should start with.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
  - EvaluationAssertionCostBody
    - `type` 'COST', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetThreshold` number, required — The cost threshold to be evaluated against.
  - EvaluationAssertionLatencyBody
    - `type` 'LATENCY', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetThreshold` number, required — The latency threshold to be evaluated against.
  - EvaluationAssertionToolCalledBody
    - `type` 'TOOL_CALLED', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `toolName` string, required — The name of the tool that should have been called.
  - EvaluationAssertionToolCalledWithBody
    - `type` 'TOOL_CALLED_WITH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `argKeyName` string, required — The argument name to be matched.
    - `toolName` string, required — The name of the tool that should have been called.
    - `ignoreCase` boolean — Whether to ignore case when comparing argument names.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.

## Response `201`

Successful operation

- union
  - EvaluationAssertionExactMatch
    - `type` 'EXACT_MATCH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValue` string, required — The value to match.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
    - `id` string, required
  - EvaluationAssertionContainsAll
    - `type` 'CONTAINS_ALL', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValues` string[], required — List of values any of which may be present.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
    - `id` string, required
  - EvaluationAssertionContainsAny
    - `type` 'CONTAINS_ANY', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValues` string[], required — List of values any of which may be present.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
    - `id` string, required
  - EvaluationAssertionStartsWith
    - `type` 'STARTS_WITH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetValue` string, required — The value that the response should start with.
    - `jsonPath` string, nullable — A JSON path to use when matching a JSON response.
    - `ignoreCase` boolean — Whether to ignore case when comparing strings.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
    - `id` string, required
  - EvaluationAssertionCost
    - `type` 'COST', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetThreshold` number, required — The cost threshold to be evaluated against.
    - `id` string, required
  - EvaluationAssertionLatency
    - `type` 'LATENCY', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `targetThreshold` number, required — The latency threshold to be evaluated against.
    - `id` string, required
  - EvaluationAssertionToolCalled
    - `type` 'TOOL_CALLED', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `toolName` string, required — The name of the tool that should have been called.
    - `id` string, required
  - EvaluationAssertionToolCalledWith
    - `type` 'TOOL_CALLED_WITH', required
    - `evaluationId` string, required
    - `weight` number — How heavily to weigh the assertion within the evaluation.
    - `argKeyName` string, required — The argument name to be matched.
    - `toolName` string, required — The name of the tool that should have been called.
    - `ignoreCase` boolean — Whether to ignore case when comparing argument names.
    - `negate` boolean — Whether to negate the assertion. "true" means the assertion must NOT be true.
    - `id` string, required

## Other responses

- `400` — Missing or invalid parameters
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/prompt-foundry/apis/prompt-foundry-api.md) · [All operations](https://skmtc.net/prompt-foundry/apis/prompt-foundry-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prompt-foundry/prompt-foundry-api/versions/84eb1e848fd1/schema)
