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 type | Lifetime | Purpose |
|---|---|---|
| Access token | 30 minutes | API authentication |
| Refresh token | 7 days | Obtain new access tokens without re-login |
| Partial token | 5 minutes | Intermediate state during 2FA verification |
| WebSocket token | 60 seconds | One-time token for dashboard WebSocket handshake |
Auth
Register
/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
/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
/auth/refreshGet current user
/auth/meUpdate profile
/auth/me/localeSessions
/auth/sessions/auth/sessions/{session_id}/auth/sessions/revoke-othersList active sessions, revoke a specific session, or revoke all sessions except the current one.
Two-factor authentication
/2fa/totp/setup/2fa/totp/verify-setup/2fa/backup-codes/regenerateDatasets
List datasets
/datasets?page=1&per_page=20&search=customerCreate dataset
/datasetsGet / Update / Delete dataset
/datasets/{id}/datasets/{id}/datasets/{id}Upload flow
/datasets/upload/initiate/datasets/upload/confirm/datasets/upload/confirmOperations
/datasets/{id}/validate/datasets/{id}/preprocess/sample/datasets/{id}/statistics/datasets/{id}/statistics/datasets/{id}/preprocess/convert/datasets/{id}/preprocess/split/datasets/{id}/preprocess/deduplicate/datasets/{id}/preprocess/normalizeModels
/models?page=1&per_page=20&status=ready/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" }/models/{id}/models/{id}/models/{id}Training Jobs
List available workers
/training-jobs/available-workersReturns workers (both your workers and Parsyn Workers) that are available for job assignment.
List / Create / Get
/training-jobs?page=1&per_page=20&status=running/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"
}
}/training-jobs/{id}Start / Cancel / Delete
/training-jobs/{id}/start/training-jobs/{id}Metrics
/training-jobs/{id}/metrics/training-jobs/{id}/metricsWorkers (your GPUs)
/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.
/workers/{id}/workers/{id}/workers/{id}/workers/connectedMaster Enrollment Keys
/master-keys{
"name": "production-fleet",
"auto_name_prefix": "prod-worker",
"default_worker_type": "both",
"max_enrollments": 50,
"expires_at": "2027-01-01T00:00:00Z"
}/master-keys/master-keys/{id}Chat / Inference
Chat with model
/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
/chat/models/{model_id}/compare{
"message": "What is overfitting?",
"compare_model_id": 8,
"temperature": 0.7
}Credits
Get balance
/credits/balance// Response
{ "balance": 5000 }Purchase credits
/subscriptions/checkoutInitiates a Stripe checkout session for the selected credit pack.
Estimate job cost
/credits/estimate-job{
"gpu_type": "a100_80gb",
"estimated_hours": 2
}
// Response
{ "estimated_credits": 400, "credits_per_hour": 200 }Transaction history
/credits/transactions?page=1&type=deductionCredit packs
/credits/packsEvaluations
/evaluation-suites/evaluation-suites/evaluations/models/{model_id}/evaluation-suites/runs/{run_id}/cancelEvaluation Suites
Structured evaluation using predefined prompt sets. Unlike simple evaluations, suites let you run and compare results across multiple models and training runs.
/evaluation-suites/evaluation-suites/evaluation-suites/{id}/evaluation-suites/{id}/evaluation-suites/{id}/evaluation-suites/{id}/runStart a new evaluation run against the suite's prompt set.
/evaluation-suites/{id}/runs/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.
/pipelines/pipelines/pipelines/{id}/pipelines/{id}/pipelines/{id}/start/pipelines/{id}/cancelSynthetic Data
Generate, augment, paraphrase, or filter datasets using LLMs. A synthetic data job consumes an LLM provider API and produces a new dataset.
/synthetic-data/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.
/synthetic-data/{id}/synthetic-data/{id}/cancelModel Exports
Export a fine-tuned model to a deployment format. Supported export types: gguf (llama.cpp), onnx, gptq, awq.
/models/{model_id}/exports{
"export_type": "gguf",
"quantization": "q4_k_m"
}/models/{model_id}/exports/models/{model_id}/exports/{export_id}/models/{model_id}/exports/{export_id}/download/models/{model_id}/exports/model-cardReturns 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.
/organizations/organizations/organizations/{id}/organizations/{id}/organizations/{id}Teams
/organizations/{id}/teams/organizations/{id}/teamsTeam members
/organizations/{id}/teams/{team_id}/members/organizations/{id}/teams/{team_id}/members/organizations/{id}/teams/{team_id}/members/{user_id}/organizations/{id}/teams/{team_id}/members/{user_id}Projects
/organizations/{id}/teams/{team_id}/projects/organizations/{id}/teams/{team_id}/projectsSubscriptions and Plans
Subscription plans define quotas (training hours, dataset storage, team seats). Credits top up usage beyond plan limits. Both are managed through Stripe.
/subscriptions/meReturns the current user's active subscription and quota usage.
/subscriptions/checkoutInitiates a Stripe checkout session to subscribe to a plan.
/subscriptions/portalOpens the Stripe customer portal to manage or cancel an existing subscription.
/plansLists 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.
/training-presets/training-presets/{id}Arena
/arena/matches/arena/matches/arena/matches/{id}/vote/arena/leaderboardPagination
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 }| Code | Meaning |
|---|---|
| 400 | Bad request (validation error, missing field) |
| 401 | Not authenticated (missing or expired token) |
| 403 | Forbidden (insufficient permissions or credits) |
| 404 | Resource not found (or belongs to another user) |
| 409 | Conflict (duplicate resource, invalid state transition) |
| 422 | Validation error (schema mismatch) |
| 429 | Rate limit exceeded (auth endpoints: 10 req/min) |
| 500 | Internal server error |