Skip to content

Compute API

The Sartiq Compute API handles ML inference, training tasks, and workflow orchestration. It is the processing backbone for all image generation operations.


Overview

Property Value
Base URL https://compute-api.sartiq.com/api/v1
Protocol HTTPS (TLS 1.2+)
Format JSON
Authentication API Key (Bearer)
OpenAPI Spec openapi.json

Architecture

The Compute API manages asynchronous task execution across a distributed worker pool.

flowchart LR
    subgraph Clients
        BE[Backend API]
        INT[Internal Tools]
    end

    subgraph Compute["Compute API"]
        API[API Server]
        Q[Task Queue]
    end

    subgraph Workers["Worker Pool"]
        W1[GPU Worker 1]
        W2[GPU Worker 2]
        W3[GPU Worker N]
    end

    subgraph Storage
        S3[Object Storage]
    end

    BE --> API
    INT --> API
    API --> Q
    Q --> W1
    Q --> W2
    Q --> W3
    W1 --> S3
    W2 --> S3
    W3 --> S3

API Resources

Tasks

Individual processing jobs (generation, upscaling, etc.).

Endpoint Method Description
/tasks/ POST Create a new task
/tasks/{task_id} GET Get task status
/tasks/{task_id}/cancel POST Cancel a running task
/tasks/generation POST Create generation task
/tasks/generation/{task_id} GET Get generation task details

Training

Model training and fine-tuning jobs.

Endpoint Method Description
/training/ POST Start training job
/training/{task_id} GET Get training status
/training/{task_id}/cancel POST Cancel training

Workflows

Multi-step orchestrated pipelines.

Endpoint Method Description
/workflows/ POST Create workflow
/workflows/{workflow_id} GET Get workflow status
/workflows/{workflow_id}/start POST Start workflow execution
/workflows/{workflow_id}/resume POST Resume paused workflow
/workflows/{workflow_id}/cleanup POST Clean up workflow resources

Monitoring

System observability endpoints.

Endpoint Method Description
/monitoring/queues GET Queue depths and status
/monitoring/workers GET Worker pool status
/monitoring/workers/health GET Worker health checks
/monitoring/tasks GET Recent task activity
/monitoring/workflows GET Workflow statistics
/monitoring/stats GET System-wide statistics

Storage

Asset storage operations.

Endpoint Method Description
/storage/images POST Upload image
/storage/images/{path} GET Retrieve image

Getting Started

1. Authenticate

All endpoints require an API key passed as a Bearer token in the Authorization header. The API key is configured on the Compute Server via the API_KEY environment variable.

# Set your API key
export API_KEY="your-api-key"

2. Submit a Task

curl -X POST https://compute-api.sartiq.com/api/v1/tasks/generation \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_image_url": "https://...",
    "prompt": "fashion model wearing the product",
    "model": "default",
    "num_outputs": 4
  }'

3. Check Status

curl https://compute-api.sartiq.com/api/v1/tasks/{task_id} \
  -H "Authorization: Bearer $API_KEY"

Documentation

Section Description
Endpoints Complete API reference (OpenAPI)
Schemas Request/response data models
Rate Limits Rate limiting and quotas
Examples Common workflows with code samples