Examples
Practical examples to help you integrate the iNwealth API into your application.Simple question
A single-turn question about French legislation:Multi-turn conversation
The API is stateless — send the full conversation history each time. Reuse the samesession_id to benefit from prompt caching.
In the
assistant message, include the full text that the agent returned (all concatenated delta.content values). Do not include metadata or thinking data.Cross-border scenario
For complex cross-border questions, enableextended_thinking and use a higher effort level:
Multilingual support
The agent responds in the requestedlanguage, regardless of the user’s question language or residence:
Token-optimized integration
Best practices to minimize token consumption in production:- Reuse
session_id— keep the same ID across turns in a conversation. Prompt caching can reduce token costs by up to 90%. - Set
effortexplicitly — use"low"or"medium"for straightforward questions. Reserve"high"and"max"for complex scenarios. - Trim long histories — for conversations beyond 10 turns, consider sending only the last 4-6 turns to keep input tokens low.
- Use
extended_thinkingselectively — only for questions involving multiple jurisdictions or complex wealth planning.

