POST /v1/images/edits

Changed on

Edit images with JSON inputs. Multipart uploads require normal authentication before conversion; accountless x402 applies to JSON edit requests only when the unauthenticated quote request includes x-x402: true.

Request

  • Base URL
    https://api.nano-gpt.com/api
  • URL
    https://api.nano-gpt.com/api/v1/images/edits
  • Auth
    • HTTP bearer
    • or API key in header x-api-key
    • or none

Headers

x-x402'true'

Set to true on unauthenticated accountless x402 quote requests. Without this header, unauthenticated requests return 401 missing_api_key.

Request body

modelstring
promptstring required
imageDataUrlstring
imageDataUrlsstring[]
maskDataUrlstring
sizestring
ninteger

Response

Image edit response

createdinteger

Unix timestamp of when the image was created

costnumber

Cost of the generation

paymentSourcestring

Payment source used

remainingBalancenumber

Remaining balance after the generation

Example response

{
  "data": [
    {
      "url": "https://...signed-url..."
    }
  ]
}

Changes