{
  "components": {
    "schemas": {
      "BatchJobCreateRequest": {
        "properties": {
          "input_path": {
            "description": "Object Storage path of the input JSONL",
            "example": "https://object-store-private.example.com/1a2b3c4d:my-bucket/batch/input/reviews.jsonl",
            "title": "Input Path",
            "type": "string"
          },
          "name": {
            "description": "name",
            "example": "review09",
            "maxLength": 25,
            "minLength": 3,
            "pattern": "^[a-z][a-z0-9]*$",
            "title": "Name",
            "type": "string"
          },
          "tags": {
            "description": "Tags",
            "example": [
              {
                "key": "key1",
                "value": "value1"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "title": "Tags",
            "type": "array"
          }
        },
        "required": [
          "input_path",
          "name"
        ],
        "title": "BatchJobCreateRequest",
        "type": "object"
      },
      "BatchJobCreateResponse": {
        "properties": {
          "account_id": {
            "description": "AccountID",
            "example": "3265ab469f0d406d83073da3e11e7a6c",
            "title": "Account Id",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Request ID",
            "title": "Request Id"
          },
          "resource_id": {
            "description": "Resource ID",
            "example": "417861789465",
            "title": "Resource Id",
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "resource_id"
        ],
        "title": "BatchJobCreateResponse",
        "type": "object"
      },
      "BatchJobDetailItem": {
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "AccountID",
            "example": "3265ab469f0d406d83073da3e11e7a6c",
            "title": "Account Id"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run end time",
            "example": "2026-09-15T11:20:00Z",
            "title": "Completed At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Created at",
            "example": "2026-05-20T10:00:00",
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Created by",
            "example": "user01",
            "title": "Created By"
          },
          "error_file_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error JSONL path — null if all requests succeeded",
            "example": "s3://my-bucket/batch/output/error.jsonl",
            "title": "Error File Path"
          },
          "errors": {
            "default": [],
            "description": "Error list — up to 20. Run-time errors are returned here, not as HTTP errors",
            "items": {
              "$ref": "#/components/schemas/BatchJobError"
            },
            "title": "Errors",
            "type": "array"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Expiration time (submitted + 24 hours)",
            "example": "2026-09-16T09:00:00Z",
            "title": "Expires At"
          },
          "id": {
            "description": "Batch Job ID (resource_id issued by scp-ai-inference)",
            "example": "5f6c1d2e-8a3b-4c7d-9e0f-1a2b3c4d5e6f",
            "title": "Id",
            "type": "string"
          },
          "input_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Object Storage path of the input JSONL",
            "example": "https://object-store-private.example.com/1a2b3c4d:my-bucket/batch/input/reviews.jsonl",
            "title": "Input Path"
          },
          "input_record_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of records (requests)",
            "example": 9876,
            "title": "Input Record Count"
          },
          "input_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input object size (bytes)",
            "example": 83886080,
            "title": "Input Size Bytes"
          },
          "name": {
            "description": "name",
            "example": "review09",
            "title": "Name",
            "type": "string"
          },
          "output_file_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Result JSONL path — null before it is created or if all requests failed",
            "example": "s3://my-bucket/batch/output/result.jsonl",
            "title": "Output File Path"
          },
          "output_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Folder where result and error files are written",
            "example": "https://object-store-private.example.com/1a2b3c4d:my-bucket/batch/input/5f6c1d2e-8a3b-4c7d-9e0f-1a2b3c4d5e6f/output",
            "title": "Output Path"
          },
          "request_counts": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BatchJobRequestCounts"
              }
            ],
            "description": "Request counts — progress is (completed + failed) / total"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run start time",
            "example": "2026-09-15T09:01:00Z",
            "title": "Started At"
          },
          "status": {
            "description": "Batch Inference status",
            "example": "RUNNING",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ],
        "title": "BatchJobDetailItem",
        "type": "object"
      },
      "BatchJobError": {
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error code",
            "title": "Code"
          },
          "line": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Line number in the input file where the error occurred",
            "title": "Line"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message",
            "title": "Message"
          },
          "param": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parameter that caused the error",
            "title": "Param"
          }
        },
        "title": "BatchJobError",
        "type": "object"
      },
      "BatchJobListItem": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run end time",
            "example": "2026-09-15T11:20:00Z",
            "title": "Completed At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Created at",
            "example": "2026-05-20T10:00:00",
            "title": "Created At"
          },
          "id": {
            "description": "Batch Job ID (resource_id issued by scp-ai-inference)",
            "example": "5f6c1d2e-8a3b-4c7d-9e0f-1a2b3c4d5e6f",
            "title": "Id",
            "type": "string"
          },
          "input_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Object Storage path of the input JSONL",
            "example": "https://object-store-private.example.com/1a2b3c4d:my-bucket/batch/input/reviews.jsonl",
            "title": "Input Path"
          },
          "input_record_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of records (requests)",
            "example": 9876,
            "title": "Input Record Count"
          },
          "input_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input object size (bytes)",
            "example": 83886080,
            "title": "Input Size Bytes"
          },
          "name": {
            "description": "name",
            "example": "review09",
            "title": "Name",
            "type": "string"
          },
          "request_counts": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BatchJobRequestCounts"
              }
            ],
            "description": "Request counts — progress is (completed + failed) / total"
          },
          "status": {
            "description": "Batch Inference status",
            "example": "RUNNING",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ],
        "title": "BatchJobListItem",
        "type": "object"
      },
      "BatchJobListResponse": {
        "properties": {
          "batch_jobs": {
            "description": "Batch Job list",
            "items": {
              "$ref": "#/components/schemas/BatchJobListItem"
            },
            "title": "Batch Jobs",
            "type": "array"
          },
          "count": {
            "default": 0,
            "description": "Total count",
            "example": 20,
            "title": "Count",
            "type": "integer"
          }
        },
        "required": [
          "batch_jobs"
        ],
        "title": "BatchJobListResponse",
        "type": "object"
      },
      "BatchJobRequestCounts": {
        "properties": {
          "completed": {
            "default": 0,
            "description": "Succeeded requests",
            "example": 4310,
            "title": "Completed",
            "type": "integer"
          },
          "failed": {
            "default": 0,
            "description": "Failed requests",
            "example": 12,
            "title": "Failed",
            "type": "integer"
          },
          "total": {
            "default": 0,
            "description": "Total requests",
            "example": 12000,
            "title": "Total",
            "type": "integer"
          }
        },
        "title": "BatchJobRequestCounts",
        "type": "object"
      },
      "BatchJobShowResponse": {
        "properties": {
          "batch_job": {
            "$ref": "#/components/schemas/BatchJobDetailItem"
          }
        },
        "required": [
          "batch_job"
        ],
        "title": "BatchJobShowResponse",
        "type": "object"
      },
      "Tag": {
        "properties": {
          "key": {
            "description": "Key",
            "title": "Key",
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value",
            "title": "Value"
          }
        },
        "required": [
          "key"
        ],
        "title": "Tag",
        "type": "object"
      },
      "ValidationErrorModel": {
        "properties": {
          "ctx": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "an optional object which contains values required to render the error message.",
            "title": "Error context"
          },
          "loc": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "the error's location as a list. ",
            "title": "Location"
          },
          "msg": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "a computer-readable identifier of the error type.",
            "title": "Message"
          },
          "type_": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "a human readable explanation of the error.",
            "title": "Error Type"
          }
        },
        "title": "ValidationErrorModel",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "scp-ai-inference project",
    "title": "scp-ai-inference project",
    "version": "1.9.0.0rc1.dev60"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/batch-jobs": {
      "get": {
        "deprecated": false,
        "description": "Get Batch Jobs list.",
        "operationId": "listBatchJobs",
        "parameters": [
          {
            "description": "size",
            "example": 20,
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 9.223372036854776e+18,
                  "minimum": 0.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": 20,
              "description": "size",
              "example": 20,
              "title": "Size"
            }
          },
          {
            "description": "page",
            "example": 0,
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 9.223372036854776e+18,
                  "minimum": 0.0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": 0,
              "description": "page",
              "example": 0,
              "title": "Page"
            }
          },
          {
            "description": "sort",
            "example": "created_at:desc",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "sort",
              "example": "created_at:desc",
              "title": "Sort"
            }
          },
          {
            "description": "Batch Inference status",
            "example": "RUNNING",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Batch Inference status",
              "example": "RUNNING",
              "title": "Status"
            }
          },
          {
            "description": "Batch Inference name",
            "example": "review09",
            "in": "query",
            "name": "name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 25,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Batch Inference name",
              "example": "review09",
              "title": "Name"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchJobListResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "summary": "ListBatchJobs",
        "tags": [
          "ai-inference.v1.BatchJobsAPIs"
        ]
      },
      "post": {
        "deprecated": false,
        "description": "Create Batch Job.",
        "operationId": "createBatchJob",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchJobCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchJobCreateResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "409": {
            "description": "Conflict"
          }
        },
        "summary": "CreateBatchJob",
        "tags": [
          "ai-inference.v1.BatchJobsAPIs"
        ]
      }
    },
    "/v1/batch-jobs/{batch_job_id}": {
      "get": {
        "deprecated": false,
        "description": "Show Batch Job.",
        "operationId": "showBatchJob",
        "parameters": [
          {
            "description": "Batch Job ID (resource_id issued by scp-ai-inference)",
            "example": "5f6c1d2e-8a3b-4c7d-9e0f-1a2b3c4d5e6f",
            "in": "path",
            "name": "batch_job_id",
            "required": true,
            "schema": {
              "description": "Batch Job ID (resource_id issued by scp-ai-inference)",
              "example": "5f6c1d2e-8a3b-4c7d-9e0f-1a2b3c4d5e6f",
              "title": "Batch Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchJobShowResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ValidationErrorModel"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "summary": "ShowBatchJob",
        "tags": [
          "ai-inference.v1.BatchJobsAPIs"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "BatchJobs API",
      "name": "ai-inference.v1.BatchJobsAPIs"
    }
  ]
}