POST
/
v1
/
threads
curl --request POST \
  --url https://studio.tune.app/v1/threads \
  --header 'Content-Type: application/json' \
  --header 'X-Tune-Key: <api-key>' \
  --data '{
  "messages": [
    {
      "id": "<string>",
      "object": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "threadId": "<string>",
      "role": "<string>",
      "content": [
        {
          "type": "<string>",
          "text": "<string>",
          "imageFile": {
            "fileId": "<string>",
            "detail": "<string>"
          },
          "imageUrl": {
            "url": "<string>",
            "detail": "<string>"
          }
        }
      ],
      "attachments": [
        {
          "fileId": "<string>",
          "tools": [
            {
              "id": "<string>",
              "name": "<string>",
              "type": "<string>",
              "function": {
                "name": "<string>",
                "description": "<string>",
                "parameters": {},
                "required": [
                  "<string>"
                ]
              },
              "openapiSpec": "<string>",
              "openapiActionData": {}
            }
          ]
        }
      ],
      "assistantId": "<string>",
      "runId": "<string>",
      "metadata": {}
    }
  ],
  "metadata": {},
  "title": "<string>",
  "datasetId": "<string>",
  "toolResources": {
    "codeInterpreter": {
      "fileIds": [
        "<string>"
      ]
    },
    "fileSearch": {
      "vectorStoreIds": [
        "<string>"
      ],
      "vectorStores": [
        {
          "fileIds": [
            "<string>"
          ],
          "metadata": {}
        }
      ]
    }
  }
}'
{
  "id": "<string>",
  "object": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "metadata": {},
  "title": "<string>",
  "toolResources": {
    "codeInterpreter": {
      "fileIds": [
        "<string>"
      ]
    },
    "fileSearch": {
      "vectorStoreIds": [
        "<string>"
      ],
      "vectorStores": [
        {
          "fileIds": [
            "<string>"
          ],
          "metadata": {}
        }
      ]
    }
  }
}

Authorizations

X-Tune-Key
string
header
required

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)

Body

application/json
messages
object[]

List of messages to be added to the thread.

metadata
object

Metadata to store additional information in key-value pair.

title
string

Title of the thread (optional).

datasetId
string

Dataset ID if the thread is related to a dataset (optional).

toolResources
object

Response

200
application/json
A successful response.
id
string

The ID of the thread.

object
string

"thread".

createdAt
string

The time the thread was created.

metadata
object

Metadata for the thread key-value pairs.

title
string

The title of the thread.

toolResources
object