POST
/
v1
/
threads
/
{threadId}
/
runs

Authorizations

X-Tune-Key
string
headerrequired

Tune API Keys are the preferred way to authenticate with the API. You can create an API Key from your Tune Studio Profile → 'Access Keys' (in sidebar)

Path Parameters

threadId
string
required

The ID of the thread the run and run steps belong to.

Body

application/json
assistantId
string

The ID of the assistant to use to execute this run. (not support yet).

model
string

The ID of the Model to be used to execute this run. (required).

instructions
string

Used as system prompt. Overrides the assistant instruction. If provided, the assistant will use this prompt instead of the one associated with the assistant.

additionaInstructions
string

Adds additional instructions at the end of the instructions for the run.

tools
object[]

Tools to be used for this run. If provided, the assistant will use these tools instead of the ones associated with the assistant.

metadata
object

Metadata to store additional information in key-value pairs.

temperature
number

Will be used to control the randomness of the output. The higher the temperature, the more random the output. The lower the temperature, the more deterministic the output.

topP
number

The probability mass model will consider to generate the output. 0.1 means only the top 10% of the tokens will be considered.

stream
boolean

If `true``, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.

maxPromptTokens
integer

The maximum number of tokens to generate in a single prompt. This is useful for limiting the length of the output.

maxCompletionTokens
integer

The maximum number of tokens to generate in a single completion. This is useful for limiting the length of the output.

truncationStrategy
object

Response

200 - application/json
id
string

The ID of the run.

object
string

"run".

createdAt
string

The time the run was created.

assistantId
string
threadId
string

The ID of the thread.

status
string

queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired..

requiredAction
object
lastError
object
expiresAt
string

The time the run expires.

startedAt
string

The time the run started.

cancelledAt
string

The time the run was cancelled.

completedAt
string

The time the run was completed.

failedAt
string

The time the run failed.

model
string

The model used for the run.

instructions
string

The instructions for the run.

tools
object[]

The tools used in the run.

fileIds
string[]

The file IDs used in the run.

metadata
object

The metadata for the run.

usage
object