{
  "openapi": "3.0.4",
  "info": {
    "title": "Demographic Estimation API",
    "description": "Demographic Estimation API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/v1/demographic-estimation/get-age": {
      "post": {
        "tags": [
          "DemographicEstimation"
        ],
        "summary": "Returns the estimated age of the faces on the image.",
        "requestBody": {
          "description": "Age estimation request model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgeEstimationRequestModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AgeEstimationRequestModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AgeEstimationRequestModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the age estimation results",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AgeEstimationResultModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgeEstimationResultModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgeEstimationResultModel"
                }
              }
            }
          },
          "400": {
            "description": "Returned when maxFaceCount is outside the allowed range (1-10)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/demographic-estimation/get-gender": {
      "post": {
        "tags": [
          "DemographicEstimation"
        ],
        "summary": "Returns the detected gender of the faces on the image.",
        "requestBody": {
          "description": "Gender detection request model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenderDetectionRequestModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenderDetectionRequestModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenderDetectionRequestModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the gender detection results",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GenderDetectionResultModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenderDetectionResultModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenderDetectionResultModel"
                }
              }
            }
          },
          "400": {
            "description": "Returned when maxFaceCount is outside the allowed range (1-10)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/healthz": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Returns the server UTC time.",
        "responses": {
          "200": {
            "description": "Returns the server UTC time.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgeEstimationModel": {
        "type": "object",
        "properties": {
          "prediction": {
            "type": "number",
            "description": "Estimated age",
            "format": "float",
            "nullable": true
          },
          "uncertainty": {
            "type": "number",
            "description": "Uncertainty score of the estimation with value range [0.0, infinity], we recommend rejecting everything higher than 1.0. Values higher than this can be indicative of a problem with the image quality.",
            "format": "float",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Model for face age estimation"
      },
      "AgeEstimationRequestModel": {
        "type": "object",
        "properties": {
          "image": {
            "$ref": "#/components/schemas/ImageModel"
          },
          "maxFaceCount": {
            "type": "integer",
            "description": "Maximum number of faces to be processed. Must be between 1 and 10. Default: 1.",
            "format": "int32",
            "default": 1
          }
        },
        "additionalProperties": false,
        "description": "Request model for age estimation"
      },
      "AgeEstimationResultModel": {
        "type": "object",
        "properties": {
          "faces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FaceAgeEstimationModel"
            },
            "description": "The faces that were processed and their age estimation results",
            "nullable": true
          },
          "unprocessedFaceCount": {
            "type": "integer",
            "description": "The number of faces that were not processed due to the maximum face count limit",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Model for the result of the age estimation"
      },
      "BoundingBoxModel": {
        "type": "object",
        "properties": {
          "x": {
            "type": "integer",
            "description": "Horizontal position of the detected face bounding box",
            "format": "int32"
          },
          "y": {
            "type": "integer",
            "description": "Vertical position of the detected face bounding box",
            "format": "int32"
          },
          "width": {
            "type": "integer",
            "description": "Width of the detected face bounding box",
            "format": "int32"
          },
          "height": {
            "type": "integer",
            "description": "Height of the detected face bounding box",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Model for the bounding box of a detected face"
      },
      "FaceAgeEstimationModel": {
        "type": "object",
        "properties": {
          "face": {
            "$ref": "#/components/schemas/FaceDetectionModel"
          },
          "age": {
            "$ref": "#/components/schemas/AgeEstimationModel"
          }
        },
        "additionalProperties": false,
        "description": "Model for face age estimation"
      },
      "FaceDetectionModel": {
        "type": "object",
        "properties": {
          "confidence": {
            "type": "number",
            "description": "Face detection score with value range [0.0, 1.0] (higher is better)",
            "format": "float"
          },
          "boundingBox": {
            "$ref": "#/components/schemas/BoundingBoxModel"
          }
        },
        "additionalProperties": false,
        "description": "Model for face detection"
      },
      "FaceGenderDetectionModel": {
        "type": "object",
        "properties": {
          "face": {
            "$ref": "#/components/schemas/FaceDetectionModel"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          }
        },
        "additionalProperties": false,
        "description": "Model for face gender detection"
      },
      "Gender": {
        "enum": [
          "Male",
          "Female"
        ],
        "type": "string",
        "description": "Detected gender"
      },
      "GenderDetectionRequestModel": {
        "type": "object",
        "properties": {
          "image": {
            "$ref": "#/components/schemas/ImageModel"
          },
          "maxFaceCount": {
            "type": "integer",
            "description": "Maximum number of faces to be processed. Must be between 1 and 10. Default: 1.",
            "format": "int32",
            "default": 1
          }
        },
        "additionalProperties": false,
        "description": "Request model for gender detection"
      },
      "GenderDetectionResultModel": {
        "type": "object",
        "properties": {
          "faces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FaceGenderDetectionModel"
            },
            "description": "The faces that were processed and their gender detection results",
            "nullable": true
          },
          "unprocessedFaceCount": {
            "type": "integer",
            "description": "The number of faces that were not processed due to the maximum face count limit",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Model for the result of the gender detection"
      },
      "ImageModel": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL of a jpeg or png image",
            "nullable": true
          },
          "bytes": {
            "type": "string",
            "description": "Base 64 string encoded binary jpeg or png image",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents an image using either a URL or a Base64 encoded string."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter your token in the text input below.\r\n\r\nExample: \"1safsfsdfd...\"",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "ApiKey": {
        "type": "apiKey",
        "description": "API key Authorization header using the ApiKey scheme. \r\n\r\n Enter 'ApiKey' [space] and then your APIKey in the text input below.\r\n\r\nExample: \"ApiKey 5j3245lj...\"",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ],
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "DemographicEstimation"
    },
    {
      "name": "Health"
    }
  ]
}