Skip to main content
POST
OC Maker

Prompt contract

This endpoint runs two stages: a language model turns your prompt into a structured character sheet, then that sheet is rendered into an image. Your prompt must instruct the model to return a JSON object containing an oc_prompt field — that field becomes the image prompt. If the model returns anything that cannot be parsed as JSON, or the JSON has no oc_prompt, the job fails.
Any other keys you ask for (role_name, personality, character_backstory, …) are passed through to the result untouched, so you can shape the character sheet however you like. oc_ratio is optional — it lets the model choose the aspect ratio. The ratio request field overrides it, and 3:4 is used when neither is present.

Result

Unlike the other image endpoints, the result array contains two entries: the full JSON from the text stage, then the rendered image. Poll GET /api/v1/jobs/detail or use custom_callback_url.
The value of the type: "json" entry is an object, not a URL string — the only endpoint where this happens. Read the image from the entry with type: "image" rather than assuming json[0] is the image.
A few details worth knowing:
  • link_expired_at applies to the image link. It is also present on the JSON entry, where it has no meaning — ignore it there.
  • duration measures the image stage only, not the text stage, so it under-reports total latency.
  • Both stages share one img_uuid and are billed once. A failure in either stage fails the whole job and refunds the tokens.

Headers

Authorization
string

Body

application/json
prompt
string
required

Full prompt for the text stage. Must instruct the model to return a JSON object containing an oc_prompt field.

Required string length: 1 - 8000
image_render_model
enum<string>
required

Rendering backend used for the image stage.

Available options:
seedream,
gpt-image-2
system_prompt
string

Optional system prompt for the text stage. Defaults to a generic assistant prompt.

Maximum string length: 4000
text_model
string

Optional LLM model id for the text stage. Defaults to gemini-3-pro-preview.

Maximum string length: 100
ratio
enum<string>

Optional. Aspect ratio of the generated image. Overrides oc_ratio from the LLM output; defaults to 3:4.

Available options:
1:1,
2:3,
3:2,
4:3,
3:4,
16:9,
9:16
custom_callback_url
string<uri>

Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.

Example:

"https://your-server.com/goenhance/callback"

Response

code
integer
required
msg
string
required
data
object
required