Endpoints
POST /api/agent
Send a message to the AI wealth intelligence agent
POST
/
api
/
agent
POST /api/agent
curl --request POST \
--url https://api.inwealth.fr/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"session_id": "<string>",
"residence": "<string>",
"language": "<string>",
"extended_thinking": true,
"effort": "<string>"
}
'import requests
url = "https://api.inwealth.fr/api/agent"
payload = {
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"session_id": "<string>",
"residence": "<string>",
"language": "<string>",
"extended_thinking": True,
"effort": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: '<string>', content: '<string>'}],
session_id: '<string>',
residence: '<string>',
language: '<string>',
extended_thinking: true,
effort: '<string>'
})
};
fetch('https://api.inwealth.fr/api/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.inwealth.fr/api/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'session_id' => '<string>',
'residence' => '<string>',
'language' => '<string>',
'extended_thinking' => true,
'effort' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.inwealth.fr/api/agent"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.inwealth.fr/api/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.inwealth.fr/api/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAgent
Send a conversation to the iNwealth AI agent and receive a streaming response.Request
object[]
required
string
required
Unique session identifier (client-side). Reuse the same ID for a conversation to benefit from Anthropic’s prompt caching.
string
default:"fr"
Country code for the end-user’s tax residence. The agent adapts its answers to local legislation.Supported:
fr, ch, it, be, lu, de, es, pt, gb, mc, gr, ad, nl, us, mu, ma, intlstring
default:"fr"
Response language. Supported:
fr, en, de, es, it, ptboolean
default:false
Enable Claude’s native extended thinking mode. The agent reasons explicitly before answering — recommended for complex or cross-border questions.
string
Analysis depth. Controls how deeply the agent analyzes the question.Values:
low, medium, high, max, or null (auto — the agent decides based on complexity).Example request
curl -X POST https://api.inwealth.fr/api/agent \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_your_key_here" \
-d '{
"messages": [
{"role": "user", "content": "Compare taxation of stock options in France vs Switzerland"}
],
"session_id": "session-001",
"residence": "fr",
"language": "en",
"extended_thinking": true,
"effort": "high"
}'
Response
The response is a streaming SSE (text/event-stream) with five event types:
| Event | Description |
|---|---|
delta | Text fragment (content or thinking) — append to your display |
metadata | Metadata about the response (sources, markers) |
done | End of stream with final message |
error | Error during streaming (rate limit, internal error) |
clarification | Clarifying questions before answering — collect user input (V170) |
event: delta
data: {"type": "delta", "delta": {"content": "Stock options are taxed differently "}}
event: delta
data: {"type": "delta", "delta": {"content": "in France and Switzerland..."}}
event: metadata
data: {"type": "metadata", "data": {"markers": [...]}}
event: done
data: {"type": "done", "final_message": {"role": "assistant", "content": "..."}}
extended_thinking is enabled, delta events can also contain thinking data:
event: delta
data: {"type": "delta", "delta": {"thinking": "Analyzing cross-border implications...", "phase": "RECHERCHE", "step": "Exit tax treaty provisions"}}
Error responses
| Status | Meaning |
|---|---|
200 | OK — SSE stream |
401 | Invalid or revoked API key |
400 | Invalid parameters (e.g. bad effort value) |
422 | Missing required fields |
429 | Daily token quota exceeded |
⌘I
POST /api/agent
curl --request POST \
--url https://api.inwealth.fr/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"session_id": "<string>",
"residence": "<string>",
"language": "<string>",
"extended_thinking": true,
"effort": "<string>"
}
'import requests
url = "https://api.inwealth.fr/api/agent"
payload = {
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"session_id": "<string>",
"residence": "<string>",
"language": "<string>",
"extended_thinking": True,
"effort": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: '<string>', content: '<string>'}],
session_id: '<string>',
residence: '<string>',
language: '<string>',
extended_thinking: true,
effort: '<string>'
})
};
fetch('https://api.inwealth.fr/api/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.inwealth.fr/api/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'session_id' => '<string>',
'residence' => '<string>',
'language' => '<string>',
'extended_thinking' => true,
'effort' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.inwealth.fr/api/agent"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.inwealth.fr/api/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.inwealth.fr/api/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"session_id\": \"<string>\",\n \"residence\": \"<string>\",\n \"language\": \"<string>\",\n \"extended_thinking\": true,\n \"effort\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body
