The SLYD API provides programmatic access to all SLYD platform features, enabling you to deploy compute resources, manage applications, and interact with Benson AI.
All API requests require authentication using an API key. To obtain your API key, visit the API Keys section in your account settings.
All API endpoints are accessible from the following base URL:
https://api.slyd.ai/v1
Authentication is performed using an API key which should be included in all requests as a bearer token in the Authorization header:
Authorization: Bearer your_api_key
All API responses are returned in JSON format. Successful requests return a 2xx status code, while errors return appropriate 4xx or 5xx status codes with descriptive error messages.
{
"status": "success",
"data": {
"id": "inst_1234567890abcdef",
"name": "llm-training",
"status": "running",
"created_at": "2025-03-24T08:30:45Z"
}
}
{
"status": "error",
"code": "unauthorized",
"message": "Invalid API key provided",
"request_id": "req_abcdefg123456"
}
The Instances API allows you to create, manage, and monitor compute instances on the SLYD platform.
Creates a new compute instance with the specified configuration.
POST /instances
import slyd
# Initialize the client with your API key
client = slyd.Client(api_key="your_api_key")
# Define instance configuration
instance_config = {
"name": "llm-training",
"hardware": {
"gpu_model": "nvidia-a100",
"gpu_count": 1,
"cpu_cores": 32,
"memory_gb": 128,
"storage_gb": 1000
},
"applications": [
{"id": "pytorch-2.0", "version": "latest"}
],
"region": "us-west"
}
# Create the instance
instance = client.instances.create(instance_config)
print(f"Instance created: {instance.id}")
print(f"Status: {instance.status}")
# Wait for the instance to be ready
instance.wait_until_ready()
print(f"Instance is ready: {instance.ip_address}")
const SLYD = require('slyd-sdk');
// Initialize the client with your API key
const client = new SLYD.Client({ apiKey: 'your_api_key' });
// Define instance configuration
const instanceConfig = {
name: 'llm-training',
hardware: {
gpu_model: 'nvidia-a100',
gpu_count: 1,
cpu_cores: 32,
memory_gb: 128,
storage_gb: 1000
},
applications: [
{ id: 'pytorch-2.0', version: 'latest' }
],
region: 'us-west'
};
// Create the instance
async function createInstance() {
try {
const instance = await client.instances.create(instanceConfig);
console.log(`Instance created: ${instance.id}`);
console.log(`Status: ${instance.status}`);
// Wait for the instance to be ready
await instance.waitUntilReady();
console.log(`Instance is ready: ${instance.ipAddress}`);
} catch (error) {
console.error('Error creating instance:', error);
}
}
createInstance();
curl -X POST \
https://api.slyd.ai/v1/instances \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "llm-training",
"hardware": {
"gpu_model": "nvidia-a100",
"gpu_count": 1,
"cpu_cores": 32,
"memory_gb": 128,
"storage_gb": 1000
},
"applications": [
{"id": "pytorch-2.0", "version": "latest"}
],
"region": "us-west"
}'
Retrieves a list of all instances in your account.
GET /instances
import slyd
client = slyd.Client(api_key="your_api_key")
# List all instances
instances = client.instances.list()
# Print instance details
for instance in instances:
print(f"ID: {instance.id}")
print(f"Name: {instance.name}")
print(f"Status: {instance.status}")
print(f"Created: {instance.created_at}")
print("---")
Retrieves detailed information about a specific instance.
GET /instances/{instance_id}
import slyd
client = slyd.Client(api_key="your_api_key")
# Get instance details
instance_id = "inst_1234567890abcdef"
instance = client.instances.get(instance_id)
print(f"ID: {instance.id}")
print(f"Name: {instance.name}")
print(f"Status: {instance.status}")
print(f"IP Address: {instance.ip_address}")
print(f"Hardware: {instance.hardware}")
print(f"Applications: {instance.applications}")
print(f"Created: {instance.created_at}")
The Benson AI API allows you to interact with Benson for resource recommendations and optimization.
Requests a recommendation from Benson AI based on your project description and preferences.
POST /benson/recommend
import slyd
client = slyd.Client(api_key="your_api_key")
# Ask Benson for a recommendation
recommendation = client.benson.recommend(
project_description="I need to train a large language model with approximately 7 billion parameters. I have about 100GB of text data for training.",
preferences={
"budget": "medium",
"priority": "speed",
"framework": "pytorch"
}
)
print(f"Recommendation ID: {recommendation.id}")
print(f"Recommended hardware: {recommendation.hardware}")
print(f"Estimated training time: {recommendation.estimated_time}")
print(f"Estimated cost: ${recommendation.estimated_cost}")
# Deploy the recommended configuration
instance = client.instances.create_from_recommendation(recommendation.id)
print(f"Instance created: {instance.id}")
Endpoint | Method | Description |
---|---|---|
/instances | GET | List all instances |
/instances | POST | Create a new instance |
/instances/{id} | GET | Get instance details |
/instances/{id} | DELETE | Terminate an instance |
/instances/{id}/start | POST | Start a stopped instance |
/instances/{id}/stop | POST | Stop a running instance |
Endpoint | Method | Description |
---|---|---|
/applications | GET | List all available applications |
/applications/{id} | GET | Get application details |
/applications/{id}/versions | GET | List available versions of an application |
/instances/{id}/applications | GET | List applications installed on an instance |
/instances/{id}/applications | POST | Install an application on an instance |
/instances/{id}/applications/{app_id} | DELETE | Uninstall an application from an instance |
We're constantly improving our documentation. Let us know how we can make it better!