Markdown ↗

OHGROK / Integration guide

Generate an image

Send a synchronous image-generation request.

POST/v1/images/generationsGet Markdown ↗
On this page

Authentication

Use Authorization: Bearer YOUR_API_KEY. The selected model must be enabled for that key’s group. JSON requests use Content-Type: application/json.

Parameters

FieldTypeRequiredDescription
modelstringRequiredEnabled image model, such as image-2.
promptstringRequiredDescribe the desired image.
nintegerOptionalStart with 1; check limits for the chosen model.

Request example

cURL
export OHGROK_API_KEY='YOUR_API_KEY'

curl --fail-with-body --silent --show-error \
  'https://api.ohgrok.com/v1/images/generations' \
  -H "Authorization: Bearer $OHGROK_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "image-2",
    "prompt": "A blue inflatable puppy on a peach studio set, soft natural shadows",
    "n": 1
  }' \
  -o image-response.json

Response structure

Inspect data[].url or data[].b64_json according to the format actually returned. Do not assume all models return the same field or file type. Size options and other parameters require model-specific confirmation.

Error handling

Read the HTTP status together with the returned error message. Check your key and group for authentication or model-access failures. Inspect balance and upstream limits for quota/rate errors; retain task IDs on timeouts.