reasoning mode, switching prompt structure, or passing provider-specific parameters.
Enable advanced mode
1
Open Custom API Settings
In the Coreply app, scroll to the Custom API Settings section.
2
Select Advanced
Tap the Advanced radio button at the top of the section. The individual simple-mode fields are replaced by a Request Body text area and a Suggestion Content field.
3
Edit the request body and URL
Modify the JSON template in the Request Body field. Coreply fills in the Mustache variables at request time before sending the payload to the API. The URL should be set to the full URL instead of the base URL in simple mode.
String values are mapped (what a string map is)
All string fields are exposed as a map with four variants so you can embed them safely in JSON. It will be referred as “string map” in this guide. The available variants are:
In JSON templates, use .jsonEscaped so that special characters in the conversation don’t break the JSON structure.
Top-level fields
String map fields are
null / falsy when empty, so {{#currentTyping}}…{{/currentTyping}} can be used to conditionally render content only when the user is typing something.
The pastMessages list
{{#pastMessages}}…{{/pastMessages}} iterates over the conversation history as a list of turns (oldest first). Each turn represents one or more consecutive messages sent by the same role (either all sent by the user, or all received from the other party).
List items of pastMessages:
The
messageslist within a pastMessages turn:
Use {{#messages}}…{{/messages}} to iterate over individual messages in the current turn:
Example
Per-app system prompt using package name booleans
Note: package name dots are replaced with underscores, socom.whatsappbecomescom_whatsapp.
Prefill the user’s current typing as the start of the assistant turn
Note: Some models are bad at continuing from partial words, so currentTypingTrimmed comes in handy here to prefill only the last complete token, allowing the model to generate the full last word. You can hint the last word somewhere else in the prompt.
2. Suggestion Content Template
Found in the Advanced config section below the Request Body field. After the model responds, this Mustache template is rendered to form the final suggestion text shown to the user. This exists because some API setups use assistant prefill — you send the user’s current typing as the start of the assistant’s response, and the model returns only the continuation. The template lets you join them back together. The same context fields from the request body are available, plus two extras:
Unlike
currentTyping and other string map fields, assistantMessage and assistantMessageAutoTrimCurrentTyping are already plain strings so no variant suffix is needed.
After rendering, any two consecutive spaces is collapsed to one, handling the case where currentTyping ends with a space and the model response also starts with one (or vice versa).
Show response as-is
Prepend the user’s current typing (usually with assistant prefill)
If your request body sendscurrentTyping as the start of the assistant turn (the model only returns the continuation):
"sounds good, I'll be" and the model returns " there at 7". The suggestion becomes "sounds good, I'll be there at 7".
Add a suffix
Not sure who would need this, you can also add a suffix like this:When to use advanced mode
Advanced mode is the right choice when you need to:- Use non-standard model parameters that your provider supports but that simple mode doesn’t expose.
- Restructure the prompt entirely
