Skip to main content
The endpoint must still return the final assistant text in choices[0].message.content.
Advanced mode lets you edit the full request body that Coreply sends. Use it when the built-in provider forms are not enough.

Enable advanced mode

1

Choose Advanced Mode

In Coreply, open API Provider and choose Advanced Mode.
2

Fill in the endpoint

Enter the full Request URL. If the endpoint uses bearer auth, fill in Authorization Bearer.
3

Edit the templates

Update the Body Template and Suggestion Template fields.
The body template uses Mustache. Coreply supplies the following context to the template and the resulting string is the request body.

Current context format

Templates should start from contexts. It contains the structured contexts that Coreply has collected for the current request. Strings inside contexts are plain strings. If you need JSON-safe interpolation inside a string value, use the compatibility fields below or send contexts as structured JSON.

Context objects

Each item in contexts has these top-level fields:

Chat contexts

When type is chat, data has this shape: Each item in data.turns: Each item in messages:

Screen contexts

When type is screen, data is a text tree:

Suggestion template

After the API call completes, Coreply reads choices[0].message.content from the JSON response and exposes it to the suggestion template.

Show the response as-is

Prepend the user’s current typing

Compatibility fields

Coreply still exposes the older TypingInfo.contextMap fields for compatibility. Use them when you want to build a plain chat prompt inside the JSON body. They only cover chat history and typing helpers. They do not include screen contexts.

String map fields

Compatibility string fields are exposed as a string map with four variants: In JSON string values, use .jsonEscaped.

Compatibility top-level fields

pastMessages does not include screen contexts. Use contexts if you need them.

The pastMessages list

{{#pastMessages}}...{{/pastMessages}} iterates over chat turns from oldest to newest. Each item in messages:

Compatibility example

Compatibility example with assistant prefill

Enable Show errors under Configuration while you are debugging templates.