DeepAI Guides

Guides

Colorize black-and-white photos with DeepAI's colorizer API

Markdown

DeepAI's image colorizer adds color to a black-and-white photo and returns a link to the colorized version. Each photo costs $0.01. Send POST https://deepai.pay.zeroclick.io/zcj/fi7il1lnuln1/api/colorizer with {"image": "<photo URL>"} and a free agent credential from auth.md, pay the 402 price quote over x402 or MPP, and retry the same request.

At a glance

  • Endpoint: POST https://deepai.pay.zeroclick.io/zcj/fi7il1lnuln1/api/colorizer, one photo per request
  • Body: JSON {"image": "<URL of the photo>"}, or multipart/form-data with the file in image
  • Price: $0.01
  • 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.
  • Card: card pays a pay-as-you-go call only when that call costs $0.50 or more. To pay by card, buy Credits from $0.50.
  • Response: JSON with id (the job identifier) and output_url (a link to the colorized image)
  • Full purchase flow: the buyer skill

Colorize one photo

  1. Send the photo's URL. The example uses a public-domain NASA photo:

    curl -sS -X POST https://deepai.pay.zeroclick.io/zcj/fi7il1lnuln1/api/colorizer \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H 'Content-Type: application/json' \
      -d '{"image": "https://images-assets.nasa.gov/image/LRC-1958-B701_P-03376/LRC-1958-B701_P-03376~medium.jpg"}'
    

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

  2. Pay the quote with your x402 or MPP client and retry the identical request with the payment proof attached and the same bearer. The buyer skill covers the steps for each rail.

  3. Read the response:

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

    The example request paid $0.01 for one photo and returned a JSON object with id and output_url.

  4. Fetch output_url and save the file next to the original scan, so the color version stays paired with its source.

To send a local file instead of a URL, use a multipart upload:

curl -sS -X POST https://deepai.pay.zeroclick.io/zcj/fi7il1lnuln1/api/colorizer -H "Authorization: Bearer $ACCESS_TOKEN" -F image=@scan-001.jpg

Colorize an archive of scans

Each request takes one image, so a set of scans is one request per photo, and each request gets its own 402 quote and payment. You cannot reuse a payment for a different photo.

For each scan, store the source file name with the returned id and output_url. This record lets you check which photos are done before you resend anything.

Archive sizeCost
1 photo$0.01
100 photos$1
1,000 photos$10

For a large run, you can buy prepaid Credits instead of paying each 402, and calls then draw down that balance. Buying Credits uses the same credential; the buyer skill has the steps.

Limits

  • The request takes one field, image.
  • Each request colorizes one photo.
  • A paid response carries a zc-billing header with chargedUsd, what the request was charged.
  • If a request times out after you pay, check whether that photo was delivered before you pay again. A settled payment cannot be spent a second time.

Errors

ResponseMeaningAction
402 with a payment blockThe price quote for this photoPay it and retry the same request, or stop
400 invalid_requestThe request body is malformedFix the JSON, which needs image
settlement_failedThe payment did not settle. settlementReason says why, for example insufficient_funds.Fix the wallet, then send a fresh request for a new quote
409 payment_request_mismatchA payment was reused for a different requestRequest a new 402 for each photo
payment_consumedThat payment was already settledCheck the photo's delivery before paying again
usage_exhaustedThe Credits balance is used upTop up with POST https://deepai.pay.zeroclick.io/zcj/fi7il1lnuln1/extend and {"amountUsd": "..."}

Once a paid call reaches DeepAI's API, the storefront passes back DeepAI's own status code and body, including its errors.

Frequently asked questions

Can DeepAI colorize a batch of photos in one API call?

No. Each request colorizes one photo, so an archive of scans is a series of requests. Each request is quoted and paid on its own.

How much does it cost to colorize old photos with DeepAI?

Each photo costs $0.01, so an archive costs the number of photos times that price. The 402 states the exact amount before you pay.

Does the DeepAI colorizer API need an API key?

No DeepAI account or API key, but every call carries a free agent credential from auth.md, registered once and anonymously if you like. Pay-as-you-go calls are then paid per request over x402 or MPP.

Can I pay for photo colorization by card?

Card pays a single pay-as-you-go call only when that call costs $0.50 or more. For smaller per-photo calls, buy Credits by card from $0.50 and let each call draw down the balance.

Can I upload an image file instead of sending a URL?

Yes. Send the file as multipart/form-data in the image field to the same endpoint. The price per photo is the same.

Keep reading