Creed image-generation API

The image-generation API from Creed — 1 operation(s) for image-generation.

OpenAPI Specification

creed-image-generation-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Creed achievements image-generation API
  description: Creed API - Christian AI Chatbot
  version: 1.0.0
tags:
- name: image-generation
paths:
  /api/generate-image:
    post:
      tags:
      - image-generation
      summary: Generate Image
      description: 'Generate an image using OpenAI''s image generation API.


        This endpoint accepts an image upload and various parameters to transform

        the image according to the provided prompt and style settings.'
      operationId: generate_image_api_generate_image_post
      security:
      - HTTPBearer: []
      parameters:
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_generate_image_api_generate_image_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ImageGenerationResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the generation was successful
        data:
          items:
            $ref: '#/components/schemas/ImageData'
          type: array
          title: Data
          description: List of generated images
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
          description: Error message if generation failed
      type: object
      required:
      - success
      - data
      title: ImageGenerationResponse
      description: Response model for image generation
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ImageData:
      properties:
        url:
          anyOf:
          - type: string
          - type: 'null'
          title: Url
          description: URL of the generated image
        b64_json:
          anyOf:
          - type: string
          - type: 'null'
          title: B64 Json
          description: Base64 encoded image data
      type: object
      title: ImageData
      description: Individual image data in response
    Body_generate_image_api_generate_image_post:
      properties:
        image:
          type: string
          format: binary
          title: Image
        prompt:
          type: string
          title: Prompt
        style:
          anyOf:
          - type: string
          - type: 'null'
          title: Style
        scene:
          anyOf:
          - type: string
          - type: 'null'
          title: Scene
        input_fidelity:
          anyOf:
          - type: string
          - type: 'null'
          title: Input Fidelity
          default: high
        background:
          anyOf:
          - type: string
          - type: 'null'
          title: Background
          default: auto
        output_format:
          anyOf:
          - type: string
          - type: 'null'
          title: Output Format
          default: png
        quality:
          anyOf:
          - type: string
          - type: 'null'
          title: Quality
          default: high
        size:
          anyOf:
          - type: string
          - type: 'null'
          title: Size
          default: 1024x1024
        n:
          anyOf:
          - type: integer
          - type: 'null'
          title: N
          default: 1
      type: object
      required:
      - image
      - prompt
      title: Body_generate_image_api_generate_image_post
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase JWT token