openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/instant-character-image-avatar-generator
info:
  title: Ultra-Fast Character Image Generator API (Instant Character)
  description: Generate unique, stylized character avatars from text prompts in
    seconds with Tencent's Instant Character AI modelideal for games, media, and
    apps.
  version: df5eed34fa9c812acf62d3ca79874daf9b5e78c2bee11f4ada182a55dd5c1712
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:
        guidance_scale:
          default: 3.5
          description: Guidance scale for the diffusion process
          title: Guidance Scale
          type: number
          x-order: 5
          example: 3.5
        height:
          default: 512
          description: Height of the output image
          maximum: 2048
          minimum: 512
          title: Height
          type: integer
          x-order: 3
          example: 1344
        lora:
          default: none
          description: Lora to use
          enum:
            - none
            - ghibli_style
            - makoto_shinkai
          title: lora
          type: string
          x-order: 7
          example: ghibli_style
        num_inference_steps:
          default: 28
          description: Number of diffusion steps
          title: Num Inference Steps
          type: integer
          x-order: 6
          example: 28
        prompt:
          description: Prompt for the image generation
          title: Prompt
          type: string
          x-order: 1
          example: a character in the library
        seed:
          default: -1
          description: Seed for the random number generator, -1 for random
          title: Seed
          type: integer
          x-order: 4
          example: -1
        subject_image:
          description: Grayscale input image
          format: uri
          title: Subject Image
          type: string
          x-order: 0
          example: https://blog.api.market/wp-content/uploads/2026/04/instant-charachter-image-avatar.png
        width:
          default: 512
          description: Width of the output image
          maximum: 2048
          minimum: 512
          title: Width
          type: integer
          x-order: 2
          example: 768
      required:
        - subject_image
        - prompt
      title: Input
      type: object
    Output:
      format: uri
      title: Output
      type: string
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            guidance_scale:
              default: 3.5
              description: Guidance scale for the diffusion process
              title: Guidance Scale
              type: number
              x-order: 5
            height:
              default: 512
              description: Height of the output image
              maximum: 2048
              minimum: 512
              title: Height
              type: integer
              x-order: 3
            lora:
              default: none
              description: Lora to use
              enum:
                - none
                - ghibli_style
                - makoto_shinkai
              title: lora
              type: string
              x-order: 7
            num_inference_steps:
              default: 28
              description: Number of diffusion steps
              title: Num Inference Steps
              type: integer
              x-order: 6
            prompt:
              description: Prompt for the image generation
              title: Prompt
              type: string
              x-order: 1
            seed:
              default: -1
              description: Seed for the random number generator, -1 for random
              title: Seed
              type: integer
              x-order: 4
            subject_image:
              description: Grayscale input image
              format: uri
              title: Subject Image
              type: string
              x-order: 0
            width:
              default: 512
              description: Width of the output image
              maximum: 2048
              minimum: 512
              title: Width
              type: integer
              x-order: 2
          required:
            - subject_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:
            guidance_scale:
              default: 3.5
              description: Guidance scale for the diffusion process
              title: Guidance Scale
              type: number
              x-order: 5
            height:
              default: 512
              description: Height of the output image
              maximum: 2048
              minimum: 512
              title: Height
              type: integer
              x-order: 3
            lora:
              default: none
              description: Lora to use
              enum:
                - none
                - ghibli_style
                - makoto_shinkai
              title: lora
              type: string
              x-order: 7
            num_inference_steps:
              default: 28
              description: Number of diffusion steps
              title: Num Inference Steps
              type: integer
              x-order: 6
            prompt:
              description: Prompt for the image generation
              title: Prompt
              type: string
              x-order: 1
            seed:
              default: -1
              description: Seed for the random number generator, -1 for random
              title: Seed
              type: integer
              x-order: 4
            subject_image:
              description: Grayscale input image
              format: uri
              title: Subject Image
              type: string
              x-order: 0
            width:
              default: 512
              description: Width of the output image
              maximum: 2048
              minimum: 512
              title: Width
              type: integer
              x-order: 2
          required:
            - subject_image
            - prompt
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          format: uri
          title: Output
          type: string
        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
    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
    lora:
      description: An enumeration.
      enum:
        - none
        - ghibli_style
        - makoto_shinkai
      title: lora
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with tuannha/instant-character
      description: Run inference with the tuannha/instant-character model on API.market
      operationId: createInstant_characterPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: df5eed34fa9c812acf62d3ca79874daf9b5e78c2bee11f4ada182a55dd5c1712
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: df5eed34fa9c812acf62d3ca79874daf9b5e78c2bee11f4ada182a55dd5c1712
                  input:
                    lora: ghibli_style
                    seed: -1
                    width: 768
                    height: 1344
                    prompt: a character in the library
                    subject_image: https://blog.api.market/wp-content/uploads/2026/04/instant-charachter-image-avatar.png
                    guidance_scale: 3.5
                    num_inference_steps: 28
      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: df5eed34fa9c812acf62d3ca79874daf9b5e78c2bee11f4ada182a55dd5c1712
                    status: starting
                    created_at: 2025-05-18T08:21:08.615Z
        "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 tuannha/instant-character
        prediction from API.market
      operationId: getInstant_characterPrediction
      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: https://blog.api.market/wp-content/uploads/2026/04/output-ghibli.png
                    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: code-formatting
    description: Operations related to code-formatting
  - name: document-pdf-tools
    description: Operations related to document-pdf-tools
  - name: storage-key-value
    description: Operations related to storage-key-value
