{
  "openapi": "3.0.1",
  "info": {
    "title": "AIception Interactive",
    "description": "Here you can play & test & prototype all the endpoints using just your browser! Go ahead!",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://aiception.com/api/v2.1"
    }
  ],
  "security": [
    {
      "UserSecurity": null
    }
  ],
  "tags": [
    {
      "name": "vision",
      "description": "Everything about AIception vision API",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://aiception.com"
      }
    },
    {
      "name": "creative",
      "description": "What will you make?"
    },
    {
      "name": "language",
      "description": "Speech to text, text to speech, natural language processing",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://aiception.com"
      }
    }
  ],
  "paths": {
    "/adult_content": {
      "post": {
        "tags": [
          "vision"
        ],
        "summary": "Image contains nudity or sexually explicit content? [ image_url -> id ]",
        "description": "Creates a new adult_content task that tells the if the image has nudity or sexual content.",
        "requestBody": {
          "description": "The image to analyze",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "image_url"
                ],
                "type": "object",
                "properties": {
                  "async": {
                    "type": "boolean",
                    "default": true
                  },
                  "image_url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task succesfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Task could not be created."
          }
        }
      }
    },
    "/adult_content/{taskId}": {
      "get": {
        "tags": [
          "vision"
        ],
        "summary": "Gets the adult_content task [ id -> adult content task ]",
        "description": "Gets the adult_content task.",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "An internal id for the task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the adult_content task.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "404": {
            "description": "The Task does not exists."
          }
        }
      }
    },
    "/artistic_image": {
      "post": {
        "tags": [
          "creative"
        ],
        "summary": "Create an artistic image [ image_url, style_url -> id ]",
        "description": "Given an image content and a style image create a new stylized image of the content.",
        "requestBody": {
          "description": "The content image and the style image",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "image_url",
                  "style_url"
                ],
                "type": "object",
                "properties": {
                  "async": {
                    "type": "boolean",
                    "default": true
                  },
                  "image_url": {
                    "type": "string"
                  },
                  "style_url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task succesfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Task could not be created."
          }
        }
      }
    },
    "/artistic_image/{taskId}": {
      "get": {
        "tags": [
          "creative"
        ],
        "summary": "Gets a artistic image by task id [ id -> artistic image task ]",
        "description": "The artistic_image will have the urls of the stylized images.",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "An internal id for the task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the artistic_image task.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "404": {
            "description": "The Task does not exists."
          }
        }
      }
    },
    "/detect_object": {
      "post": {
        "tags": [
          "vision"
        ],
        "summary": "What is that object? [ image_url -> id ]",
        "description": "Creates a new detect object task that recognizes the object in the image.",
        "requestBody": {
          "description": "The image to analyze",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "image_url"
                ],
                "type": "object",
                "properties": {
                  "async": {
                    "type": "boolean",
                    "default": true
                  },
                  "image_url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task succesfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Task could not be created."
          }
        }
      }
    },
    "/detect_object/{taskId}": {
      "get": {
        "tags": [
          "vision"
        ],
        "summary": "Gets the detect_object task [ id -> detect object task]",
        "description": "Gets the detect_object task.",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "An internal id for the task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the detect_object task.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "404": {
            "description": "The Task does not exists."
          }
        }
      }
    },
    "/face": {
      "post": {
        "tags": [
          "vision"
        ],
        "summary": "Find all faces in the image [ image_url -> id ]",
        "description": "Get a list of all the locations of the faces in the image.",
        "requestBody": {
          "description": "The image to analyze",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "image_url"
                ],
                "type": "object",
                "properties": {
                  "async": {
                    "type": "boolean",
                    "default": true
                  },
                  "image_url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task succesfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Task could not be created."
          }
        }
      }
    },
    "/face/{taskId}": {
      "get": {
        "tags": [
          "vision"
        ],
        "summary": "Gets the face task [ id -> face task ]",
        "description": "Gets the face task.",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "An internal id for the task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the face task.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "404": {
            "description": "The Task does not exists."
          }
        }
      }
    },
    "/face_age": {
      "post": {
        "tags": [
          "vision"
        ],
        "summary": "How old is the person in the image? [ image_url -> id ]",
        "description": "Creates a new face age task that approximates the age of the person in the image.",
        "requestBody": {
          "description": "The image to analyze",
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "image_url"
                ],
                "type": "object",
                "properties": {
                  "async": {
                    "type": "boolean",
                    "default": true
                  },
                  "image_url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task succesfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Task could not be created."
          }
        }
      }
    },
    "/face_age/{taskId}": {
      "get": {
        "tags": [
          "vision"
        ],
        "summary": "Gets the face_age task [ id -> face age task ]",
        "description": "Gets the face_age task.",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "description": "An internal id for the task",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the face_age task.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "404": {
            "description": "The Task does not exists."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgeAnswer": {
        "type": "object",
        "properties": {
          "max": {
            "type": "integer"
          },
          "min": {
            "type": "integer"
          },
          "score": {
            "type": "number"
          }
        }
      },
      "Person": {
        "required": [
          "username"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        }
      },
      "Persons": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Person"
        }
      },
      "Task": {
        "required": [
          "image_url"
        ],
        "type": "object",
        "properties": {
          "answer": {
            "type": "number",
            "description": "The answer you are looking for.",
            "readOnly": true
          },
          "image_url": {
            "type": "string",
            "description": "The url of the image that will be processed."
          },
          "this_url": {
            "type": "string",
            "description": "Use this url to get this task.",
            "readOnly": true
          }
        }
      }
    },
    "securitySchemes": {
      "UserSecurity": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}