Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gravixlayer.ai/llms.txt

Use this file to discover all available pages before exploring further.

import io
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

# Upload from a file-like object (any binary stream)
buffer = io.BytesIO(b"hello from local upload\n")
response = runtime.file.upload_file(buffer, path="/workspace/local-file.txt")
print(response.message)
print(response.path)
print(response.size)

# Or upload bytes/string directly with `upload` (no file handle required)
runtime.file.upload("/workspace/notes.txt", b"plain text bytes\n")

runtime.kill()

Parameters

ParameterTypeRequiredDescription
fileBinaryIOYesFile object opened in binary mode
pathstringNoDestination path inside runtime

Response

FieldTypeDescription
messagestringConfirmation message
pathstringUploaded file path
sizeintegerFile size in bytes