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

# Create Run Stream Route

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

Creates a new run and streams the results.

## 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
  - `hard_coded_queries` HardCodedQuery[], nullable
    - `query` string, required
    - `response` string, required
    - `context` string[], nullable
    - `prompt` string, nullable
    - `messages` object[], nullable
  - `codex_as_cache` boolean, nullable
  - `assistant_id` string, uuid, required
  - `additional_messages` MessageCreate[]
    - `thread_id` string, uuid, required
    - `role` 'user' | 'assistant', required
    - `content` string, required
    - `metadata` MessageMetadataInput, required
      - `original_llm_response` string, nullable
      - `trustworthiness_score` number, nullable
      - `trustworthiness_explanation` string, nullable
      - `is_expert_answer` boolean, nullable
      - `is_bad_response` boolean, nullable
      - `guardrailed` boolean, nullable
      - `escalated_to_sme` boolean, nullable
      - `citations` string[], nullable
      - `scores` object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2025-08-05** `9e6009a931b6` — 1 breaking, 2 warning, 7 info
  - removed `#/components/schemas/ResponseScoreMetadata-Input` from the `additional_messages/items/metadata/scores` request property `anyOf` list
  - removed the request property `response_validation_config`
  - removed the request property `tools`
  - added the new optional request property `additional_messages/items/metadata/escalated_to_sme`
  - …6 more
- **2025-04-15** `bb543bebe38d` — 10 info
  - the request property `additional_messages/items/metadata/scores/anyOf[subschema #1: ResponseScoreMetadata]/context_sufficiency/anyOf[subschema #1: EvalResult]/log/anyOf[subschema #1: EvalLog]/explanation` became optional
  - the request property `additional_messages/items/metadata/scores/anyOf[subschema #1: ResponseScoreMetadata]/query_ease/anyOf[subschema #1: EvalResult]/log/anyOf[subschema #1: EvalLog]/explanation` became optional
  - the request property `additional_messages/items/metadata/scores/anyOf[subschema #1: ResponseScoreMetadata]/response_groundedness/anyOf[subschema #1: EvalResult]/log/anyOf[subschema #1: EvalLog]/explanation` became optional
  - the request property `additional_messages/items/metadata/scores/anyOf[subschema #1: ResponseScoreMetadata]/response_helpfulness/anyOf[subschema #1: EvalResult]/log/anyOf[subschema #1: EvalLog]/explanation` became optional
  - …6 more
- …earlier changes not shown

[Full history](https://skmtc.dev/cleanlab/apis/agility/changes/api/threads/:thread_id/runs/stream/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/9e6009a931b6/schema)
