Skip to main content

Introduction

Shared model reference. For copyable requests, choose a scenario: Text to image · Image to image

Authentication

string
required
Bearer sk-xxxxxxxxxx
string
required
application/json
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

Do not pass quality, sequential_image_generation, sequential_image_generation_options, stream, or tools. These models do not support sequential image generation, streaming, or web search. Control resolution with size.

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 image

image

Reference formats and limits

size

For generation and ordinary editing, use one of these formats:
  • Resolution tier: 1K, 1.5K, or 2K (default). Describe the desired aspect ratio or use in the prompt.
  • Custom WIDTHxHEIGHT: use a lowercase x. 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 examples

layer_decomposition

Requirements and examples

layer_decomposition_options

Requirements and examples

safety_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.
Unlike 5.0 Pro, decomposition outputs have no discount. At most 100 images can be returned with 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.

Error handling

Failed requests return a JSON error object: