openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/age-detector
info:
  title: Age Detector API
  description: Predict and Analyze Age from Images with Ease
  version: 1.0.1
paths:
  /predictions:
    post:
      summary: Submit an image for prediction
      description: Sends an image URL to the API and receives a predicted output.
      operationId: createPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  type: object
                  properties:
                    image:
                      type: string
                      format: uri
                      example: https://blog.api.market/wp-content/uploads/2025/02/fb_pic_2021.jpg
              required:
                - input
      responses:
        "200":
          description: Successful prediction
          content:
            application/json:
              schema:
                type: object
                properties:
                  input:
                    type: object
                    properties:
                      image:
                        type: string
                        format: uri
                        example: https://blog.api.market/wp-content/uploads/2025/02/fb_pic_2021.jpg
                  output:
                    type: string
                    example: "19"
                  id:
                    type: string
                    nullable: true
                  version:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                    nullable: true
                  started_at:
                    type: string
                    format: date-time
                    example: 2025-02-05T14:26:34.948642+00:00
                  completed_at:
                    type: string
                    format: date-time
                    example: 2025-02-05T14:26:35.033861+00:00
                  logs:
                    type: string
                    example: ""
                  error:
                    type: string
                    nullable: true
                  status:
                    type: string
                    enum:
                      - pending
                      - processing
                      - succeeded
                      - failed
                    example: succeeded
                  metrics:
                    type: object
                    properties:
                      predict_time:
                        type: number
                        format: float
                        example: 0.085219
                  webhook:
                    type: string
                    nullable: true
                  webhook_events_filter:
                    type: array
                    items:
                      type: string
                      enum:
                        - completed
                        - start
                        - logs
                        - output
                    example:
                      - completed
                      - start
                      - logs
                      - output
                  output_file_prefix:
                    type: string
                    nullable: true
        "400":
          description: Invalid request
        "500":
          description: Internal server error
    parameters:
      - description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
security: {}
tags:
  - name: cybersecurity
    description: Operations related to cybersecurity
  - name: visual-recognition
    description: Operations related to visual-recognition
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
