AI Image Generation API Documentation (v1)
This endpoint provides a secure proxy gateway, allowing you to trigger AI image generation models without exposing your underlying service provider credentials.
1. Overview
2. Authentication
All requests must include a security token in the HTTP Header to prevent unauthorized access. You must obtain this token from your administrator.
3. Request Parameters
All parameters must be sent in the JSON request body.
| Parameter | Type | Required | Description |
|---|
| prompt | string | Yes | Text description of the image you want to generate |
| size | string | No | Image resolution. Default: 1024x1024. Supported values: 256x256, 512x512, 1024x1024 |
| n | integer | No | Number of images to generate. Default: 1. Recommended range: 1–4 |
4. cURL Example
5. JavaScript Example
6. Response Format
7. Error Responses
If an error occurs, the API will return a JSON error message.
8. Status Codes
| Code | Meaning |
|---|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 403 | Invalid or missing API token |
| 500 | Remote AI service failed or timed out |