{"openapi":"3.1.0","info":{"title":"Triton Cloud API","version":"1.0.0","description":"Control plane for Triton desktop. Inputs upload directly to Modal volumes; Next mints tokens, queues jobs (pg-boss), and streams progress."},"servers":[{"url":"/"}],"tags":[{"name":"Jobs"},{"name":"Uploads"},{"name":"Artifacts"},{"name":"Auth"},{"name":"License"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"desktop-token"}},"schemas":{"InferenceService":{"type":"string","enum":["trellis","chord","sharp","hunyuan","vipe","tapir","vidmap","krea","ltx"]},"JobStatus":{"type":"string","enum":["queued","processing","completed","failed","cancelled"]},"ApiError":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]},"TrellisJobBody":{"type":"object","properties":{"image_volume_path":{"type":"string","minLength":1},"resolution":{"type":"string","enum":["512","1024","1536"]},"decimation_target":{"type":"integer","minimum":10000,"maximum":1000000},"texture_size":{"type":"integer","minimum":1024,"maximum":4096}},"required":["image_volume_path"],"additionalProperties":false},"ChordJobBody":{"type":"object","properties":{"image_volume_path":{"type":"string","minLength":1},"include_relit":{"type":"boolean"}},"required":["image_volume_path"],"additionalProperties":false},"SharpJobBody":{"type":"object","properties":{"image_volume_path":{"type":"string","minLength":1}},"required":["image_volume_path"],"additionalProperties":false},"HunyuanJobBody":{"type":"object","properties":{"image_volume_path":{"type":"string","minLength":1},"seed":{"type":"integer","minimum":0},"octree_resolution":{"type":"integer","minimum":32,"maximum":512},"num_inference_steps":{"type":"integer","minimum":1,"maximum":50},"guidance_scale":{"type":"number","minimum":0,"maximum":20}},"required":["image_volume_path"],"additionalProperties":false},"VipeJobBody":{"type":"object","properties":{"video_volume_path":{"type":"string","minLength":1},"filename":{"type":"string","minLength":1},"pipeline":{"type":"string","enum":["default","dav3","lyra","no_vda","static_vda","wide_angle","panorama"]},"profile":{"type":"string","enum":["default","hard","hard_pose","hard_masked","hard_gnc","hard_mei"]},"max_frames":{"type":["integer","null"],"minimum":1},"frame_start":{"type":"integer","minimum":0},"frame_end":{"type":["integer","null"],"minimum":1},"max_long_edge":{"type":["integer","null"],"minimum":256,"maximum":4096},"include_points":{"type":"boolean"},"max_points":{"type":"integer","minimum":1000,"maximum":2000000},"save_viz":{"type":"boolean"},"chunk_size":{"type":["integer","null"],"minimum":32,"maximum":2000},"chunk_overlap":{"type":"integer","minimum":8,"maximum":500},"auto_chunk":{"type":"boolean"}},"required":["video_volume_path"],"additionalProperties":false},"TapirJobBody":{"type":"object","properties":{"video_volume_path":{"type":"string","minLength":1},"filename":{"type":"string","minLength":1},"grid_size":{"type":"integer","minimum":2,"maximum":100},"reference_frame":{"type":"integer","minimum":0},"frame_offset":{"type":"integer"},"max_frames":{"type":["integer","null"],"minimum":1},"max_long_edge":{"type":["integer","null"],"minimum":256,"maximum":4096},"track_resolution":{"type":"integer","minimum":128,"maximum":1024},"min_visibility":{"type":"number","minimum":0,"maximum":1},"mask_volume_path":{"type":["string","null"],"minLength":1},"export_trackset":{"type":"boolean"},"export_csv":{"type":"boolean"},"export_nuke":{"type":"boolean"},"export_preview":{"type":"boolean"}},"required":["video_volume_path"],"additionalProperties":false},"VidMapJobBody":{"type":"object","properties":{"video_volume_path":{"type":"string","minLength":1},"filename":{"type":"string","minLength":1},"frontend_conf":{"type":"string","minLength":1},"mapping_conf":{"type":"string","minLength":1},"max_frames":{"type":["integer","null"],"minimum":1},"max_long_edge":{"type":["integer","null"],"minimum":256,"maximum":4096},"save_3d_html":{"type":"boolean"},"use_cuda_solver":{"type":"boolean"}},"required":["video_volume_path"],"additionalProperties":false},"KreaJobBody":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"negative_prompt":{"type":"string","maxLength":4000},"checkpoint":{"type":"string","enum":["turbo","raw"]},"seed":{"type":"integer","minimum":0},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"steps":{"type":["integer","null"],"minimum":1,"maximum":80},"cfg":{"type":["number","null"],"minimum":0,"maximum":20},"mu":{"type":["number","null"]}},"required":["prompt"],"additionalProperties":false},"LtxJobBody":{"type":"object","properties":{"task":{"type":"string","enum":["generate","alpha"]},"prompt":{"type":"string","maxLength":4000},"image_volume_path":{"type":["string","null"],"minLength":1},"video_volume_path":{"type":["string","null"],"minLength":1},"seed":{"type":"integer","minimum":0},"width":{"type":"integer","minimum":32,"maximum":1920},"height":{"type":"integer","minimum":32,"maximum":1088},"content_width":{"type":"integer","minimum":1,"maximum":1920},"content_height":{"type":"integer","minimum":1,"maximum":1088},"frame_start":{"type":"integer","minimum":0,"maximum":999999},"num_frames":{"type":"integer","minimum":9,"maximum":257},"frame_rate":{"type":"number","minimum":8,"maximum":50},"enhance_prompt":{"type":"boolean"},"scale_to_full":{"type":"number","minimum":1}},"additionalProperties":false},"EnqueueJobRequest":{"oneOf":[{"type":"object","properties":{"service":{"type":"string","enum":["trellis"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/TrellisJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["chord"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/ChordJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["sharp"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/SharpJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["hunyuan"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/HunyuanJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["vipe"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/VipeJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["tapir"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/TapirJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["vidmap"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/VidMapJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["krea"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/KreaJobBody"}},"required":["service","label","body"],"additionalProperties":false},{"type":"object","properties":{"service":{"type":"string","enum":["ltx"]},"label":{"type":"string","minLength":1,"maxLength":200},"volumePath":{"type":"string"},"clientRunHash":{"type":"string","minLength":1,"maxLength":128},"body":{"$ref":"#/components/schemas/LtxJobBody"}},"required":["service","label","body"],"additionalProperties":false}]},"EnqueueJobResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"toolJobId":{"type":"string"},"modalCallId":{"type":"string","default":""},"dedup":{"type":"boolean"},"dispatch":{"type":"string","enum":["pg-boss","direct"]},"queueJobId":{"type":"string"}},"required":["ok","toolJobId"]},"EnqueueJobError":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"string"},"toolJobId":{"type":"string"}},"required":["ok","error"]},"InsufficientCreditsError":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","enum":["insufficient_credits"]},"error":{"type":"string"},"billingUrl":{"type":"string"},"balanceMicros":{"type":"integer"},"requiredMicros":{"type":"integer"}},"required":["ok","code","error","billingUrl","balanceMicros","requiredMicros"]},"JobStatusSnapshot":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/JobStatus"},"error":{"type":["string","null"]},"service":{"allOf":[{"$ref":"#/components/schemas/InferenceService"},{"type":["string","null"]}]},"artifactId":{"type":["string","null"]},"volumePath":{"type":["string","null"]},"runHash":{"type":["string","null"],"minLength":1,"maxLength":128},"chainVolumePath":{"type":["string","null"]},"chainContentType":{"type":["string","null"]},"chainExpiresAt":{"type":["number","null"]},"updatedAt":{"type":"string"},"progress":{"$ref":"#/components/schemas/JobProgress"}},"required":["id","status","error","service","artifactId","updatedAt"]},"JobProgress":{"type":["object","null"],"properties":{"pct":{"type":["number","null"],"minimum":0,"maximum":100},"stage":{"type":"string"},"message":{"type":"string","default":""},"seq":{"type":"integer","minimum":0},"ts":{"type":"string"}},"required":["pct","stage","ts"]},"JobProgressEvent":{"type":"object","properties":{"type":{"type":"string","enum":["progress"]},"toolJobId":{"type":"string"},"pct":{"type":["number","null"],"minimum":0,"maximum":100},"stage":{"type":"string"},"message":{"type":"string","default":""},"seq":{"type":"integer","minimum":0},"ts":{"type":"string"}},"required":["type","toolJobId","pct","stage","ts"]},"JobStatusEvent":{"type":"object","properties":{"type":{"type":"string","enum":["status"]},"toolJobId":{"type":"string"},"status":{"$ref":"#/components/schemas/JobStatus"},"error":{"type":["string","null"]},"artifactId":{"type":["string","null"]},"service":{"allOf":[{"$ref":"#/components/schemas/InferenceService"},{"type":["string","null"]}]},"ts":{"type":"string"}},"required":["type","toolJobId","status","ts"]},"JobSseEvent":{"oneOf":[{"$ref":"#/components/schemas/JobProgressEvent"},{"$ref":"#/components/schemas/JobStatusEvent"},{"$ref":"#/components/schemas/JobHeartbeatEvent"}],"discriminator":{"propertyName":"type","mapping":{"progress":"#/components/schemas/JobProgressEvent","status":"#/components/schemas/JobStatusEvent","heartbeat":"#/components/schemas/JobHeartbeatEvent"}}},"JobHeartbeatEvent":{"type":"object","properties":{"type":{"type":"string","enum":["heartbeat"]},"ts":{"type":"string"}},"required":["type","ts"]},"WorkerProgressPayload":{"type":"object","properties":{"type":{"type":"string","enum":["progress"],"default":"progress"},"pct":{"type":["number","null"],"minimum":0,"maximum":100},"stage":{"type":"string","minLength":1,"maxLength":120},"message":{"type":"string","maxLength":2000,"default":""},"seq":{"type":"integer","minimum":0}},"required":["stage"]},"WorkerCompletionPayload":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["completed"]},"artifact_id":{"type":"string","minLength":1},"s3_key":{"type":"string","minLength":1},"s3_sidecar_key":{"type":["string","null"]},"volume_path":{"type":["string","null"]},"content_type":{"type":"string","minLength":1},"byte_size":{"type":"integer","minimum":0},"kind":{"type":"string","minLength":1},"service":{"type":"string"},"preview_key":{"type":["string","null"]},"preview_content_type":{"type":["string","null"]},"preview_format":{"type":["string","null"]},"content_hash":{"type":"string","minLength":1,"maxLength":128},"gpu_seconds":{"type":"number","minimum":0},"wall_seconds":{"type":"number","minimum":0},"gpu_class":{"type":"string","maxLength":64},"extra":{"type":"object","additionalProperties":{}}},"required":["status","artifact_id","s3_key","content_type","byte_size","kind"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"error":{"type":"string","minLength":1},"error_type":{"type":["string","null"]},"gpu_seconds":{"type":"number","minimum":0},"wall_seconds":{"type":"number","minimum":0}},"required":["status","error"]}]},"MintUploadRequest":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":240},"contentType":{"type":"string","maxLength":120},"maxBytes":{"type":"integer","exclusiveMinimum":0},"ttlSeconds":{"type":"integer","minimum":60,"maximum":3600}},"required":["filename"]},"MintUploadResponse":{"type":"object","properties":{"uploadId":{"type":"string"},"uploadUrl":{"type":"string"},"uploadToken":{"type":"string"},"volumePath":{"type":"string"},"maxBytes":{"type":"number"},"contentType":{"type":"string"},"expiresAt":{"type":"number"},"expiresInSeconds":{"type":"number"}},"required":["uploadId","uploadUrl","uploadToken","volumePath","maxBytes","contentType","expiresAt","expiresInSeconds"]},"ActivityJobItem":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/JobStatus"},"kind":{"type":"string"},"service":{"type":["string","null"]},"registryKind":{"type":"string","enum":["inference_run","other"]},"typeLabel":{"type":"string"},"summary":{"type":"string"},"createdAtIso":{"type":"string"},"updatedAtIso":{"type":"string"},"error":{"type":["string","null"]},"artifactId":{"type":["string","null"]},"progressPct":{"type":["number","null"]},"progressStage":{"type":["string","null"]},"progressMessage":{"type":["string","null"]},"runHash":{"type":["string","null"],"minLength":1,"maxLength":128}},"required":["id","status","kind","service","registryKind","typeLabel","summary","createdAtIso","updatedAtIso","error","artifactId","progressPct","progressStage","progressMessage"]},"ActivityArtifactItem":{"type":"object","properties":{"id":{"type":"string"},"sourceTool":{"type":["string","null"]},"contentType":{"type":"string"},"byteSize":{"type":"string"},"createdAtIso":{"type":"string"},"modalArtifactId":{"type":["string","null"]},"linkedJobId":{"type":["string","null"]},"runHash":{"type":["string","null"],"minLength":1,"maxLength":128},"contentHash":{"type":["string","null"],"minLength":1,"maxLength":128}},"required":["id","sourceTool","contentType","byteSize","createdAtIso","modalArtifactId","linkedJobId"]},"ActivityStats":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"queued":{"type":"integer","minimum":0},"processing":{"type":"integer","minimum":0},"completed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"cancelled":{"type":"integer","minimum":0}},"required":["total","queued","processing","completed","failed","cancelled"]},"WorkspaceActivity":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/ActivityJobItem"}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ActivityArtifactItem"}}},"required":["jobs","artifacts"]},"GlobalActivity":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/ActivityJobItem"}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ActivityArtifactItem"}},"stats":{"$ref":"#/components/schemas/ActivityStats"}},"required":["jobs","artifacts","stats"]},"JobListView":{"type":"string","enum":["all","active","done","failed","archived"]},"JobListItem":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/JobStatus"},"service":{"type":"string"},"label":{"type":"string"},"createdAt":{"type":"string"},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"archivedAt":{"type":["string","null"]},"progress":{"$ref":"#/components/schemas/JobProgress"},"error":{"type":["string","null"]},"artifactId":{"type":["string","null"]},"runHash":{"type":["string","null"],"minLength":1,"maxLength":128},"costMicros":{"type":["integer","null"]}},"required":["id","status","service","label","createdAt","startedAt","completedAt","updatedAt","archivedAt","progress","error","artifactId","runHash","costMicros"]},"JobViewCounts":{"type":"object","properties":{"all":{"type":"integer","minimum":0},"active":{"type":"integer","minimum":0},"done":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0}},"required":["all","active","done","failed","archived"]},"JobListResponse":{"type":"object","properties":{"view":{"$ref":"#/components/schemas/JobListView"},"jobs":{"type":"array","items":{"$ref":"#/components/schemas/JobListItem"}},"counts":{"$ref":"#/components/schemas/JobViewCounts"}},"required":["view","jobs","counts"]},"JobActionResponse":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/JobListItem"}},"required":["job"]},"LicenseEntitlementResponse":{"type":"object","properties":{"token":{"type":"string"},"activationId":{"type":"string"},"tier":{"$ref":"#/components/schemas/LicenseTier"},"displayKey":{"type":"string"},"keyExpiresAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"refreshAfter":{"type":"string"},"deviceLimit":{"type":["integer","null"]},"devices":{"type":"array","items":{"$ref":"#/components/schemas/LicenseDevice"}}},"required":["token","activationId","tier","displayKey","keyExpiresAt","expiresAt","refreshAfter","deviceLimit","devices"]},"LicenseTier":{"type":"string","enum":["founder","indie","studio"]},"LicenseDevice":{"type":"object","properties":{"activationId":{"type":"string"},"label":{"type":"string"},"platform":{"type":["string","null"]},"lastValidatedAt":{"type":"string"}},"required":["activationId","label","platform","lastValidatedAt"]},"LicenseErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/LicenseErrorCode"},"message":{"type":"string"},"devices":{"type":"array","items":{"$ref":"#/components/schemas/LicenseDevice"}},"deviceLimit":{"type":["integer","null"]}},"required":["error","message"]},"LicenseErrorCode":{"type":"string","enum":["invalid_request","invalid_key","key_inactive","device_limit","activation_not_found","fingerprint_mismatch","not_configured","upstream"]},"LicenseActivateRequest":{"type":"object","properties":{"key":{"type":"string","minLength":8,"maxLength":128},"fingerprint":{"type":"string","pattern":"^[0-9a-f]{64}$"},"label":{"type":"string","minLength":1,"maxLength":80},"platform":{"type":"string","maxLength":40},"appVersion":{"type":"string","maxLength":40}},"required":["key","fingerprint","label"]},"LicenseValidateRequest":{"type":"object","properties":{"key":{"type":"string","minLength":8,"maxLength":128},"activationId":{"type":"string","minLength":1,"maxLength":80},"fingerprint":{"type":"string","pattern":"^[0-9a-f]{64}$"},"appVersion":{"type":"string","maxLength":40}},"required":["key","activationId","fingerprint"]},"LicenseDeactivateRequest":{"type":"object","properties":{"key":{"type":"string","minLength":8,"maxLength":128},"activationId":{"type":"string","minLength":1,"maxLength":80}},"required":["key","activationId"]}},"parameters":{}},"paths":{"/api/v1/jobs":{"post":{"summary":"Enqueue inference job","tags":["Jobs"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueJobRequest"}}}},"responses":{"200":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueJobResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueJobError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Prepaid credits do not cover this run (buy credits at billingUrl)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCreditsError"}}}},"502":{"description":"Job row created but spawn failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueJobError"}}}}}},"get":{"summary":"List the signed-in user's jobs (archived jobs only in view=archived)","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/JobListView"},"required":false,"name":"view","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Jobs in the view (newest first) + per-view counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"400":{"description":"Bad query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/jobs/{id}":{"get":{"summary":"Job status","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusSnapshot"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/jobs/{id}/events":{"get":{"summary":"SSE job events (status + progress)","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"text/event-stream","content":{"text/event-stream":{"schema":{"type":"string"}}}}}}},"/api/v1/jobs/{id}/cancel":{"post":{"summary":"Cancel a queued or processing job (stops its Modal call; never charged)","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The job after the action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobActionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found (or not the caller's job)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Job already finished (code not_cancellable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/jobs/{id}/archive":{"post":{"summary":"Archive a finished job (hidden from lists and /api/v1/activity)","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The job after the action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobActionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found (or not the caller's job)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Job still queued or processing (code not_archivable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"summary":"Unarchive a job","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The job after the action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobActionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found (or not the caller's job)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/uploads":{"post":{"summary":"Mint Modal volume upload token (bytes go to Modal, not Next)","tags":["Uploads"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintUploadRequest"}}}},"responses":{"200":{"description":"Upload handle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintUploadResponse"}}}}}}},"/api/v1/auth/desktop-handoff":{"post":{"summary":"Register a pending desktop browser handoff","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","maxLength":80}}}}}},"responses":{"200":{"description":"Pending handoff; deviceCode never appears in the browser URL","content":{"application/json":{"schema":{"type":"object","properties":{"userCode":{"type":"string"},"deviceCode":{"type":"string"},"authorizeUrl":{"type":"string"},"expiresIn":{"type":"integer"}},"required":["userCode","deviceCode","authorizeUrl","expiresIn"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/auth/desktop-handoff/redeem":{"post":{"summary":"Redeem an approved desktop handoff (mints the Bearer once)","tags":["Auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"type":"string","minLength":16}},"required":["deviceCode"]}}}},"responses":{"200":{"description":"Token minted and handoff consumed","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"204":{"description":"Registered but not yet approved"},"400":{"description":"Invalid device code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Unknown, expired, or already redeemed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/auth/desktop-token":{"post":{"summary":"Mint desktop Bearer token (session / dev auth)","tags":["Auth"],"responses":{"200":{"description":"Token issued once","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"label":{"type":"string"}},"required":["token","label"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/artifacts/{id}":{"get":{"summary":"Artifact metadata + preview URLs","tags":["Artifacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Artifact + preview"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"summary":"Delete artifact (row + R2 objects)","tags":["Artifacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/artifacts/{id}/zip":{"get":{"summary":"Download artifact as ZIP","tags":["Artifacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"application/zip"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/activity":{"get":{"summary":"Jobs + artifacts for the signed-in user (optional workspace filter)","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/InferenceService"},"required":false,"name":"workspace","in":"query"}],"responses":{"200":{"description":"Activity payload, archived jobs excluded (stats omitted when ?workspace= is set)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalActivity"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/license/activate":{"post":{"summary":"Activate this machine for a licence key (no auth; the key is the credential)","tags":["License"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseActivateRequest"}}}},"responses":{"200":{"description":"Signed entitlement token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseEntitlementResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}},"403":{"description":"Key revoked, disabled or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}},"404":{"description":"Unknown key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}},"409":{"description":"Device limit reached (lists devices)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}}}}},"/api/v1/license/validate":{"post":{"summary":"Re-validate an activation and refresh its entitlement token","tags":["License"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseValidateRequest"}}}},"responses":{"200":{"description":"Fresh signed entitlement token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseEntitlementResponse"}}}},"403":{"description":"Key inactive or fingerprint mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}},"404":{"description":"Unknown key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}},"410":{"description":"Activation was removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}}}}},"/api/v1/license/deactivate":{"post":{"summary":"Free a device slot (this machine or another activation of the key)","tags":["License"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseDeactivateRequest"}}}},"responses":{"204":{"description":"Deactivated"},"404":{"description":"Unknown key or activation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseErrorResponse"}}}}}}}},"webhooks":{}}