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.
/v1/images/editsSend 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>" } ]}| Parameter | Description |
|---|---|
model | The model ID to use for this request. |
prompt | Description of the image or edit. |
n | Number of images to generate. Use 1 for this endpoint. Supported value: |
size | Start with 1024x1024. Check model support before choosing another size. |
quality | Leave this out for your first request. Support varies by model. Allowed values: |
response_format | Return an image URL or Base64-encoded image data. Allowed values: |
image | 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