A user requests a bedtime story
{
"service": "house-of-adventure",
"user": {
"id": "user_849x2k",
"age": 7,
"name": "Mia"
},
"request": {
"type": "story_generation",
"prompt": "Generate a story for a 7-year-old about space explorers who find a friendly alien",
"maxTokens": 500
}
}
Kaitiaki guardian validates against Five Yamas
Cost-optimization algorithm selects provider layers
Fastest available provider from Layer 1
Gateway transforms and routes to provider
{
"model": "claude-3-sonnet-20240229",
"max_tokens": 500,
"temperature": 0.9,
"system": "You are a creative storyteller for children. Generate age-appropriate, imaginative stories that spark wonder and curiosity.",
"messages": [
{
"role": "user",
"content": "Generate a story for a 7-year-old about space explorers who find a friendly alien"
}
],
"metadata": {
"user_id": "user_849x2k",
"gateway_session": "tgw_20260209_1524_xyz",
"constitutional_scores": {
"brahmacharya": 0.97,
"ahimsa": 0.95
}
}
}
Story generated and validated
Captain Zara and her crew were exploring the purple planet Nebula-7 when they spotted something glowing behind a crystal rock. "Hello?" called Zara. Out popped a small alien with six friendly eyes and a smile that sparkled like stardust. "I'm Bloop!" the alien chirped. "Want to see my collection of singing stones?" The crew spent the afternoon learning alien songs, sharing space cookies, and making a new friend among the stars...
Scrooge optimization in action
Every routing decision is constitutionally constrained
Constitutional routing isn't a cost — it's a profit center
Route to the biggest model. Hope it works. Pay premium for everything. No safety layer. Governance is an afterthought.
Constitutional filtering FIRST. Then smart routing. The safety layer IS the cost optimization layer. Blocking bad requests = saving compute.
Anthropic = Compute. Axiom = Trust + Savings.
Taniwha Gateway proves that governance and cost optimization are the SAME thing. Constitutional routing saves 175× on costs while ensuring every response is safe, auditable, and provenance-tracked.
Deploy Gateway →