Slazzer logo
Slazzer App

All-in-one AI photo editor

Get App

Text to Image API

  • Image Synthesis
  • AI Art
  • Image Generation
Generate Stunning Images from Text with a Single API Call

Our AI-powered API transforms your text descriptions into high-quality images. Perfect for art, design, marketing, and creative projects.

API Reference

Head
  • Server URL:
    https://api.slazzer.com/v2.0
  • Request Body:
    multipart/form-data
  • Method:
    POST
  • API:
    /txt2img

Authorization

  • API-KEY :
    string
  • Your API key :
    xxxx xxxx xxxx xxxx
  • Get API Key
Parameters Request body
  • text_prompt

    Type :string

    Required :Yes

    Description :

    The text_prompt parameter specifies the descriptive text input used to generate an image. The API processes this text to create a visually representative image based on the provided details. The more detailed and specific the prompt, the better the generated image will match expectations.

    Examples :
    • text_prompt = A futuristic cityscape with neon lights and flying cars.
    • text_prompt = A cozy cottage in the middle of a snowy forest, warm lights glowing inside.
    Important :
    • A well-structured prompt improves the accuracy and quality of the generated image.
    • Avoid overly vague descriptions for better results.
    • 0.20 credit will be charged for each generated image.
  • aspect_ratio

    Type : string

    Required : No

    Description :

    The aspect_ratio parameter defines the dimensions of the generated image. It controls the width-to-height ratio, allowing you to customize the image’s proportions. By default, the aspect ratio is set to 1:1, which creates a square image.

    Possible Values :
    • 1:1 (Default) - The generated image will have equal width and height of 2048px, resulting in a square image.
    • 1:2 - The image will have a width of 2304px and a height of 4096px.
    • 2:1 - The image will have a width of 4096px and a height of 2048px.
    • 4:5 - The image will have a width of 2048px and a height of 2560px.
    • 5:4 - The image will have a width of 2560px and a height of 2048px.
    • 16:9 - The image will have a width of 4096px and a height of 2304px.
    • 9:16 - The image will have a width of 2304px and a height of 4096px.
    • 3:4 - The image will have a width of 3072px and a height of 4096px.
    • 4:3 - The image will have a width of 4096px and a height of 3072px.
    • 2:3 - The image will have a width of 2728px and a height of 4096px.
    • 3:2 - The image will have a width of 4096px and a height of 2728px.
    • 3:1 - The image will have a width of 4096px and a height of 1364px.
    • 1:3 - The image will have a width of 1364px and a height of 4096px.
    • 4:6 - The image will have a width of 2728px and a height of 4096px.
    • 6:4 - The image will have a width of 4096px and a height of 2728px.
    • 5:7 - The image will have a width of 2048px and a height of 2864px.
    • 7:5 - The image will have a width of 2864px and a height of 2048px.
    • 7:9 - The image will have a width of 2048px and a height of 2592px.
    • 9:7 - The image will have a width of 2592px and a height of 2048px.
    • 3:5 - The image will have a width of 2456px and a height of 4096px.
    • 5:3 - The image will have a width of 4096px and a height of 2456px.
    • 5:8 - The image will have a width of 2048px and a height of 3276px.
    • 8:5 - The image will have a width of 3276px and a height of 2048px.
    • 5:6 - The image will have a width of 2048px and a height of 2456px.
    • 6:5 - The image will have a width of 2456px and a height of 2048px.
    • 10:11 - The image will have a width of 2048px and a height of 2252px.
    • 11:10 - The image will have a width of 2252px and a height of 2048px.
    Default Behavior :
    • If not specified, the default value is 1:1, meaning the image will have equal width and height.

    Example : aspect_ratio = 16:9

    Important :
    • Using a non-default aspect ratio may affect the overall image composition and content generation.
Response

Success

Request processed successfully!
Your request has been processed and completed. The response contains the result data or file as requested.

Binary image data

Error

Bad Request!
The request contains invalid parameters or input format. Please check the input and try again. (No credits were deducted.)

Example :
{
    "error": "Invalid input"
}

Error

Unauthorized!
Missing or invalid API key. Please provide a valid API key. (No credits were deducted.)

Example :
{
    "error": "invalid api key"
}

Error

Credits Required!
No credits remaining. Please top up your account to continue. (No credits were deducted.)

Example :
{
    "error": "No credits remaining"
}

Error

Rate Limit Exceeded!
Api rate limit crossed (No credit deducted)

Example :
{
    "error": "Api rate limit crossed"
}