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.

Install the SDK

pip install gravixlayer

Run Your First Agent Runtime

from gravixlayer import GravixLayer

client = GravixLayer()

# Create an agent runtime
runtime = client.runtime.create(template="python-3.14-base-small")
print(f"Runtime: {runtime.runtime_id} ({runtime.status})")

# Run Python code
result = runtime.run_code(code="print('Hello from Gravix Layer!')")
print(result.text)  # Hello from Gravix Layer!

# Terminate the runtime
runtime.kill()

Run a Terminal Command

from gravixlayer import GravixLayer

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

cmd = runtime.run_cmd(command="python --version")
print(cmd.stdout)

cmd = runtime.run_cmd(command="python", args=["--version"])
print(cmd.stdout)

runtime.kill()

Write and Read Files

from gravixlayer import GravixLayer

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

# Write a file
runtime.file.write("/workspace/hello.txt", "Hello World\n")

# Read it back
file = runtime.file.read("/workspace/hello.txt")
print(file.content)  # Hello World

runtime.kill()

What’s Next

Code Execution

Run Python and JavaScript

Terminal

Shell commands and package installs

Custom Templates

Build your own runtime environments

Access Runtime

SSH or web terminal access