Python
Together AI SDK (Python)
from together import Togetherimport osclient = Together( api_key=os.environ.get("TOGETHER_API_KEY"),)current_dir = os.path.dirname(os.path.abspath(__file__))file_path = os.path.join(current_dir, "data.jsonl")file = client.files.upload(file=file_path)print(file.id)
{ "id": "<string>", "object": "file", "created_at": 1715021438, "filename": "my_file.jsonl", "bytes": 2664, "purpose": "fine-tune", "Processed": true, "FileType": "jsonl", "LineCount": 123 }
Upload a file with specified purpose, file name, and file type.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
File uploaded successfully
The response is of type object.
object
Was this page helpful?