POST
/
tci
/
execute
from together import Together
import os

client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)

response = client.code_interpreter.run(
code="print('Hello world!')",
language="python",
)

print(response.data.outputs[0].data);
{
  "errors": null,
  "data": {
    "outputs": [
      {
        "type": "stdout",
        "data": "<string>"
      }
    ],
    "session_id": "ses_abcDEF123",
    "status": "success"
  }
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Execute Request

The body is of type object.

Response

200 - application/json

Execute Response

The result of the execution. If successful, data contains the result and errors will be null. If unsuccessful, data will be null and errors will contain the errors.