Endpoints

Edit an image

Edit an image with a prompt and a reference image.

In the JSON example, replace the image URL with your own publicly accessible image.

POST/v1/images/edits

Send your API key in the Authorization: Bearer YOUR_BEEFAPI_KEY header. Get an API key →

Request example

Use your key. Replace sample task IDs and image URLs.

curl -X POST "https://global.beefapi.com/v1/images/edits" \  -H "Authorization: Bearer YOUR_BEEFAPI_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-2",    "prompt": "Keep the subject and replace the background with a quiet beach.",    "image": "https://example.com/your-image.png",    "n": 1,    "response_format": "b64_json"  }'

Response examples

Illustrative values. Select a status code.

Completed image. Save promptly.

{  "created": 1788825600,  "data": [    {      "b64_json": "<base64-encoded image bytes>"    }  ]}

Request parameters

ParameterDescription
modelstringRequired

The model ID to use for this request.

promptstringRequired

Description of the image or edit.

nintegerOptional

Number of images to generate. Use 1 for this endpoint.

Supported value: 1

sizestringOptional

Start with 1024x1024. Check model support before choosing another size.

qualitystringOptional

Leave this out for your first request. Support varies by model.

Allowed values: autolowmediumhigh

response_formatstringOptional

Return an image URL or Base64-encoded image data.

Allowed values: urlb64_json

imagestringRequired

Public HTTPS image URL or complete data URL.

Response fields & status codes

Response fields

application/json

application/json

application/json

application/json

application/json

application/json