Skip to main content

Runs

API Reference​

List all thread runs.​

Returns a list of thread runs, which represent individual executions or interactions within a thread.

path=/threads/{threadId}/runs method=get Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/runs', {
method: 'GET',
headers: {},
});
const data = await response.json();

Python

import requests

response = requests.get(
"https://api.umamiai.xyz/v1/threads/{threadId}/runs",
headers={"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
)
data = response.json()

Curl

curl -L \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
'https://api.umamiai.xyz/v1/threads/{threadId}/runs'

Response

[
{
"id": "text",
"assistant_id": "text",
"cancelled_at": 0,
"completed_at": 0,
"created_at": 0,
"expires_at": 0,
"failed_at": 0,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"instructions": "text",
"last_error": {
"code": "server_error",
"message": "text"
},
"max_completion_tokens": 0,
"max_prompt_tokens": 0,
"model": "text",
"object": "thread.run",
"parallel_tool_calls": false,
"required_action": {
"submit_tool_outputs": {
"tool_calls": []
},
"type": "submit_tool_outputs"
},
"started_at": 0,
"status": "queued",
"thread_id": "text",
"tools": [],
"truncation_strategy": {
"type": "auto",
"last_messages": 0
},
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
},
"temperature": 0,
"top_p": 0
}
]

Create a new thread run.​

Creates a new thread run, executing a task or interaction within a thread context.

path=/threads/{threadId}/runs method=post

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/runs', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"
},
body: JSON.stringify({
"assistant_id": "text"
}),
});
const data = await response.json();

Python

import requests

response = requests.post(
"https://api.umamiai.xyz/v1/threads/{threadId}/runs",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={"assistant_id":"text"}
)
data = response.json()

Curl

curl -L \
-X POST \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
-H 'Content-Type: application/json' \
'https://api.umamiai.xyz/v1/threads/{threadId}/runs' \
-d '{"assistant_id":"text"}'

Response

{
"id": "text",
"assistant_id": "text",
"cancelled_at": 0,
"completed_at": 0,
"created_at": 0,
"expires_at": 0,
"failed_at": 0,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"instructions": "text",
"last_error": {
"code": "server_error",
"message": "text"
},
"max_completion_tokens": 0,
"max_prompt_tokens": 0,
"model": "text",
"object": "thread.run",
"parallel_tool_calls": false,
"required_action": {
"submit_tool_outputs": {
"tool_calls": []
},
"type": "submit_tool_outputs"
},
"started_at": 0,
"status": "queued",
"thread_id": "text",
"tools": [],
"truncation_strategy": {
"type": "auto",
"last_messages": 0
},
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
},
"temperature": 0,
"top_p": 0
}

Update a thread run’s details.​

Updates the details of a thread run, modifying its status or context.

path=/threads/{threadId}/runs/{runId} method=post

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"
},
body: JSON.stringify({}),
});
const data = await response.json();

Python

import requests

response = requests.post(
"https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={}
)
data = response.json()

Curl

curl -L \
-X POST \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
-H 'Content-Type: application/json' \
'https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}' \
-d '{}'

Response

{
"id": "text",
"assistant_id": "text",
"cancelled_at": 0,
"completed_at": 0,
"created_at": 0,
"expires_at": 0,
"failed_at": 0,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"instructions": "text",
"last_error": {
"code": "server_error",
"message": "text"
},
"max_completion_tokens": 0,
"max_prompt_tokens": 0,
"model": "text",
"object": "thread.run",
"parallel_tool_calls": false,
"required_action": {
"submit_tool_outputs": {
"tool_calls": []
},
"type": "submit_tool_outputs"
},
"started_at": 0,
"status": "queued",
"thread_id": "text",
"tools": [],
"truncation_strategy": {
"type": "auto",
"last_messages": 0
},
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
},
"temperature": 0,
"top_p": 0
}

Get details of a specific thread run.​

Retrieves a single thread run by its ID, providing access to its execution details.

path=/threads/{threadId}/runs/{runId} method=get

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}', {
method: 'GET',
headers: {"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
});
const data = await response.json();

Python

import requests

response = requests.get(
"https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}",
headers={"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
)
data = response.json()

Curl

curl -L \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
'https://api.umamiai.xyz/v1/threads/{threadId}/runs/{runId}'

Response

{
"id": "text",
"assistant_id": "text",
"cancelled_at": 0,
"completed_at": 0,
"created_at": 0,
"expires_at": 0,
"failed_at": 0,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"instructions": "text",
"last_error": {
"code": "server_error",
"message": "text"
},
"max_completion_tokens": 0,
"max_prompt_tokens": 0,
"model": "text",
"object": "thread.run",
"parallel_tool_calls": false,
"required_action": {
"submit_tool_outputs": {
"tool_calls": []
},
"type": "submit_tool_outputs"
},
"started_at": 0,
"status": "queued",
"thread_id": "text",
"tools": [],
"truncation_strategy": {
"type": "auto",
"last_messages": 0
},
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
},
"temperature": 0,
"top_p": 0
}