AiGenerator

Register a client provided file for use with AIGenerator endpoints

Changed on

File Registration

Provide the URL for a previously uploaded file to receive an ID that can be used as the reference_file_registration_id in subsequent image generation requests.

The File Registration Request

The FileRegistrationRequest payload accepts the following parameters:

ParameterPurpose
urlRequired. Specifies the location of the file.
rights_claimedRequired. Acknowledgment that client owns or has a license for this file.
categoryOptional. Accepted values: CustomerProduct, ImageReference. Images to be used in POST /beta/ai/image-generations/background-generations must have the category set to CustomerProduct.

Uploading the file

Before calling this endpoint, a file must be uploaded to https://api.gettyimages.com/v3/search/by-image/uploads/{CLIENT_IMAGE.jpg}, where the client defines the {CLIENT_IMAGE.jpg} portion of the URL.

For example, using cURL:

curl -i -X PUT https://api.gettyimages.com/v3/search/by-image/uploads/my-test-image.jpg -H 'Content-Type: image/jpeg' -H 'Api-Key: API_KEY' --data-binary "@testimage.jpg"

Once the file has been uploaded, use the full URL as the url.

  • Uploaded files must be 10MB or smaller.
  • Uploads to the same URL will overwrite each other, so ensure that the client application is handling naming uniqueness appropriately.
  • Uploads expire after 24 hours.
  • Uploads and file registration must be performed using the same API Key.
post/v3/ai/file-registrations

Request

  • Base URL
    https://api.gettyimages.com (the document declares no server; this is the origin it was published from)
  • Auth
    • API key in header Api-Key
    • or OAuth 2
      Authorization codehttps://authentication.gettyimages.com/oauth2/auth
      Client credentials
      Password
      Token URLhttps://authentication.gettyimages.com/oauth2/token
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Request body

urlstring nullable

The location of the file.

rights_claimedboolean nullable

Acknowledgment of ownership or licensing of file.

category'ImageReference' | 'CustomerProduct'

Response

Returns the response

idstring nullable

Changes