Skip to main content

Threads

API Reference​

Delete a thread.​

Deletes a thread, permanently removing the conversation.

path=/threads/{threadId} method=delete

Request

JavaScript

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

Python

import requests

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

Curl

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

Response

{
"id": "text",
"object": "thread.deleted",
"deleted": false
}

Create a new conversation thread.​

Creates a new thread, initiating a conversation or interaction.

path=/threads method=post

Request

JavaScript

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

Python

import requests

response = requests.post(
"https://api.umamiai.xyz/v1/threads",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={"messages":["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' \
-d '{"messages":["text"]}'

Response

{
"id": "text",
"created_at": 0,
"object": "thread",
"tool_resources": {
"code_interpreter": {
"file_ids": [
"text"
]
},
"file_search": {
"vector_store_ids": [
"text"
]
}
}
}

Get details of a specific thread.​

Retrieves a single thread by its ID, providing access to its details and messages.

path=/threads/{threadId} method=get

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}', {
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}",
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}'

Response

{
"id": "text",
"created_at": 0,
"object": "thread",
"tool_resources": {
"code_interpreter": {
"file_ids": [
"text"
]
},
"file_search": {
"vector_store_ids": [
"text"
]
}
}
}

Update a thread’s information.​

Updates the information or context of an existing thread.

path=/threads/{threadId} method=post

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}', {
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}",
headers={"Content-Type":"application/json"},
json={"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"}
)
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}' \
-d '{}'

Response

{
"id": "text",
"created_at": 0,
"object": "thread",
"tool_resources": {
"code_interpreter": {
"file_ids": [
"text"
]
},
"file_search": {
"vector_store_ids": [
"text"
]
}
}
}

Example​

thread = client.beta.threads.create(
messages=[
{
"role": "user",
"content": "Create 3 data visualizations based on the trends in this file.",
"attachments": [
{
"file_id": file.id,
"tools": [{"type": "code_interpreter"}]
}
]
}
]
)