Getting StartedAPI Overview

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/api

Development 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

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY
Content-TypeYes (POST/PUT)application/json
X-Organization-IDOptionalOverride 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

CodeMeaningDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions
404Not FoundResource not found
409ConflictResource already exists
422Unprocessable EntityValidation error
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error
503Service UnavailableService temporarily unavailable

Error Codes

Common error codes you may encounter:

Error CodeHTTP StatusDescription
INVALID_API_KEY401API key is invalid or expired
INSUFFICIENT_PERMISSIONS403API key lacks required permissions
RATE_LIMIT_EXCEEDED429Too many requests in time window
INVALID_MODEL400Model not found or inaccessible
GPU_UNAVAILABLE503Requested GPU type not available
INSUFFICIENT_CREDITS402Not enough credits for operation
DEPLOYMENT_NOT_FOUND404Deployment ID does not exist
DEPLOYMENT_FAILED500Deployment 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:

PlanRate LimitBurst Limit
Free60 requests/minute100 requests
Startup600 requests/minute1,000 requests
Growth6,000 requests/minute10,000 requests
EnterpriseCustomCustom

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: 13
  • X-RateLimit-Limit: Max requests per minute
  • X-RateLimit-Remaining: Requests remaining in window
  • X-RateLimit-Reset: Unix timestamp when limit resets
  • Retry-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

ParameterTypeDefaultDescription
limitnumber20Number of results per page (max: 100)
cursorstring-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-31

Sorting

# 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_at

Versioning

The Syaala API uses URL-based versioning:

https://platform.syaala.com/api/v1/deployments

Current 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

EventTrigger
deployment.createdNew deployment created
deployment.runningDeployment started successfully
deployment.failedDeployment failed to start
deployment.scaledDeployment auto-scaled
deployment.stoppedDeployment manually stopped
deployment.deletedDeployment 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

GET/api/deployments🔒 Auth Required

List all deployments

POST/api/deployments🔒 Auth Required

Create a new deployment

GET/api/deployments/{`id`}🔒 Auth Required

Get deployment details

PATCH/api/deployments/{`id`}🔒 Auth Required

Update deployment configuration

DELETE/api/deployments/{`id`}🔒 Auth Required

Delete a deployment

Models

GET/api/models🔒 Auth Required

List available models

GET/api/models/templates🔒 Auth Required

Get deployment templates

Billing

GET/api/billing/usage🔒 Auth Required

Get current usage and costs

GET/api/billing/invoices🔒 Auth Required

List invoices

Alerts

GET/api/alerts🔒 Auth Required

List alerts

POST/api/alerts🔒 Auth Required

Create a new alert


SDKs

Official SDKs are available for popular languages:


OpenAPI Specification

Download the complete OpenAPI spec:

curl https://platform.syaala.com/api/openapi.json > syaala-api.json

Use 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?