> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aitasker.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Image Endpoint

> Generate an image via fal.ai and return the URL.



## OpenAPI

````yaml /openapi.json post /api/v1/allmodelchat/generate/image
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/allmodelchat/generate/image:
    post:
      tags:
        - AllModelChat
      summary: Generate Image Endpoint
      description: Generate an image via fal.ai and return the URL.
      operationId: generate_image_endpoint_api_v1_allmodelchat_generate_image_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmcImageGenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmcImageGenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AmcImageGenRequest:
      properties:
        prompt:
          type: string
          title: Prompt
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          default: flux-pro
        conversation_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Conversation Id
      type: object
      required:
        - prompt
      title: AmcImageGenRequest
    AmcImageGenResponse:
      properties:
        url:
          type: string
          title: Url
        model:
          type: string
          title: Model
        credit_cost:
          type: integer
          title: Credit Cost
      type: object
      required:
        - url
        - model
        - credit_cost
      title: AmcImageGenResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````