API Overview
The Syaala Platform provides a comprehensive REST API for programmatic access to all platform features.
Base URL
All API requests are made to:
https://platform.syaala.com/apiDevelopment Environment: Use http://localhost:3001/api for local development.
Authentication
All API requests require authentication via the Authorization header:
curl -X GET https://platform.syaala.com/api/deployments \
-H "Authorization: Bearer YOUR_API_KEY"See Authentication Guide for details on obtaining API keys.
Request Format
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer YOUR_API_KEY |
Content-Type | Yes (POST/PUT) | application/json |
X-Organization-ID | Optional | Override default organization |
Example Request
curl -X POST https://platform.syaala.com/api/deployments \
-H "Authorization: Bearer sk_live_1a2b3c4d5e6f7g8h9i0j" \
-H "Content-Type: application/json" \
-d '{
"name": "my-deployment",
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"runtime": "vllm",
"gpu": "NVIDIA-RTX-4090"
}'Response Format
Success Response
{
"success": true,
"data": {
"id": "dep_a1b2c3d4e5f6",
"name": "my-deployment",
"status": "running",
"endpoint": "https://dep-a1b2c3d4.syaala.run"
}
}Error Response
{
"success": false,
"error": {
"code": "INVALID_MODEL",
"message": "Model 'invalid-model' not found on HuggingFace",
"details": {
"model": "invalid-model",
"valid_sources": ["huggingface", "custom"]
}
}
}HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource not found |
| 409 | Conflict | Resource already exists |
| 422 | Unprocessable Entity | Validation error |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error |
| 503 | Service Unavailable | Service temporarily unavailable |
Error Codes
Common error codes you may encounter:
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_API_KEY | 401 | API key is invalid or expired |
INSUFFICIENT_PERMISSIONS | 403 | API key lacks required permissions |
RATE_LIMIT_EXCEEDED | 429 | Too many requests in time window |
INVALID_MODEL | 400 | Model not found or inaccessible |
GPU_UNAVAILABLE | 503 | Requested GPU type not available |
INSUFFICIENT_CREDITS | 402 | Not enough credits for operation |
DEPLOYMENT_NOT_FOUND | 404 | Deployment ID does not exist |
DEPLOYMENT_FAILED | 500 | Deployment failed to start |
Error Handling Example
const response = await fetch('https://platform.syaala.com/api/deployments', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(deploymentConfig)
})
const result = await response.json()
if (!response.ok) {
// Handle specific error codes
switch (result.error.code) {
case 'RATE_LIMIT_EXCEEDED':
const retryAfter = response.headers.get('Retry-After')
console.log(`Rate limited. Retry after ${retryAfter} seconds`)
break
case 'INSUFFICIENT_CREDITS':
console.log('Please add credits at https://platform.syaala.com/dashboard/billing')
break
case 'INVALID_MODEL':
console.log(`Model not found: ${result.error.details.model}`)
break
default:
console.error('API Error:', result.error.message)
}
}Rate Limiting
Rate limits vary by plan tier:
| Plan | Rate Limit | Burst Limit |
|---|---|---|
| Free | 60 requests/minute | 100 requests |
| Startup | 600 requests/minute | 1,000 requests |
| Growth | 6,000 requests/minute | 10,000 requests |
| Enterprise | Custom | Custom |
Rate Limit Headers
Every API response includes rate limit information:
HTTP/1.1 200 OK
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 587
X-RateLimit-Reset: 1728003600
Retry-After: 13X-RateLimit-Limit: Max requests per minuteX-RateLimit-Remaining: Requests remaining in windowX-RateLimit-Reset: Unix timestamp when limit resetsRetry-After: Seconds until next request allowed (only on 429 errors)
Handling Rate Limits
async function makeRequestWithRetry(url: string, options: RequestInit, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options)
if (response.status !== 429) {
return response
}
const retryAfter = parseInt(response.headers.get('Retry-After') || '60')
console.log(`Rate limited. Waiting ${retryAfter} seconds...`)
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000))
}
throw new Error('Max retries exceeded')
}Pagination
List endpoints support cursor-based pagination:
Request Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Number of results per page (max: 100) |
cursor | string | - | Cursor from previous response |
Example
# First page
curl "https://platform.syaala.com/api/deployments?limit=20"
# Response
{
"data": [...],
"pagination": {
"hasMore": true,
"nextCursor": "eyJpZCI6ImRlcF94eXoiLCJjcmVhdGVkQXQiOiIyMDI1LTEwLTAxIn0"
}
}
# Next page
curl "https://platform.syaala.com/api/deployments?limit=20&cursor=eyJpZCI6ImRlcF94eXoiLCJjcmVhdGVkQXQiOiIyMDI1LTEwLTAxIn0"Pagination in TypeScript
async function fetchAllDeployments() {
const deployments: Deployment[] = []
let cursor: string | undefined
while (true) {
const params = new URLSearchParams({
limit: '100',
...(cursor && { cursor })
})
const response = await fetch(`https://platform.syaala.com/api/deployments?${params}`, {
headers: { 'Authorization': `Bearer ${apiKey}` }
})
const result = await response.json()
deployments.push(...result.data)
if (!result.pagination.hasMore) break
cursor = result.pagination.nextCursor
}
return deployments
}Filtering and Sorting
List endpoints support filtering and sorting:
Filtering
# Filter deployments by status
GET /api/deployments?status=running
# Filter by multiple values
GET /api/deployments?status=running,deploying
# Filter by date range
GET /api/deployments?created_after=2025-10-01&created_before=2025-10-31Sorting
# Sort by creation date (ascending)
GET /api/deployments?sort=created_at
# Sort by creation date (descending)
GET /api/deployments?sort=-created_at
# Multiple sort fields
GET /api/deployments?sort=-status,created_atVersioning
The Syaala API uses URL-based versioning:
https://platform.syaala.com/api/v1/deploymentsCurrent Version: v1 (default, no version prefix required)
When breaking changes are introduced, a new version will be released:
v1→ Current stable version (implied when no version specified)v2→ Future version with breaking changes
Version Compatibility: We maintain backward compatibility for at least 12 months after releasing a new version.
Webhooks
Syaala can send webhooks for deployment events:
Event Types
| Event | Trigger |
|---|---|
deployment.created | New deployment created |
deployment.running | Deployment started successfully |
deployment.failed | Deployment failed to start |
deployment.scaled | Deployment auto-scaled |
deployment.stopped | Deployment manually stopped |
deployment.deleted | Deployment deleted |
Webhook Payload
{
"event": "deployment.running",
"timestamp": "2025-10-01T10:00:00Z",
"data": {
"id": "dep_a1b2c3d4e5f6",
"name": "my-deployment",
"status": "running",
"endpoint": "https://dep-a1b2c3d4.syaala.run",
"gpu": "NVIDIA-RTX-4090",
"replicas": 2
}
}Configuring Webhooks
curl -X POST https://platform.syaala.com/api/webhooks \
-H "Authorization: Bearer sk_live_..." \
-d '{
"url": "https://your-app.com/webhooks/syaala",
"events": ["deployment.running", "deployment.failed"],
"secret": "whsec_your_webhook_secret"
}'Available Endpoints
Deployments
/api/deployments🔒 Auth RequiredList all deployments
/api/deployments🔒 Auth RequiredCreate a new deployment
/api/deployments/{`id`}🔒 Auth RequiredGet deployment details
/api/deployments/{`id`}🔒 Auth RequiredUpdate deployment configuration
/api/deployments/{`id`}🔒 Auth RequiredDelete a deployment
Models
/api/models🔒 Auth RequiredList available models
/api/models/templates🔒 Auth RequiredGet deployment templates
Billing
/api/billing/usage🔒 Auth RequiredGet current usage and costs
/api/billing/invoices🔒 Auth RequiredList invoices
Alerts
/api/alerts🔒 Auth RequiredList alerts
/api/alerts🔒 Auth RequiredCreate a new alert
SDKs
Official SDKs are available for popular languages:
- TypeScript/JavaScript -
npm install @syaala/sdk - Python -
pip install syaala - Go -
go get github.com/syaala/syaala-go - Rust -
cargo add syaala
OpenAPI Specification
Download the complete OpenAPI spec:
curl https://platform.syaala.com/api/openapi.json > syaala-api.jsonUse with tools like:
- Postman: Import OpenAPI spec for interactive testing
- Swagger UI: Generate interactive API documentation
- Code Generators: Generate SDKs in any language
Support
Need help with the API?
- API Reference: Complete endpoint documentation
- Discord Community: Ask questions and share feedback
- GitHub Issues: Report bugs
- Support Email: Enterprise support