Endpoints
Generate an image
Generate an image from a text prompt.
POST
/v1/images/generationsSend 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/generations" \ -H "Authorization: Bearer YOUR_BEEFAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A small orange sailboat on a quiet lake, watercolor illustration.", "n": 1, "size": "1024x1024", "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
application/json
| 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: |
Response fields & status codes
Response fields
application/json
application/json
application/json
application/json
application/json
application/json