---
title: "Create Run Route"
method: POST
path: "/api/threads/{thread_id}/runs/"
tags: ["run"]
---

# Create Run Route

`POST /api/threads/{thread_id}/runs/`

Creates a new run, starting it in the background.

## Path parameters

- `thread_id` string, uuid, required

## Request body

- RunCreateInput
  - `model` 'gpt-4o'
  - `instructions` string, nullable
  - `additional_instructions` string, nullable
  - `knowledge_base_id` string, uuid, nullable
  - `context_limit` integer, nullable — The maximum number of context chunks to include.
  - `codex_access_key` string, nullable
  - `response_validation_config` ResponseValidationCheck[], nullable
    - `name` 'trustworthiness' | 'response_helpfulness' | 'context_sufficiency' | 'response_groundedness' | 'query_ease', required
    - `is_bad_threshold` number, required
  - `tools` union[], nullable
    - union
      - CodexV0Tool
        - `type` 'codex_v0'
        - `access_key` string, required
      - NoOpTool
        - `type` 'noop'
  - `assistant_id` string, uuid, required
  - `additional_messages` MessageCreate[]
    - `thread_id` string, uuid, required
    - `role` 'user' | 'assistant', required
    - `content` string, required
    - `metadata` MessageMetadataInput, required
      - `trustworthiness_score` number, nullable
      - `trustworthiness_explanation` string, nullable
      - `is_expert_answer` boolean, nullable
      - `is_bad_response` boolean, nullable
      - `citations` string[], nullable
      - `scores` ResponseScoreMetadataInput
        - `trustworthiness` EvalResult
          - `score` number, nullable
          - `is_bad` boolean, nullable
          - `log` EvalLog
            - `explanation` string, required
        - `response_helpfulness` EvalResult
          - `score` number, nullable
          - `is_bad` boolean, nullable
          - `log` EvalLog
            - `explanation` string, required
        - `context_sufficiency` EvalResult
          - `score` number, nullable
          - `is_bad` boolean, nullable
          - `log` EvalLog
            - `explanation` string, required
        - `response_groundedness` EvalResult
          - `score` number, nullable
          - `is_bad` boolean, nullable
          - `log` EvalLog
            - `explanation` string, required
        - `query_ease` EvalResult
          - `score` number, nullable
          - `is_bad` boolean, nullable
          - `log` EvalLog
            - `explanation` string, required

## Response `201`

Successful Response

- Run
  - `model` 'gpt-4o'
  - `instructions` string, nullable
  - `additional_instructions` string, nullable
  - `knowledge_base_id` string, uuid, nullable
  - `context_limit` integer, nullable — The maximum number of context chunks to include.
  - `codex_access_key` string, nullable
  - `response_validation_config` ResponseValidationCheck[], nullable
    - `name` 'trustworthiness' | 'response_helpfulness' | 'context_sufficiency' | 'response_groundedness' | 'query_ease', required
    - `is_bad_threshold` number, required
  - `tools` union[], nullable
    - union
      - CodexV0Tool
        - `type` 'codex_v0'
        - `access_key` string, required
      - NoOpTool
        - `type` 'noop'
  - `thread_id` string, uuid, required
  - `assistant_id` string, uuid, required
  - `id` string, uuid, required
  - `status` 'pending' | 'in_progress' | 'completed' | 'failed' | 'canceled' | 'expired', required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable
  - `usage` RunUsage
    - `completion_tokens` integer, required
    - `prompt_tokens` integer, required
    - `total_tokens` integer, required
  - `last_error` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2025-04-15** `f22c2d6c16f0` — 1 breaking, 3 info
  - removed `#/components/schemas/ResponseScoreMetadata` from the `additional_messages/items/metadata/scores` request property `anyOf` list
  - added the new optional request property `response_validation_config`
  - added `#/components/schemas/ResponseScoreMetadata-Input` to the `additional_messages/items/metadata/scores` request property `anyOf` list
  - added the optional property `response_validation_config` to the response with the `201` status
- **2025-04-14** `b890eea39144` — 5 info
  - added the new optional request property `additional_messages/items/metadata/is_bad_response`
  - added the new optional request property `additional_messages/items/metadata/is_expert_answer`
  - added the new optional request property `additional_messages/items/metadata/scores`
  - added the new optional request property `codex_access_key`
  - …1 more
- **2025-01-22** `2aa38a4bc52c` — 1 breaking, 2 warning, 5 info
  - removed `#/components/schemas/AlphaV0Tool` from the `tools/anyOf[subschema #1]/items/` request property `anyOf` list
  - removed the request property `tools/anyOf[subschema #1]/items/anyOf[subschema #2: NoOpTool]/name`
  - removed the optional property `tools/anyOf[subschema #1]/items/anyOf[subschema #2: NoOpTool]/name` from the response with the `201` status
  - added the new optional request property `tools/anyOf[subschema #1]/items/anyOf[subschema #2: NoOpTool]/type`
  - …4 more
- …earlier changes not shown

[Full history](https://skmtc.dev/cleanlab/apis/agility/changes/api/threads/:thread_id/runs/post.md)

---

[API](https://skmtc.dev/cleanlab/apis/agility.md) · [All operations](https://skmtc.dev/cleanlab/apis/agility/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cleanlab/agility/revisions/f22c2d6c16f0/schema)
