DeepAI Guides

Guides

Edit an image with a text prompt using DeepAI's image editing API

Markdown

DeepAI's photo editor API changes an image you already have from a plain text instruction, such as a new setting, an added object or a different style. Each edit is one POST https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/api/image-editor request, billed at $0.08 on the genius tier or $0.25 on super_genius, which renders at 2K. Send it with a free agent credential from auth.md, pay its 402 price quote from a wallet, and the response carries output_url, a link to the edited image.

At a glance

  • Endpoint: POST https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/api/image-editor, one edit per request
  • Body: image (the image's URL), text (the edit instruction) and image_generator_version (genius or super_genius) are all required. genius_preference is an optional style on the genius tier.
  • Price per edit: genius $0.08, super_genius $0.25
  • Credential: an agent credential on every call, paid retries included, sent as Authorization: Bearer <token>, or as ZC-Agent-Authorization: Bearer <token> beside an MPP payment. Registering one at auth.md is free and can be anonymous, and its steps leave the access token in ACCESS_TOKEN, as the examples below use.
  • Payment: each request answers with a 402 price quote, paid from a wallet over x402 or MPP.
  • Response: a JSON object with id and output_url
  • Card: a pay-as-you-go call can be paid by card only at $0.50 or more. Prepaid Credits can be bought by card from $0.50.
  • Full purchase flow: the buyer skill

Edit an image with a text instruction

  1. Optionally, read the operation's contract. This GET is free:

    curl -s https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/services/photo-editor/openapi.json
    

    It lists the required fields, the accepted values for image_generator_version and genius_preference, and the live rates in x-payment-info.

  2. Send the edit request. The example image is a public-domain NASA photo:

    curl -s -i -X POST https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/api/image-editor \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H 'Content-Type: application/json' \
      -d '{"image": "https://images-assets.nasa.gov/image/PIA23882/PIA23882~medium.jpg", "text": "Place the helicopter on a dusty red desert surface under a pale sky", "image_generator_version": "genius", "genius_preference": "photography"}'
    

    The storefront answers with a 402 price quote, with the exact amount in payment.amountUsd.

  3. Pay the quote with an x402 or MPP client within your spending limit; the client resends the identical request with the proof attached and the same bearer. The buyer skill covers this flow in full.

  4. Read the response. It is a JSON object with two strings, id and output_url:

    {"id": "<job id>", "output_url": "<link to the edited image>"}
    

    The genius edit in step 2 paid $0.08. Fetch output_url to save the edited image.

Choose a tier and style

Each tier bills its own per-image rate. Both tiers take the same image and text.

Purposeimage_generator_versionPrice per edit
Edits with a style preferencegenius$0.08
Edits rendered at 2Ksuper_genius$0.25

genius_preference sets the art style on the genius tier. It takes classic, anime, photography, graphic or cinematic, and defaults to classic. Leave it out when you send super_genius. A super_genius body looks like this:

{"image": "https://images-assets.nasa.gov/image/PIA23882/PIA23882~medium.jpg", "text": "Place the helicopter on a dusty red desert surface under a pale sky", "image_generator_version": "super_genius"}

Limits

  • The photo editor accepts only the tiers genius and super_genius.
  • One request makes one edit and returns one output_url. There is no batch call, so ten edits take ten requests and are paid separately.
  • The JSON body takes the image as a URL. The endpoint also accepts multipart/form-data with the image as a file.
  • Card pays a pay-as-you-go call only at $0.50 or more. For smaller edits, either pay over x402 or MPP, or buy Credits (minimum $0.50) and let each edit draw down the balance. Buying Credits uses the same credential.
  • A timeout after you pay leaves the outcome uncertain. Check the result before you pay again.

Errors

ResponseMeaningAction
402 with a payment blockThe per-call price quotePay within your limit and retry the same request, or stop
400 invalid_requestThe request body is malformedFix the JSON and send the request again
settlement_failedThe payment did not settle. settlementReason says why, for example insufficient_funds.Fix the wallet, then send the request again for a fresh 402
409 payment_request_mismatchA payment was reused for a different requestRequest a fresh 402 for this request and pay that one
usage_exhaustedThe Credits balance is used upTop up with POST https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/extend and {"amountUsd": "..."}

The storefront forwards a paid call to DeepAI's API. Any error after that point comes back with DeepAI's own status code and body.

Frequently asked questions

Can I edit an image with DeepAI's API without an API key?

Yes. There is no DeepAI account or API key: every call carries a free agent credential from auth.md, registered once and anonymously if you like, and each edit is paid on its own through the storefront's 402 price quote over x402 or MPP.

How much does one AI image edit cost?

An edit costs $0.08 on genius and $0.25 on super_genius. The 402 states the exact amount before you pay, and the zc-billing header on the paid response confirms what was charged.

Can I pay for an image edit by card?

Card pays a pay-as-you-go call only when it costs $0.50 or more. For edits below that, buy prepaid Credits by card from $0.50 with the same credential, or pay each edit over x402 or MPP.

How is editing an image different from generating one?

The photo editor takes your image together with an instruction and changes that image. To make a new image from text alone, use DeepAI's text-to-image endpoint, POST https://deepai.pay.zeroclick.io/zcj/iun2svxfe92e/api/text2img.

Keep reading