Introduction
Shared model reference. For copyable requests, choose a scenario: Text to image · Image to imageAuthentication
Create an API Key in the platform API key page. Do not embed keys in frontend code, public repositories, or client packages.Model information
Endpoints
POST https://api.gravitex.ai/v1/images/edits is equivalent and accepts the same JSON body. Both routes are forwarded to the same upstream image endpoint.
Request parameters
prompt
Required for generation and editing; optional for decomposition. Keep Chinese prompts within 300 characters and English prompts within 600 words. Interactive editing: Image to imageimage
Reference formats and limitssize
For generation and ordinary editing, use one of these formats:- Resolution tier:
1K,1.5K, or2K(default). Describe the desired aspect ratio or use in the prompt. - Custom
WIDTHxHEIGHT: use a lowercasex. Total pixels must be within[921600, 4624220]and width/height within[1/16, 16].
Layer decomposition accepts only
1K, 1.5K, 2K, or auto (default), not custom pixel dimensions. The base image follows size and the original aspect ratio; each layer is close to the selected resolution tier and retains its own aspect ratio. With auto, use the original size, clamped to the 1K–2K range while preserving aspect ratio.
Typical dimensions for each tier (not exhaustive):
optimize_prompt_options
Use{"optimize_prompt_options":{"mode":"standard"}}.
background
Requirements and exampleslayer_decomposition
Requirements and exampleslayer_decomposition_options
Requirements and examplessafety_identifier
Use a stable, unique English string of at most 64 characters. A hash of the user ID or email is recommended. The response echoes the value when supplied.Success response
Ordinary generation returns one image. Input image usage reflects the actual input count. URLs below illustrate the response structure only.Response fields
Additional layer/OCR fields and layer reconstruction
Download and persist URL results within 24 hours.
Pricing
Formula: reference-image charges + the sum of per-output charges at each output image pixel tier.- These are official base prices. Actual charges apply the token group multiplier; consult the model marketplace.
- Only successfully generated images are billed. Images rejected by moderation or otherwise not generated are not charged.
- The base image and each layer count as separate output images; each uses its own actual pixel tier.
max_images; choose a suitable limit for your budget.
Examples:
- Two references + one 2048×2048 output:
2 × 0.008 + 0.035 = 0.051 USD. - One reference + one 2048×2048 base image + six layers of 1K or less:
0.008 + 0.035 + 6 × 0.020 = 0.163 USD.
