Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
import Together from "together-ai";
const client = new Together({
  apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.codeInterpreter.sessions.list();
for (const session of response.data?.sessions) {
  console.log(session.id);
}{
  "errors": [
    "<string>"
  ],
  "data": {
    "sessions": [
      {
        "execute_count": 123,
        "expires_at": "2023-11-07T05:31:56Z",
        "id": "ses_abcDEF123",
        "last_execute_at": "2023-11-07T05:31:56Z",
        "started_at": "2023-11-07T05:31:56Z"
      }
    ]
  }
}Lists all your currently active sessions.
import Together from "together-ai";
const client = new Together({
  apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.codeInterpreter.sessions.list();
for (const session of response.data?.sessions) {
  console.log(session.id);
}{
  "errors": [
    "<string>"
  ],
  "data": {
    "sessions": [
      {
        "execute_count": 123,
        "expires_at": "2023-11-07T05:31:56Z",
        "id": "ses_abcDEF123",
        "last_execute_at": "2023-11-07T05:31:56Z",
        "started_at": "2023-11-07T05:31:56Z"
      }
    ]
  }
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?