curl 'https://api.inworld.ai/v1/chat/completions' \
-H "Authorization: Basic $INWORLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "inworld/user-aware",
"messages": [{"role": "user", "content": "Hola, necesito ayuda"}],
"extra_body": {
"metadata": {
"language": "es",
"country": "MX",
"plan": "free"
}
}
}'
curl 'https://api.inworld.ai/router/v1/routers' \
-H "Authorization: Basic $INWORLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"displayName": "User-Aware",
"routes": [
{
"condition": {
"cel_expression": "language == \"es\""
},
"route": {
"variants": [
{ "variant": { "modelId": "openai/gpt-5.2" }, "weight": 100 }
]
}
},
{
"condition": {
"cel_expression": "plan == \"free\""
},
"route": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-haiku-4-5" }, "weight": 100 }
]
}
}
],
"defaultRoute": {
"variants": [
{ "variant": { "modelId": "anthropic/claude-sonnet-4-6" }, "weight": 100 }
]
}
}'