Generate or edit and save an owned native diagram

post/generations

Request

  • Base URL: https://flowchartai.org/api/v1
  • URL: https://flowchartai.org/api/v1/generations
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Headers

Idempotency-Keystring required

8–120 ASCII letters, digits, underscore, period, colon or hyphen. Reuse the same key and exact request after a timeout. Keys are scoped to the owner, across their credentials.

Request body

promptstring required
max_creditsinteger required

Upper limit. A cap below the full-context estimate returns 409 max_credits_too_low with required_credits before generation. Never raise it without owner authorization. The accepted reservation may be lower; actual full-task provider usage is capped at that reservation.

imagestring

Optional PNG/JPEG/WebP base64 data URI, at most 2 MB decoded. Arbitrary URLs are not fetched.

diagram_idstring

Existing owned native file to edit; omit to create. Edits also require diagrams:read in addition to diagrams:write and diagrams:generate.

expected_versionstring

Required when diagram_id is set. Read the latest file first.

Response

Successful response

idstring uuid required
state'running' | 'prepared' | 'succeeded' | 'failed' required
operation'generate' | 'edit' | 'save' required
diagram_idstring required
budget_creditsinteger required

Accepted task estimate, retained after settlement.

reserved_creditsinteger required
charged_creditsinteger required
created_atstring date-time
updated_atstring date-time

Changes

No recorded changes to this operation across all 1 revision of this API.