P
Parsyn
/Docs
Back to Home

REST API Reference

Complete reference for the Parsyn API at https://parsyn.progatis.com/api/v1. All endpoints require authentication unless noted otherwise.

Most users interact with Parsyn through the dashboard. This API reference is for developers building integrations, automating workflows, or scripting against the platform.

Authentication

The API uses JWT bearer tokens:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Tokens are also set as httpOnly cookies on login, so the dashboard authenticates automatically.

Token lifecycle

Token typeLifetimePurpose
Access token30 minutesAPI authentication
Refresh token7 daysObtain new access tokens without re-login
Partial token5 minutesIntermediate state during 2FA verification
WebSocket token60 secondsOne-time token for dashboard WebSocket handshake

Auth

Register

POST/auth/register
{
  "email": "[email protected]",
  "password": "securePassword123",
  "username": "johndoe"
}

// Response 201
{
  "id": 1,
  "email": "[email protected]",
  "username": "johndoe",
  "created_at": "2026-03-10T14:30:00Z"
}

Login

POST/auth/login
{
  "email": "[email protected]",
  "password": "securePassword123"
}

// Response 200
{
  "access_token": "eyJhbGci...",
  "refresh_token": "eyJhbGci...",
  "token_type": "bearer",
  "user": {
    "id": 1,
    "email": "[email protected]",
    "username": "johndoe"
  }
}

Refresh token

POST/auth/refresh

Get current user

GET/auth/me

Update profile

PATCH/auth/me/locale

Sessions

GET/auth/sessions
DELETE/auth/sessions/{session_id}
POST/auth/sessions/revoke-others

List active sessions, revoke a specific session, or revoke all sessions except the current one.

Two-factor authentication

POST/2fa/totp/setup
POST/2fa/totp/verify-setup
POST/2fa/backup-codes/regenerate

Datasets

List datasets

GET/datasets?page=1&per_page=20&search=customer

Create dataset

POST/datasets

Get / Update / Delete dataset

GET/datasets/{id}
PATCH/datasets/{id}
DELETE/datasets/{id}

Upload flow

POST/datasets/upload/initiate
POST/datasets/upload/confirm
POST/datasets/upload/confirm

Operations

POST/datasets/{id}/validate
POST/datasets/{id}/preprocess/sample
GET/datasets/{id}/statistics
GET/datasets/{id}/statistics
POST/datasets/{id}/preprocess/convert
POST/datasets/{id}/preprocess/split
POST/datasets/{id}/preprocess/deduplicate
POST/datasets/{id}/preprocess/normalize

Models

GET/models?page=1&per_page=20&status=ready
POST/models
// From HuggingFace
{ "name": "llama-3.1-8b", "huggingface_id": "meta-llama/Llama-3.1-8B" }

// Custom upload
{ "name": "my-custom-model", "description": "Proprietary architecture" }
GET/models/{id}
PATCH/models/{id}
DELETE/models/{id}

Training Jobs

List available workers

GET/training-jobs/available-workers

Returns workers (both your workers and Parsyn Workers) that are available for job assignment.

List / Create / Get

GET/training-jobs?page=1&per_page=20&status=running
POST/training-jobs
{
  "name": "llama-customer-support-v1",
  "dataset_id": 42,
  "model_id": 7,
  "config": {
    "epochs": 3,
    "batch_size": 4,
    "learning_rate": 2e-4,
    "max_length": 1024,
    "mixed_precision": "bf16",
    "use_peft": true,
    "lora_r": 16
  },
  "worker_selection": {
    "mode": "auto"
  }
}
GET/training-jobs/{id}

Start / Cancel / Delete

POST/training-jobs/{id}/start
DELETE/training-jobs/{id}

Metrics

GET/training-jobs/{id}/metrics
GET/training-jobs/{id}/metrics

Workers (your GPUs)

GET/workers?page=1&per_page=20

Workers are created automatically through the enrollment flow (WebSocket /ws/worker with an enroll_... key). There is no manual creation endpoint.

GET/workers/{id}
PATCH/workers/{id}
DELETE/workers/{id}
GET/workers/connected

Master Enrollment Keys

POST/master-keys
{
  "name": "production-fleet",
  "auto_name_prefix": "prod-worker",
  "default_worker_type": "both",
  "max_enrollments": 50,
  "expires_at": "2027-01-01T00:00:00Z"
}
GET/master-keys
DELETE/master-keys/{id}

Chat / Inference

Chat with model

POST/chat/models/{model_id}/chat
{
  "message": "Explain gradient descent in simple terms.",
  "temperature": 0.7,
  "max_tokens": 500,
  "top_p": 0.9,
  "top_k": 50,
  "repetition_penalty": 1.1,
  "conversation_id": null
}

Returns SSE stream with Accept: text/event-stream, or JSON otherwise. Requires an online user worker with prompter or both capability.

Compare models

POST/chat/models/{model_id}/compare
{
  "message": "What is overfitting?",
  "compare_model_id": 8,
  "temperature": 0.7
}

Credits

Get balance

GET/credits/balance
// Response
{ "balance": 5000 }

Purchase credits

POST/subscriptions/checkout

Initiates a Stripe checkout session for the selected credit pack.

Estimate job cost

POST/credits/estimate-job
{
  "gpu_type": "a100_80gb",
  "estimated_hours": 2
}

// Response
{ "estimated_credits": 400, "credits_per_hour": 200 }

Transaction history

GET/credits/transactions?page=1&type=deduction

Credit packs

GET/credits/packs

Evaluations

POST/evaluation-suites
GET/evaluation-suites
GET/evaluations/models/{model_id}
POST/evaluation-suites/runs/{run_id}/cancel

Evaluation Suites

Structured evaluation using predefined prompt sets. Unlike simple evaluations, suites let you run and compare results across multiple models and training runs.

GET/evaluation-suites
POST/evaluation-suites
GET/evaluation-suites/{id}
PATCH/evaluation-suites/{id}
DELETE/evaluation-suites/{id}
POST/evaluation-suites/{id}/run

Start a new evaluation run against the suite's prompt set.

GET/evaluation-suites/{id}/runs
GET/evaluation-suites/runs/{run_id}

Training Pipelines

Automated multi-step workflows. Each pipeline defines a sequence of steps (e.g., train → evaluate → export). The platform runs them sequentially and handles failures.

GET/pipelines
POST/pipelines
GET/pipelines/{id}
DELETE/pipelines/{id}
POST/pipelines/{id}/start
POST/pipelines/{id}/cancel

Synthetic Data

Generate, augment, paraphrase, or filter datasets using LLMs. A synthetic data job consumes an LLM provider API and produces a new dataset.

GET/synthetic-data
POST/synthetic-data
{
  "name": "augment-customer-support",
  "job_type": "augment",
  "source_dataset_id": 42,
  "target_count": 5000,
  "llm_provider": "openai",
  "llm_model": "gpt-4o"
}

Supported job_type values: generate, augment, paraphrase, filter.

GET/synthetic-data/{id}
POST/synthetic-data/{id}/cancel

Model Exports

Export a fine-tuned model to a deployment format. Supported export types: gguf (llama.cpp), onnx, gptq, awq.

POST/models/{model_id}/exports
{
  "export_type": "gguf",
  "quantization": "q4_k_m"
}
GET/models/{model_id}/exports
GET/models/{model_id}/exports/{export_id}
GET/models/{model_id}/exports/{export_id}/download
POST/models/{model_id}/exports/model-card

Returns the model card (description, training details, usage instructions).

Organizations

Organizations group users into teams and projects. Resources (datasets, models, jobs) shared within a project are isolated from other organizations.

POST/organizations
GET/organizations
GET/organizations/{id}
PATCH/organizations/{id}
DELETE/organizations/{id}

Teams

POST/organizations/{id}/teams
GET/organizations/{id}/teams

Team members

POST/organizations/{id}/teams/{team_id}/members
GET/organizations/{id}/teams/{team_id}/members
PATCH/organizations/{id}/teams/{team_id}/members/{user_id}
DELETE/organizations/{id}/teams/{team_id}/members/{user_id}

Projects

POST/organizations/{id}/teams/{team_id}/projects
GET/organizations/{id}/teams/{team_id}/projects

Subscriptions and Plans

Subscription plans define quotas (training hours, dataset storage, team seats). Credits top up usage beyond plan limits. Both are managed through Stripe.

GET/subscriptions/me

Returns the current user's active subscription and quota usage.

POST/subscriptions/checkout

Initiates a Stripe checkout session to subscribe to a plan.

POST/subscriptions/portal

Opens the Stripe customer portal to manage or cancel an existing subscription.

GET/plans

Lists all available subscription plans with their quotas and pricing.

Training Presets

Pre-configured training configurations maintained by the platform. Use them as a starting point when creating a training job instead of filling in every hyperparameter manually.

GET/training-presets
GET/training-presets/{id}

Arena

GET/arena/matches
GET/arena/matches
POST/arena/matches/{id}/vote
GET/arena/leaderboard

Pagination

All list endpoints return paginated results:

{
  "items": [...],
  "total": 150,
  "page": 1,
  "per_page": 20
}

Default page size: 20, maximum: 100.

Error responses

{ "detail": "Dataset not found", "status_code": 404 }
CodeMeaning
400Bad request (validation error, missing field)
401Not authenticated (missing or expired token)
403Forbidden (insufficient permissions or credits)
404Resource not found (or belongs to another user)
409Conflict (duplicate resource, invalid state transition)
422Validation error (schema mismatch)
429Rate limit exceeded (auth endpoints: 10 req/min)
500Internal server error