Skip to main content
POST
Edit images

Authorizations

Authorization
string
header
required

An API key created in the OmniRelay console. The owner can view it again in the console after confirming their identity.

Headers

X-Gateway-Tags
string

Tags for this call as comma-separated key=value pairs, for example client=acme,env=prod. Merged with the API key's default tags; the tags body field wins on the same key. X-OmniRelay-Tags is the same header under its former name and stays accepted.

X-Gateway-Metadata
enum<string>

Send enabled to receive a gateway_metadata block describing what the gateway decided. Any other value, or no header, leaves the response unchanged. X-OmniRelay-Metadata is the same header under its former name and stays accepted.

Available options:
enabled

Body

multipart/form-data

Other fields (background, output_format, output_compression, moderation, user) are passed to the model, which accepts or refuses them.

model
string
required

Image model ID, for example gpt-image-2.

Example:

"gpt-image-2"

prompt
string
required

Text description of the image, up to 32000 characters.

Maximum string length: 32000
image
file
required

One or more source images (PNG, JPEG or WebP).

n
integer
default:1

Number of images, 1 to the model limit (4). n images are reserved; only the images returned are charged.

Required range: 1 <= x <= 4
size
string
default:auto

WIDTHxHEIGHT or auto. Decides the price tier: longest side up to 1024 px is 1K, up to 2048 px is 2K, up to 4096 px is 4K; auto or omitted is 2K.

Example:

"1024x1024"

quality
string

Passed to the model, for example low, medium, high or auto. Does not change the price.

response_format
enum<string>

Only b64_json is supported.

Available options:
b64_json
mask
file

Optional mask image; transparent areas mark where to edit.

Response

Images with settled usage and cost.

created
integer
required
model
string
required
data
object[]
required

Generated images.

cost_microusd
integer
required

Charged amount in micro-USD after your discount.

background
string
output_format
string
quality
string
size
string
usage
object

Token counts reported by the model, for information; images are billed per image, not per token.

omnirelay_metadata
object

Present only when the request sent X-Gateway-Metadata: enabled. Returned under both gateway_metadata and its former name omnirelay_metadata, with the same content. On a stream it rides the first chunk.

gateway_metadata
object

Present only when the request sent X-Gateway-Metadata: enabled. Returned under both gateway_metadata and its former name omnirelay_metadata, with the same content. On a stream it rides the first chunk.