GlyphfieldDocs
Agents

Errors and limits

Handle validation responses, request limits, content types, and retries safely.

Validation failures use a structured response:

{
  "error": {
    "code": "invalid_request",
    "field": "settings.width",
    "message": "settings.width must be an integer between 64 and 4096."
  },
  "schemaVersion": 1
}

Status codes

StatusMeaningResponse
400Malformed JSON or invalid fieldCorrect the named field
413Request body exceeds 5 MBReduce or recompress embedded assets
415Content-Type is not JSONSend Content-Type: application/json
500Artifact generation failedLog the response and retry only if appropriate

Retry policy

Do not retry an unchanged 4xx request. Read error.field, correct the input, and submit a new request.

For transient 5xx responses, use bounded exponential backoff and retain the original request for diagnosis. Generation is deterministic for the same contract and inputs.

Important limits

  • Request body: 5 MB maximum
  • Data URL asset: 5 MB maximum
  • Background width and height: 64–4096
  • Background total pixels: 12,000,000 maximum
  • Template title: 240 characters
  • Template eyebrow: 80 characters
  • Template body: 1000 characters
  • Remote asset URLs: unsupported

Contract drift

Always read GET /api/generate and check schemaVersion. If the schema version is unknown, stop and update the client rather than silently guessing.

On this page