⚙️API Access

API keys will be available for purchase soon.

Endpoint: /api/txt2img/

Description: The /api/txt2img/ endpoint allows users to generate pixel art images from text input. This powerful feature leverages PixAI's advanced AI algorithms to transform textual descriptions into visually appealing pixel art representations.

Request:

  • Method: POST

  • Authentication: Bearer Token (required for certain parameters)

  • Content-Type: application/json

Parameters:

  1. prompt(required): The textual description to be converted into pixel art. The text can include details such as object descriptions, scene settings, or character dialogues.

    • Type: String

  2. style (optional): The desired style for the generated pixel art. Users can specify a particular artistic style or theme for the output image, such as game items or medieval.

    • Type: String

    • Default: None

  3. size (optional): The size of the output pixel art image. Users can specify the dimensions of the image in pixels.

    • Type: Integer

    • Default: 256x256

  4. color_palette (optional): The color palette to be used for the pixel art generation. Users can choose from predefined color palettes or provide custom color schemes.

    • Type: String

    • Default: Standard palette

Example Request:

{
  "prompt": "A brave knight wielding a sword, standing before a castle gate.",
  "style": "Medieval",
  "size": 512,
  "color_palette": "Classic"
}

Response:

  • Status Code: 200 OK

  • Content-Type: image/png (binary data)

Example Response:

Image Data in base 64 format

Error Responses:

  • Status Code: 400 Bad Request

    • Description: Invalid parameters or missing required fields.

  • Status Code: 401 Unauthorized

    • Description: Authentication token is missing or invalid.

Authorization: To access the /api/txt2img/ endpoint, users must include a valid Bearer Token in the request header.

Example Bearer Token:

Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Notes:

  • Users can experiment with different combinations of parameters to achieve desired results.

  • Ensure that the text input is clear and descriptive to generate accurate pixel art representations.

  • API usage may be subject to rate limiting or usage quotas. Please refer to the PixAI API documentation for more information on usage limits and pricing.

Last updated