Skip to main content
The input schema defines what data your endpoint accepts. When a request comes in, Endprompt validates it against your schema before processing—rejecting invalid requests with clear error messages.

Why Define Input Schema?

Automatic Validation

Invalid requests are rejected before hitting the LLM, saving costs

Clear Documentation

Your OpenAPI docs are auto-generated from your schema

Type Safety

Ensure prompts receive data in the expected format

Default Values

Provide sensible defaults for optional fields

Adding Input Fields

Navigate to your endpoint’s Input Schema tab and click Add Field.

Field Configuration

Field Types

Text values of any length.
Validation options:
  • minLength — Minimum character count
  • maxLength — Maximum character count
  • pattern — Regex pattern to match
  • enum — List of allowed values

Validation Rules

Add validation rules to ensure data quality:

String Validation

Enum (Allowed Values)

Use enums when you have a fixed set of valid options. They generate dropdowns in the test form and are documented in OpenAPI.

Number Ranges

Array Limits

Using Inputs in Prompts

Once defined, access input fields in your prompts using Liquid syntax:
Use the | default: filter to provide fallback values for optional fields.

JSON Schema Preview

The Input Schema tab shows a live JSON Schema preview:
This schema is used for:
  • Request validation
  • OpenAPI documentation
  • Test form generation

Best Practices

Field names should be clear and self-documenting.customer_feedback
cf
Descriptions appear in docs and help users understand what to provide.
Optional fields should have reasonable defaults so users don’t need to specify everything.
Use minLength, maxLength, and patterns to catch bad data before it reaches the LLM.
Avoid deeply nested objects. Flat schemas are easier to understand and template.

Example: Complete Input Schema

Here’s a full example for a content moderation endpoint:

Next Steps

Define Output Schema

Specify the structure of your endpoint’s response

Create a Prompt

Write the prompt that uses these inputs