HL Gaming AI Image Generator API Documentation




HL Gaming AI Image Generator API Documentation
Welcome to the comprehensive developer documentation for the imageGEN endpoint of the HL Gaming AI Image Generator API. This guide details everything you need—from authentication and parameter specifications to example requests using both GET and POST methods. We aim to make integration smooth, so you can focus on delivering creative and engaging experiences.
Key Features:
  • AI Image Generation: Create high-quality images using descriptive prompts.
  • Multiple HTTP Methods: Examples provided for both GET (for testing/demo) and POST (recommended for production).
  • Direct HTML Rendering: Render the returned base64 image data directly in your web pages.
  • Usage Tracking: Monitor your daily quota and understand your API consumption with detailed usage stats.
Authentication & Security
Each request to the HL Gaming AI Image Generator API must include your unique useruid and private api key. These credentials ensure that only authorized users generate images and their usage is properly tracked.
Security Tip: We strongly recommend using HTTP POST for production requests to secure your credentials. Never expose your api key or useruid in client‑side code.
Endpoint Parameters
To successfully interact with the image generation API, include the following parameters in your request:
Parameter Requirement Description
sectionName Required Must be imageGEN to designate that the request is for image generation.
useruid Required Your unique developer/user identifier for authentication and quota tracking.
api Required Your secret API key. Keep this confidential.
prompt Required A detailed text description of the image you want generated. The more descriptive your prompt, the better the results.
Important: Do not include parameters such as imgBase64 or mimeType as these are managed server‑side.
HTTP Methods: GET vs. POST
This API endpoint supports both GET and POST requests:
  • GET Method: Ideal for quick testing or when you want to quickly verify responses using tools like cURL, Postman, or browser-based API explorers. GET requests append all parameters in the URL.
  • POST Method: Recommended for production environments. POST requests help in hiding sensitive credentials within the request body and enable better security practices. Using POST also allows for larger payloads if needed.
Tip: While our examples include GET requests, switch to POST for live applications.
Example API Requests
Below are detailed examples for both GET and POST request formats. Replace YOUR_USER_ID and YOUR_API_KEY with your actual credentials, and adjust the prompt to suit your creative needs.
1. GET Request Example (For Testing/Demo):
curl -X GET "https://hl-gaming-official-main-api-v2-image-gen.vercel.app/api?sectionName=imageGEN&useruid=YOUR_USER_ID&api=YOUR_API_KEY&prompt=A%20dragon%20flying%20over%20cyberpunk%20city%20at%20night"
In JavaScript (GET):
const response = await fetch("https://hl-gaming-official-main-api-v2-image-gen.vercel.app/api?sectionName=imageGEN&useruid=YOUR_USER_ID&api=YOUR_API_KEY&prompt=A dragon flying over cyberpunk city at night"); const data = await response.json(); console.log(data);
2. POST Request Example (Recommended for Production):
curl -X POST "https://hl-gaming-official-main-api-v2-image-gen.vercel.app/api" \ -H "Content-Type: application/json" \ -d '{ "sectionName": "imageGEN", "useruid": "YOUR_USER_ID", "api": "YOUR_API_KEY", "prompt": "A dragon flying over cyberpunk city at night" }'
In JavaScript using fetch (POST):
const response = await fetch("https://hl-gaming-official-main-api-v2-image-gen.vercel.app/api", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ sectionName: "imageGEN", useruid: "YOUR_USER_ID", api: "YOUR_API_KEY", prompt: "A dragon flying over cyberpunk city at night" }) }); const data = await response.json(); console.log(data);
Example Output Response
A successful response includes a base64‑encoded image along with a usage object providing detailed API consumption statistics.
{ "source": "HL Gaming Official AI Image Maker", "endpoint": "imageGEN/generate/ai", "image": { "mimeType": "image/png", "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAGQ..." }, "usage": { "usedToday": 4, "dailyLimit": 10, "remainingToday": 6 } }
Image Made By Ai
This is the image which AI return in base64,:
Example AI-generated response image
Error Handling & Warnings
The API returns clear error messages with each response to help you troubleshoot. Common errors include:
  • Invalid API key: {"error": "Invalid API key."}
  • Missing fields: {"error": "Missing required parameters. Ensure sectionName, useruid, api, and prompt are provided."}
  • Quota exceeded: {"error": "Quota exceeded. Upgrade your plan.", "upgradeLink": "https://www.hlgamingofficial.com/p/api-pricing.html"}
  • Server/API errors: {"error": "AI API error", "details": "429 Too Many Requests"}
Usage & Best Practices
To ensure smooth integration and high-quality output:
  • Use POST requests in production to securely pass sensitive credentials in the request body.
  • Cache results where possible to minimize unnecessary API calls and help manage your quota.
  • Ensure detailed and clear prompts to drive better image generation results.
  • Implement robust error handling. Check responses for error messages and prepare fallback logic to handle unexpected conditions.
  • Regularly monitor your usage by reviewing the usage object in each response.
  • Securely store your credentials on the server side; never expose your api key or useruid in client‑side code.
Obtaining Your Credentials
To begin using the HL Gaming AI Image Generator API, register via our developer portal. You will be issued a unique useruid and a private api key required for authentication.
Credential Description
useruid Your unique developer/user identifier.
api Your secret API key for authentication and quota tracking.
API Code Samples
The following code samples are provided in multiple languages to assist in your integration. Switch between GET and POST examples according to your environment needs.

    
FAQ & Developer Support
Q1: Why should I use POST instead of GET?
A: POST requests enhance security by hiding sensitive data in the request body and support larger payloads. They are recommended for production environments.
Q2: What if I encounter an error such as "Quota exceeded"?
A: The response will include an upgradeLink with additional instructions. Monitor your daily usage and consider upgrading your plan.
Q3: How can I ensure my API credentials are secure?
A: Store your credentials on the server side, use POST requests, and ensure they are never exposed in client‑side code.
Need further help? Contact our support at support@hlgamingofficial.com.
HL Gaming Official API Documentation – AI Image Generator Endpoints © 2025
Contact: Developers | Support

HL GAMING OFFICIAL FAST VIEW

You are offline. Connect to the internet.
Site Guider Chat