curl --request POST \
--url https://api.orq.ai/v2/gateway/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'model=<string>' \
--form 'prompt=<string>' \
--form 'image=<unknown>' \
--form n=1 \
--form 'size=<string>' \
--form quality=auto \
--form response_format=url \
--form 'user=<string>' \
--form 'orq={
"name": "<string>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"prompt": {
"id": "prompt_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"version": "latest"
},
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"cache": {
"type": "exact_match",
"ttl": 3600
},
"load_balancer": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
],
"timeout": {
"call_timeout": 30000
}
}'{
"created": 123,
"data": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"usage": {
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}Edit an Image
curl --request POST \
--url https://api.orq.ai/v2/gateway/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'model=<string>' \
--form 'prompt=<string>' \
--form 'image=<unknown>' \
--form n=1 \
--form 'size=<string>' \
--form quality=auto \
--form response_format=url \
--form 'user=<string>' \
--form 'orq={
"name": "<string>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"prompt": {
"id": "prompt_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"version": "latest"
},
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"cache": {
"type": "exact_match",
"ttl": 3600
},
"load_balancer": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
],
"timeout": {
"call_timeout": 30000
}
}'{
"created": 123,
"data": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"usage": {
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The model to use for image edit. Check models
A text description of the desired image(s).
The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.
The number of images to generate. Must be between 1 and 10.
1 <= x <= 10The size of the generated images
The quality of the image that will be generated. Auto will automatically select the best quality for the given model.
auto, high, medium, low, standard The format in which the generated images are returned. Some of the models only return the image in base64 format.
url, b64_json A unique identifier representing your end-user, which can help to monitor and detect abuse.
Show child attributes
The name to display on the trace. If not specified, the default system name will be used.
Retry configuration for the request
Prompt configuration for the request
Information about the contact making the request. If the contact does not exist, it will be created automatically.
Show child attributes
Unique identifier for the contact
"contact_01ARZ3NDEKTSV4RRFFQ69G5FAV"
Display name of the contact
"Jane Doe"
Email address of the contact
URL to the contact's avatar or logo
"https://example.com/avatars/jane-doe.jpg"
A list of tags associated with the contact
["hr", "engineering"]
Array of models with weights for load balancing requests
[
{ "model": "openai/gpt-4o", "weight": 0.7 },
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
Represents an image edit response from the API.
The Unix timestamp (in seconds) of when the image was created.
The output format of the image generation
The size of the image generated
The quality of the image generated
The token usage information for the image generation.
Show child attributes
The total number of tokens (images and text) used for the image generation.
The number of tokens (images and text) in the input prompt.
The number of output tokens generated by the model.
Was this page helpful?