Skip to Content
Management APIPrompt Endpoints

Prompt Endpoints

Manage versioned prompt templates served as API endpoints. See Prompts for the end-user invocation API.

Endpoints

OperationGraphQL
List endpointsprompt_endpoints(where: $whereConditions, limit: $limit, offset: $offset, order_by: {created_at: desc})
Create endpointinsert_prompt_endpoints_one(object: {application_id, name, path, visibility, versioning_mode, default_model_id, settings, created_by, ...})
Update endpointupdate_prompt_endpoints_by_pk(pk_columns: {id: $endpointId}, _set: {name, path, visibility, versioning_mode, is_active, settings, ...})

Endpoint fields

FieldTypeDescription
namestringDisplay name
pathstringURL slug for invocation (e.g., generate-quiz → /v1/prompts/generate-quiz/invoke)
visibilitystringpublic (any authenticated user), private (builder-role only), unlisted (accessible by URL, not listed)
versioning_modestringmanual, auto_increment, or semantic
default_model_iduuidReference to models table. Overridden by settings.defaultModel.
is_activebooleanWhen false, invoke returns 404
settingsjsonbConfiguration object (see below)
created_byuuidAccount ID of the creator

Settings object fields

The settings JSONB field configures the prompt behavior at invocation time. The invoke handler reads these fields directly.

FieldTypeUsed by serviceDescription
promptTemplatestringYesRequired for invoke. Prompt text with {{variable}} placeholders.
defaultModelstringYesProvider-prefixed model fallback (e.g., openai/gpt-5.4). Used when caller does not pass model.
returnJsonFormatstring (JSON)YesJSON Schema string. Instructs the model to output structured JSON matching this schema and validates the output server-side.
returnUsagebooleanYesWhen false, token usage is omitted from the response. Default: true.
temperaturenumberYesSampling temperature (0-2). Passed to the model at invoke time. Can be overridden per-request. Omit if your provider doesn’t support it.
maxTokensnumberYesMax output tokens. Passed to the model at invoke time. Can be overridden per-request via max_tokens.
topPnumberYesTop-p (nucleus) sampling. Passed to the model at invoke time. Omit if your provider doesn’t support it.

Current prompt invoke limitations

  • The invoke handler reads live prompt behavior from prompt_endpoints.settings.
  • Published prompt_versions are history/version records only; they are not read during invoke.
  • Tool-related request fields (tools, tool_choice, parallel_tool_calls) are not currently passed through by stored prompt invoke. Use /v1/responses directly if you need tool-enabled execution today.

Versions

OperationGraphQL
List versionsprompt_versions(where: {endpoint_id: {_eq: $endpointId}}, order_by: {created_at: desc})
Create versioninsert_prompt_versions_one(object: {endpoint_id, version, prompt_text, tools, parameters, created_by})
Publish versionupdate_prompt_versions_by_pk(pk_columns: {id: $versionId}, _set: {is_published: true, published_at: "now()"})
Get versioning modeprompt_endpoints_by_pk(id: $endpointId) { versioning_mode }

Important: The invoke handler currently reads the prompt from endpoint.settings.promptTemplate, not from published versions in prompt_versions. Versions are tracked for history and can be promoted to the active template by copying prompt_text into settings.promptTemplate.

Tags

OperationGraphQL
Add taginsert_prompt_tags_one(object: {endpoint_id, tag}, on_conflict: {constraint: prompt_tags_endpoint_tag_unique, update_columns: []})
Remove tagdelete_prompt_tags(where: {endpoint_id: {_eq: $endpointId}, tag: {_eq: $tag}})
List tagsprompt_tags(where: {endpoint_id: {_eq: $endpointId}})
Last updated on