Skip to main content
This page covers the detailed configuration for Endpoint Connection request formatting, response extraction, and retry behavior.

Input Template

The Input Template is a Jinja2 template string that defines how Galtea formats the request body before sending it to your endpoint.
For a detailed guide on structured input syntax ({{ input.field_name }}), context fields, JSON escaping, the placeholder toolbar, and missing field behavior, see the Structured Input Template Syntax reference.

Available Placeholders

Conversation History

Use {% for turn in past_turns %}...{% endfor %} to loop through previous conversation turns. Each turn exposes:
  • {{ turn.input }} — Previous user input
  • {{ turn.output }} — Previous assistant response

Examples

OpenAI-compatible format:
Previous queries array:
Custom format:
When a loop is the last item in a JSON array, use {% if not loop.last %},{% endif %} after each iteration to prevent a trailing comma. When there’s content after the loop (like in the OpenAI example above), trailing commas are valid and this pattern is not required.

Output Mapping

A JSON object defining how to extract values from the API response using JSONPath expressions.

Special Keys

JSONPath Syntax Reference

Example

State Management

If your API returns values that need to be sent in subsequent requests (e.g., session_id, tenant_id), Galtea can automatically manage this state:
  1. Extract — Use Output Mapping to pull values from the API response using JSONPath expressions
  2. Store — Extracted values are saved in the session and become available as template variables
  3. Reuse — Reference any stored value in the Input Template or URL using {{ variable_name }} syntax
On the first turn, undefined placeholders resolve to empty strings. After the first response, all extracted values become available for subsequent turns.
Example: capture session_id and tenant_id from responses:

Custom Headers

Custom headers are sent with every request to your endpoint. Header values support placeholder substitution for injecting authentication credentials, so you can place tokens in any header — not just the standard Authorization or X-API-Key headers.

Available Placeholders

Placeholders are case-insensitive and work with both {{ placeholder }} and { placeholder } syntax.

Example

If you define an Authorization or X-API-Key header in custom headers, Galtea will not add the default authentication header — your custom header takes precedence.

W3C Trace Context Propagation

When W3C trace context propagation is enabled, Galtea adds a traceparent header to every request following the W3C Trace Context specification. This allows your endpoint to correlate requests with Galtea’s traces without any code changes. You can add a traceparent key in your custom headers as a placeholder — Galtea will replace its value with the correct trace context at request time. See Send OpenTelemetry Traces to Galtea for how correlated spans become Trace records.

Timeout

How long Galtea waits for a single HTTP call to your endpoint before giving up. It is applied per attempt, so each retry gets the full timeout again.
Number
Per-attempt request timeout in seconds. Default: 15. Maximum: 120 (values above this are rejected at the API).
A timeout counts as a retryable failure. If retry is enabled, a timed-out call is retried like any other transient error.

Rate Limit

The maximum number of requests per minute your backend can handle. Galtea throttles itself to stay under this limit, using a token bucket shared across all of Galtea, so the limit holds even when many runs execute at once.
Number
Maximum requests per minute. Default: empty, which means no limit (no throttling). Set a number only if your backend needs Galtea to slow down.
When the limit is reached, Galtea reschedules the call for later. This wait does not use up a retry attempt and does not block other runs.

Retry Configuration

Configure automatic retry behavior for failed requests. When enabled, Galtea retries requests that fail with a retryable HTTP status code, a timeout, or a network error. A retry wait does not block other runs: the job is rescheduled and the worker is freed while it waits.
Boolean
Whether automatic retry is enabled. Default: true
Number
Maximum number of retry attempts (0-10). Default: 1. These are retries after the first call, so N attempts means up to N+1 calls to your endpoint, and each call uses credits (the default of 1 means up to 2 calls). 0 is only valid when retry is disabled; with retry enabled the minimum is 1.
Number
Initial delay in milliseconds before the first retry. Default: 1000 (1 second)
Enum
Strategy for increasing delay between retry attempts:
  • exponential - Delay doubles with each attempt (recommended)
  • linear - Delay increases linearly
  • fixed - Constant delay between attempts
Default: exponentialThe delay is always capped at Max Delay. With a small Max Delay, exponential and linear growth are clamped to that ceiling after the first retry, so the strategy has little effect. Raise Max Delay to let the delay grow.
Number
Maximum delay between retry attempts, in milliseconds. Default: 3000 (3 seconds). Capped at 60000 (60 seconds); values above this are rejected at the API.
Array of Numbers
HTTP status codes that should trigger a retry. Default: [429, 500, 502, 503, 504]. Each value must be a valid HTTP status code (100-599).Codes are honored literally with no client-error short-circuit. Adding a deterministic 4xx code (such as 401, 403, or 422) makes Galtea retry a call that will always fail, which wastes the full retry budget and the credits for each attempt.

Structured Input Template Syntax

Deep dive into {{ input.field_name }} and {{ context.field_name }} placeholder syntax, JSON escaping, and missing field behavior.

Endpoint Connection Overview

What endpoint connections are and how to create one.

Input Schema

Define structured, multi-field inputs for test case generation.

Direct Inferences Tutorial

Run evaluations from the dashboard using your endpoint connection.