Endpoints

Generate an image

Generate an image from a text prompt.

POST/v1/images/generations

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/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

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

Response fields & status codes

Response fields

application/json

application/json

application/json

application/json

application/json

application/json