{"openapi":"3.1.0","info":{"title":"SilentFlow API","version":"1.0.0","description":"Versioned image-management API for people, automation and AI agents. Use the exact public URL returned by the service; delivery domains are not part of the API contract."},"servers":[{"url":"https://slnt.dev","description":"Production"}],"externalDocs":{"description":"Human-readable integration guide","url":"https://slnt.dev/developers"},"security":[{"bearerAuth":[]}],"tags":[{"name":"Files","description":"Upload, list and permanently delete owned images."},{"name":"Account","description":"Inspect the authenticated account and usage."},{"name":"Agent keys","description":"Create least-privilege credentials using a legacy account key."}],"paths":{"/v1/files":{"get":{"operationId":"listFiles","tags":["Files"],"summary":"List owned files","description":"Requires files:read. Results are ordered newest first and use an integer cursor.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"integer","minimum":1}},{"name":"date_from","in":"query","description":"ISO 8601 date or timestamp.","schema":{"oneOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]}}],"responses":{"200":{"description":"File page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilePage"}}}},"400":{"description":"Invalid pagination or date filter","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or revoked credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Missing files:read scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"uploadFile","tags":["Files"],"summary":"Upload one local image","description":"Requires files:write. URL imports are intentionally unsupported.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Uploaded file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResult"}}}},"400":{"description":"Invalid multipart body or unsupported file content","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or revoked credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Missing scope, product or storage quota","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"File is empty or exceeds the account limit","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"The v1 surface does not support this product type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Upload failed; durable object cleanup and quota compensation completed or were queued","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/files/{key}":{"delete":{"operationId":"deleteFile","tags":["Files"],"summary":"Permanently delete an owned file","description":"Requires files:delete. Confirm the exact public key with the user before calling this destructive operation.","parameters":[{"name":"key","in":"path","required":true,"description":"The full public key, including any slash-separated date path.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Metadata, quota and object cleanup completed","content":{"application/json":{"schema":{"type":"object","required":["success","cleanup_pending"],"properties":{"success":{"const":true},"cleanup_pending":{"const":false}}}}}},"202":{"description":"Metadata and quota were deleted; durable object cleanup is queued","content":{"application/json":{"schema":{"type":"object","required":["success","cleanup_pending"],"properties":{"success":{"const":true},"cleanup_pending":{"const":true}}}}}},"401":{"description":"Missing, invalid or revoked credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Missing files:delete scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"File not found or not owned by the account","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Concurrent deletion conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","tags":["Account"],"summary":"Get storage and traffic usage","description":"Requires files:read.","responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing, invalid or revoked credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Missing files:read scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Get the current account","description":"Requires files:read and never returns a credential.","responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Missing, invalid or revoked credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Missing files:read scope","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/agent-keys":{"get":{"operationId":"listAgentKeys","tags":["Agent keys"],"summary":"List agent keys","description":"Requires a legacy account key. Secret token values are never returned.","responses":{"200":{"description":"Agent keys","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentKey"}}}}}}},"401":{"description":"Missing or invalid credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Agent keys cannot manage credentials","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"createAgentKey","tags":["Agent keys"],"summary":"Create an agent key","description":"Requires a legacy account key. The token is returned once in this response.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scopes"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/AgentScope"}}}}}}},"responses":{"201":{"description":"Created; store the one-time token securely","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKeyCreated"}}}},"400":{"description":"Invalid name, scopes or JSON","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Agent keys cannot manage credentials","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/agent-keys/{id}":{"delete":{"operationId":"revokeAgentKey","tags":["Agent keys"],"summary":"Revoke an agent key","description":"Requires a legacy account key.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"204":{"description":"Revoked"},"400":{"description":"Invalid ID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid credential","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Agent keys cannot manage credentials","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Key not found or already revoked","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A legacy sk_ account key or a scoped sf_agent_ key. Agent keys are accepted only on /v1 endpoints."}},"schemas":{"AgentScope":{"type":"string","enum":["files:read","files:write","files:delete"]},"Problem":{"type":"object","required":["type","title","status","code","detail"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"code":{"type":"string"},"detail":{"type":"string"}}},"File":{"type":"object","required":["id","key","url","size","created_at"],"properties":{"id":{"type":"integer"},"key":{"type":"string"},"url":{"type":"string","format":"uri"},"mime_type":{"type":["string","null"]},"size":{"type":["integer","null"],"minimum":0},"created_at":{"type":"string"}}},"FilePage":{"type":"object","required":["files","next_cursor"],"properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"next_cursor":{"type":["integer","null"]}}},"UploadResult":{"type":"object","required":["url","key","product","usage"],"properties":{"url":{"type":"string","format":"uri"},"key":{"type":"string"},"product":{"type":"string","enum":["images"]},"usage":{"$ref":"#/components/schemas/Quota"}}},"Quota":{"type":"object","required":["used","limit","percent"],"properties":{"used":{"type":"number","minimum":0},"limit":{"type":["number","null"]},"percent":{"type":["string","number"]}}},"Usage":{"type":"object","required":["storage","traffic"],"properties":{"storage":{"$ref":"#/components/schemas/Quota"},"traffic":{"type":"object","required":["used","limit","reset_date"],"properties":{"used":{"type":"number","minimum":0},"limit":{"oneOf":[{"type":"number"},{"type":"string","const":"Unlimited"}]},"reset_date":{"type":"string"}}}}},"Account":{"type":"object","required":["id","email","plan_tier","created_at","status"],"properties":{"id":{"type":"integer"},"email":{"type":"string","format":"email"},"plan_tier":{"type":"string"},"expire_at":{"type":["string","null"]},"created_at":{"type":"string"},"status":{"type":"string"}}},"AgentKey":{"type":"object","required":["id","prefix","name","scopes","created_at"],"properties":{"id":{"type":"integer"},"prefix":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/AgentScope"}},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}}},"AgentKeyCreated":{"allOf":[{"$ref":"#/components/schemas/AgentKey"},{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"Returned once."}}}]}}}}