openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/visual-language-instruction-ai-api
info:
  title: Advanced Visual-Language Instruction API (LLaVA-13B)
  description: Analyze images & answer questions with GPT-4 level vision-language
    AIfast, accurate, and ideal for smart image understanding.
  version: 80537f9eead1a5bfa72d5ac6ea6414379be41d4d4f6679fd776e9535d1eb58bb
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            properties:
              loc:
                items:
                  anyOf:
                    - type: string
                    - type: integer
                title: Location
                type: array
              msg:
                title: Message
                type: string
              type:
                title: Error Type
                type: string
            required:
              - loc
              - msg
              - type
            title: ValidationError
            type: object
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Input:
      properties:
        image:
          description: Input image
          format: uri
          title: Image
          type: string
          x-order: 0
          example: https://replicate.delivery/pbxt/KRULC43USWlEx4ZNkXltJqvYaHpEx2uJ4IyUQPRPwYb8SzPf/view.jpg
        max_tokens:
          default: 1024
          description: Maximum number of tokens to generate. A word is generally 2-3 tokens
          minimum: 0
          title: Max Tokens
          type: integer
          x-order: 4
          example: 1024
        prompt:
          description: Prompt to use for text generation
          title: Prompt
          type: string
          x-order: 1
          example: Are you allowed to swim here?
        temperature:
          default: 0.2
          description: Adjusts randomness of outputs, greater than 1 is random and 0 is
            deterministic
          minimum: 0
          title: Temperature
          type: number
          x-order: 3
          example: 0.2
        top_p:
          default: 1
          description: When decoding text, samples from the top p percentage of most
            likely tokens; lower to ignore less likely tokens
          maximum: 1
          minimum: 0
          title: Top P
          type: number
          x-order: 2
          example: 1
      required:
        - image
        - prompt
      title: Input
      type: object
    Output:
      items:
        type: string
      title: Output
      type: array
      x-cog-array-display: concatenate
      x-cog-array-type: iterator
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            image:
              description: Input image
              format: uri
              title: Image
              type: string
              x-order: 0
            max_tokens:
              default: 1024
              description: Maximum number of tokens to generate. A word is generally 2-3
                tokens
              minimum: 0
              title: Max Tokens
              type: integer
              x-order: 4
            prompt:
              description: Prompt to use for text generation
              title: Prompt
              type: string
              x-order: 1
            temperature:
              default: 0.2
              description: Adjusts randomness of outputs, greater than 1 is random and 0 is
                deterministic
              minimum: 0
              title: Temperature
              type: number
              x-order: 3
            top_p:
              default: 1
              description: When decoding text, samples from the top p percentage of most
                likely tokens; lower to ignore less likely tokens
              maximum: 1
              minimum: 0
              title: Top P
              type: number
              x-order: 2
          required:
            - image
            - prompt
          title: Input
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: PredictionRequest
      type: object
    PredictionResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            image:
              description: Input image
              format: uri
              title: Image
              type: string
              x-order: 0
            max_tokens:
              default: 1024
              description: Maximum number of tokens to generate. A word is generally 2-3
                tokens
              minimum: 0
              title: Max Tokens
              type: integer
              x-order: 4
            prompt:
              description: Prompt to use for text generation
              title: Prompt
              type: string
              x-order: 1
            temperature:
              default: 0.2
              description: Adjusts randomness of outputs, greater than 1 is random and 0 is
                deterministic
              minimum: 0
              title: Temperature
              type: number
              x-order: 3
            top_p:
              default: 1
              description: When decoding text, samples from the top p percentage of most
                likely tokens; lower to ignore less likely tokens
              maximum: 1
              minimum: 0
              title: Top P
              type: number
              x-order: 2
          required:
            - image
            - prompt
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          items:
            type: string
          title: Output
          type: array
          x-cog-array-display: concatenate
          x-cog-array-type: iterator
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: PredictionResponse
      type: object
    Status:
      description: An enumeration.
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      title: Status
      type: string
    TrainingInput:
      properties:
        learning_rate:
          default: 0.0002
          description: The learning rate during training
          minimum: 1e-10
          title: Learning Rate
          type: number
          x-order: 2
        model_max_length:
          default: 2048
          description: The maximum length (in number of tokens) for the inputs to the model.
          minimum: 1
          title: Model Max Length
          type: integer
          x-order: 3
        num_train_epochs:
          default: 1
          description: The number of training epochs
          maximum: 1000
          minimum: 1
          title: Num Train Epochs
          type: integer
          x-order: 1
        train_data:
          description: https url or path name of a zipfile containing training data.
            Training data should have a json file data.json and an images/
            folder. data.json should link the images from images/ to
            conversations.
          title: Train Data
          type: string
          x-order: 0
      required:
        - train_data
      title: TrainingInput
      type: object
    TrainingOutput:
      properties:
        weights:
          format: uri
          title: Weights
          type: string
      required:
        - weights
      title: TrainingOutput
      type: object
    TrainingRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            learning_rate:
              default: 0.0002
              description: The learning rate during training
              minimum: 1e-10
              title: Learning Rate
              type: number
              x-order: 2
            model_max_length:
              default: 2048
              description: The maximum length (in number of tokens) for the inputs to the
                model.
              minimum: 1
              title: Model Max Length
              type: integer
              x-order: 3
            num_train_epochs:
              default: 1
              description: The number of training epochs
              maximum: 1000
              minimum: 1
              title: Num Train Epochs
              type: integer
              x-order: 1
            train_data:
              description: https url or path name of a zipfile containing training data.
                Training data should have a json file data.json and an images/
                folder. data.json should link the images from images/ to
                conversations.
              title: Train Data
              type: string
              x-order: 0
          required:
            - train_data
          title: TrainingInput
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: TrainingRequest
      type: object
    TrainingResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            learning_rate:
              default: 0.0002
              description: The learning rate during training
              minimum: 1e-10
              title: Learning Rate
              type: number
              x-order: 2
            model_max_length:
              default: 2048
              description: The maximum length (in number of tokens) for the inputs to the
                model.
              minimum: 1
              title: Model Max Length
              type: integer
              x-order: 3
            num_train_epochs:
              default: 1
              description: The number of training epochs
              maximum: 1000
              minimum: 1
              title: Num Train Epochs
              type: integer
              x-order: 1
            train_data:
              description: https url or path name of a zipfile containing training data.
                Training data should have a json file data.json and an images/
                folder. data.json should link the images from images/ to
                conversations.
              title: Train Data
              type: string
              x-order: 0
          required:
            - train_data
          title: TrainingInput
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          properties:
            weights:
              format: uri
              title: Weights
              type: string
          required:
            - weights
          title: TrainingOutput
          type: object
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: TrainingResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebhookEvent:
      description: An enumeration.
      enum:
        - start
        - output
        - logs
        - completed
      title: WebhookEvent
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with yorickvp/llava-13b
      description: Run inference with the yorickvp/llava-13b model on API.market
      operationId: createLlava_13bPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 80537f9eead1a5bfa72d5ac6ea6414379be41d4d4f6679fd776e9535d1eb58bb
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 80537f9eead1a5bfa72d5ac6ea6414379be41d4d4f6679fd776e9535d1eb58bb
                  input:
                    image: https://replicate.delivery/pbxt/KRULC43USWlEx4ZNkXltJqvYaHpEx2uJ4IyUQPRPwYb8SzPf/view.jpg
                    top_p: 1
                    prompt: Are you allowed to swim here?
                    max_tokens: 1024
                    temperature: 0.2
      responses:
        "201":
          description: Prediction created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  version:
                    type: string
                    description: Model version used for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
              examples:
                success:
                  summary: Successful prediction creation
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    version: 80537f9eead1a5bfa72d5ac6ea6414379be41d4d4f6679fd776e9535d1eb58bb
                    status: starting
                    created_at: 2025-05-18T08:21:06.873Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a1
        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
  /predictions/{id}:
    get:
      summary: Get prediction status and results
      description: Get the status and results of a yorickvp/llava-13b prediction from
        API.market
      operationId: getLlava_13bPrediction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The prediction ID
      responses:
        "200":
          description: Prediction details
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  output:
                    $ref: "#/components/schemas/Output"
                  error:
                    type: string
                    description: Error message if the prediction failed
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
                  started_at:
                    type: string
                    format: date-time
                    description: When the prediction started processing
                  completed_at:
                    type: string
                    format: date-time
                    description: When the prediction completed
              examples:
                succeeded:
                  summary: Successful prediction result
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    status: succeeded
                    output:
                      - "Yes, "
                      - "you "
                      - "are "
                      - "allowed "
                      - "to "
                      - "swim "
                      - "in "
                      - "the "
                      - "lake "
                      - "near "
                      - "the "
                      - "pier. "
                      - "The "
                      - "image "
                      - "shows "
                      - "a "
                      - "pier "
                      - "extending "
                      - "out "
                      - "into "
                      - "the "
                      - "water, "
                      - "and "
                      - "the "
                      - "water "
                      - "appears "
                      - "to "
                      - "be "
                      - "calm, "
                      - "making "
                      - "it "
                      - "a "
                      - "suitable "
                      - "spot "
                      - "for "
                      - "swimming. "
                      - "However, "
                      - "it "
                      - "is "
                      - "always "
                      - "important "
                      - "to "
                      - "be "
                      - "cautious "
                      - "and "
                      - "aware "
                      - "of "
                      - "any "
                      - "potential "
                      - "hazards "
                      - "or "
                      - "regulations "
                      - "in "
                      - "the "
                      - "area "
                      - "before "
                      - swimming.
                    created_at: 2023-01-01T12:00:00.000Z
                    started_at: 2023-01-01T12:00:05.000Z
                    completed_at: 2023-01-01T12:01:00.000Z
        "401":
          description: Unauthorized, invalid API token
        "404":
          description: Prediction not found
    parameters:
      - *a1
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: image
    description: Operations related to image
  - name: visual-recognition
    description: Operations related to visual-recognition
