mando2222 commited on
Commit
939683f
·
verified ·
1 Parent(s): 5d70464

Spec: save/delete endpoints

Browse files
Files changed (1) hide show
  1. API_SPEC.md +15 -1
API_SPEC.md CHANGED
@@ -56,7 +56,21 @@ Jobs are serialized through one worker (one model / one device); submitting many
56
  `status` ∈ `queued` | `running` | `done` | `error`. On `error`, an `error` field carries the message.
57
 
58
  ### `GET /images/{job_id}.png` → fetch the result
59
- Returns `image/png` once the job is `done` (404 until then).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  ### `POST /generate/sync` → blocking, returns PNG directly
62
  Same body as `/generate`; responds with `image/png`. Convenient but holds the connection for the
 
56
  `status` ∈ `queued` | `running` | `done` | `error`. On `error`, an `error` field carries the message.
57
 
58
  ### `GET /images/{job_id}.png` → fetch the result
59
+ Returns `image/png` once the job is `done` (404 until then). Finished images are
60
+ saved to disk (`$MOSS_OUTPUT_DIR`, default `./moss_outputs`) and freed from memory, so
61
+ this is served from the saved file after the job completes.
62
+
63
+ ### `GET /jobs` → list jobs
64
+ ```json
65
+ { "jobs": [ { "job_id": "ff70ee2b28e4", "status": "done",
66
+ "file_path": "/.../moss_outputs/ff70ee2b28e4.png", "prompt": "a red fox in snow" } ] }
67
+ ```
68
+
69
+ ### `DELETE /jobs/{job_id}` → delete a job + its saved image
70
+ Drops the job from memory and removes its PNG from disk.
71
+ ```json
72
+ { "deleted": true, "job_id": "ff70ee2b28e4", "file_removed": true }
73
+ ```
74
 
75
  ### `POST /generate/sync` → blocking, returns PNG directly
76
  Same body as `/generate`; responds with `image/png`. Convenient but holds the connection for the