{
  "openapi": "3.1.0",
  "info": {
    "title": "SSBio Research API — CatRange",
    "description": "CatRange kinetic range predictions.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.sahassbio.com"
    }
  ],
  "paths": {
    "/catrange/v1/ready": {
      "get": {
        "tags": [
          "CatRange service"
        ],
        "summary": "Ready",
        "description": "Public prediction readiness; cached for at most five seconds.",
        "operationId": "ready_catrange_v1_ready_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/catrange/v1/metrics": {
      "get": {
        "tags": [
          "CatRange service"
        ],
        "summary": "Prediction Metrics",
        "description": "Public aggregate successful-row counts, including cached deliveries.\n\nCounts begin with retained results at collector activation; deleted\nhistorical results cannot be reconstructed. No job identifiers or\nuser inputs are returned. This optional adapter does not submit jobs.",
        "operationId": "prediction_metrics_catrange_v1_metrics_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs": {
      "post": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Submit Job",
        "operationId": "submit_job_catrange_v1_jobs_post",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique 8–128 character key for this intended job. Reuse this key and the same inputs when retrying.",
              "title": "Idempotency-Key"
            },
            "description": "Unique 8–128 character key for this intended job. Reuse this key and the same inputs when retrying."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_submit_job_catrange_v1_jobs_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "409": {
            "description": "Idempotency conflict or unresolved previous submission"
          },
          "413": {
            "description": "Upload/request exceeds limit"
          },
          "429": {
            "description": "Per-principal quota or request limit"
          },
          "503": {
            "description": "Backend unavailable or submission outcome uncertain"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs/{job_id}": {
      "get": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Job Status",
        "description": "Poll an owned job using its full UUID. Suggested interval: 10 seconds.",
        "operationId": "job_status_catrange_v1_jobs__job_id__get",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs/{job_id}/results": {
      "get": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Job Results",
        "description": "Inline table for at most 10 rows / 1 MiB of source CSV; use download for larger results.",
        "operationId": "job_results_catrange_v1_jobs__job_id__results_get",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs/{job_id}/download": {
      "get": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Download",
        "description": "Download an owned job's CSV without buffering the entire result.",
        "operationId": "download_catrange_v1_jobs__job_id__download_get",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results CSV (streamed)",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs/{job_id}/rerun": {
      "post": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Rerun",
        "description": "Create a fresh prediction from an owned completed/failed job's retained inputs.",
        "operationId": "rerun_catrange_v1_jobs__job_id__rerun_post",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/catrange/v1/jobs/{job_id}/notification-email": {
      "post": {
        "tags": [
          "CatRange predictions"
        ],
        "summary": "Notification Email",
        "description": "Add a notification address to an owned job; changing an existing address may be refused.",
        "operationId": "notification_email_catrange_v1_jobs__job_id__notification_email_post",
        "security": [
          {
            "ResearchAPIKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationEmailRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Body_submit_job_catrange_v1_jobs_post": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "interactive",
              "csv",
              "demo",
              "demo_validation"
            ],
            "title": "Mode"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "pairs_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pairs Json",
            "description": "JSON list of up to 10 objects with sequence and smiles; optional sequence_id and substrate_id."
          },
          "csv_file": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Csv File",
            "description": "UTF-8 CSV, at most 15 MiB / 5,000 rows. Required columns: sequence and smiles (or Isomeric SMILES)."
          },
          "preferred_targets": {
            "type": "string",
            "maxLength": 32,
            "title": "Preferred Targets",
            "default": "kcat,km"
          },
          "compute": {
            "type": "string",
            "enum": [
              "cpu",
              "auto",
              "gpu"
            ],
            "title": "Compute",
            "default": "cpu"
          },
          "force_rerun": {
            "type": "boolean",
            "title": "Force Rerun",
            "description": "Bypass prediction cache. Still use the same Idempotency-Key when retrying this request.",
            "default": false
          },
          "screening_mode": {
            "type": "string",
            "enum": [
              "clean",
              "clean_all",
              "skip_clean"
            ],
            "title": "Screening Mode",
            "description": "clean: recommended CLEAN gate; clean_all: run CLEAN and also predict flagged valid rows; skip_clean: omit CLEAN. Nondefault modes produce exploratory estimates, not evidence of catalysis.",
            "default": "clean"
          }
        },
        "type": "object",
        "required": [
          "mode"
        ],
        "title": "Body_submit_job_catrange_v1_jobs_post"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "JobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id",
            "description": "Full UUID; accessible only with a key for its submitting principal."
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Url"
          },
          "results_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Results Url"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "job_id",
          "status"
        ],
        "title": "JobResponse"
      },
      "NotificationEmailRequest": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 320,
            "minLength": 3,
            "title": "Email"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email"
        ],
        "title": "NotificationEmailRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "ResearchAPIKey": {
        "type": "http",
        "description": "Private API key issued by SSBio. Send Authorization: Bearer YOUR_KEY.",
        "scheme": "bearer"
      }
    }
  }
}
