---
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
  - `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` MessageMetadata, required
      - `trustworthiness_score` number, nullable
      - `trustworthiness_explanation` string, nullable
      - `is_expert_answer` boolean, nullable
      - `is_bad_response` boolean, nullable
      - `citations` string[], nullable
      - `scores` ResponseScoreMetadata
        - `trustworthiness` object, nullable
        - `response_helpfulness` object, nullable

## 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
  - `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-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
- **2025-01-15** `92f517edd77d` — 1 info
  - added the new optional request property `additional_messages/items/metadata/trustworthiness_explanation`
- **2025-01-02** `60c8c820f2cb` — 2 info
  - added the new optional request property `tools`
  - added the optional property `tools` to the response with the `201` status
- **2024-12-13** `a5e85dccbbe3` — 2 info
  - added the new optional request property `context_limit`
  - added the optional property `context_limit` to the response with the `201` status

[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/b890eea39144/schema)
