Skip to navigation

Generate a decision

View as Markdown

Runs a managed prompt (selected by prompt_type) over your input variables and returns a JSON object shaped by the response schema.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
prompt_typestringRequired<=200 characters

Which managed prompt to run. Prompt types are enabled per workspace by FormantAI; a type that is not enabled returns 400.

prompt_variablesmap from strings to anyOptional

Values for the prompt’s input variables, keyed by variable name. Not enforced: a missing variable still runs and is billed.

response_schemamap from strings to anyOptional
Optional JSON Schema for the answer. Omit it to get the prompt type's default shape.

Response

The structured answer
datamap from strings to anyOptional

The answer, shaped by response_schema or the prompt type’s default.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
413
Content Too Large Error
422
Unprocessable Entity Error
429
Too Many Requests Error
502
Bad Gateway Error
503
Service Unavailable Error