Starter patterns for real integrations.
These examples show practical routing patterns and link directly to the public simulator so developers can see the routing decision for each prompt.
Try example prompts in the simulator
Each link opens the simulator with the prompt pre-filled and routed automatically.
What is the capital of France?
Routes to a low-cost quick-answer model because the request is factual and low risk.
Open this prompt in the simulator
TranslationTranslate "how are you today" into Arabic
Routes to a low-cost language-capable model rather than a premium reasoning model.
Open this prompt in the simulator
Code and data taskWrite a Python script to parse CSV files and produce a chart
Routes to a balanced code/data-capable model with enough capability for implementation work.
Open this prompt in the simulator
Legal-sensitive analysisAnalyse the legal implications of this contract clause and advise on risk
Escalates because legal, risk and compliance signals require a stronger model and governance trail.
Open this prompt in the simulator
Agentic workflowDesign an agentic workflow that researches competitors, compares pricing, and drafts an outreach email using tool calls.
Detects an agentic workflow and routes to a reasoning-capable model suitable for planning and tool use.
Open this prompt in the simulator
Counterfactual reasoningIn a universe where the speed of light is exactly 1 metre per second and Planck's constant is tripled, compose a formal academic paper whose abstract, introduction, conclusion, and summary sections each begin with a word whose first letter, in order, spells 'GLASS'. Explore how these altered physical constants affect atomic orbital distances and chemical bond formation, deriving the physics from first principles within those constraints.
Escalates to deep reasoning because the prompt combines counterfactual physics, constraints and structured output.
Open this prompt in the simulator
Implementation patterns
A minimal command-line request to confirm authentication and routing.
Node / TypeScriptServer-side integration using an OpenAI-compatible client and a ModelSpend base URL.
Python serviceBackend service pattern for routed chat completions and structured error handling.
Serverless proxySafe browser-to-backend-to-ModelSpend flow that keeps API keys private.
MCP workflowAgentic workflow pattern for tool-using systems with cost and audit controls.
Policy simulationPattern for testing policy impact before applying stricter production controls.
Public GitHub examples
When examples are published, they should live in a separate public examples repository rather than the private production repository.
modelspend-examples. Include only minimal working examples, README files and placeholder environment values.