Skip to main content
POST
/
v1
/
edit
POST /v1/edit — Edit Images with AI via API
curl --request POST \
  --url https://api.example.com/v1/edit \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "image": "<string>",
  "model": "<string>"
}
'
{
  "success": true,
  "images": [
    {
      "url": "<string>"
    }
  ],
  "request_id": "<string>",
  "credits_used": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.artnex.app/llms.txt

Use this file to discover all available pages before exploring further.

The /v1/edit endpoint takes an existing image and a set of instructions, then returns a modified version of that image. Use it to change styles, remove or add objects, recolor elements, apply artistic effects, or perform any other AI-driven transformation.

Endpoint

POST https://api.artnex.ai/v1/edit

Request parameters

prompt
string
required
Instructions describing how to edit the image. Be specific about what you want to change and what you want to preserve. Maximum 4,000 characters.Example: "Change the background to a snowy mountain scene, keep the subject unchanged"
image
string
required
The source image to edit. Provide either:
  • A publicly accessible HTTPS URL pointing to the image, or
  • A base64-encoded image string (include the data URI prefix, e.g. data:image/jpeg;base64,...).
Supported formats: JPEG, PNG, WebP. Maximum file size: 10 MB.
model
string
required
The editing model to use. Must be one of the supported model IDs listed in the Models section below.

Response fields

success
boolean
required
true when the request completed successfully.
images
array
Array containing the edited image.
request_id
string
Unique identifier for this request, useful for support queries or logging.
credits_used
integer
Total credits deducted from your account balance for this request.

Models

Model IDCredits per editDescription
nano-banana-edit240Fast edits at a low credit cost
seedream-edit200Bytedance Seedream image editing
nano-banana-pro-edit800High-fidelity edits with fine detail
seedream-v4.5-edit800High-fidelity Seedream v4.5 editing
nano-banana-pro-edit-ultra1,000Ultra-quality edits for demanding use cases
gpt-image-2-editVariesOpenAI GPT-Image-2 editing; credits vary by resolution and quality
gpt-image-2-edit uses dynamic pricing based on resolution (1k, 2k, 4k) and quality (low, medium, high). Add resolution and quality fields to your request body when using this model.

Example requests

curl --request POST \
  --url https://api.artnex.ai/v1/edit \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "prompt": "Replace the background with a tropical beach at sunset, keep the subject unchanged",
    "image": "https://example.com/source-photo.jpg",
    "model": "nano-banana-pro-edit"
  }'

Example response

{
  "success": true,
  "images": [
    {
      "url": "https://cdn.artnex.ai/edit/req_xyz789abc/edited_image.jpg"
    }
  ],
  "request_id": "req_xyz789abc",
  "credits_used": 800
}

Error codes

HTTP statusError codeCause
400missing_promptThe prompt field is absent or empty
400missing_imageThe image field is absent
400invalid_image_formatThe image format is not supported or the file is corrupt
400image_too_largeThe image exceeds the 10 MB size limit
400invalid_modelThe model value is not a supported edit model ID
401invalid_api_keyThe API key is missing, malformed, or revoked
402insufficient_creditsYour account does not have enough credits to complete the request
429rate_limit_exceededYou have exceeded your plan’s daily request quota
Start with nano-banana-edit (240 credits) for quick iteration. Switch to nano-banana-pro-edit or nano-banana-pro-edit-ultra when you need maximum fidelity.