Instantly Test Agent Configurations Using Session Overrides
Modify agent model or prompts for a single session without configuration changes.
Pass 'agent_with_overrides' during session creation to temporarily swap models, tools, or system prompts for specific tasks or tests.
The Scenario
You have a production agent configured for complex data analysis, but you want to run a quick test session using the new 'claude-sonnet-5' model to see if it handles a specific task more efficiently.
Before & after
To test a different prompt or model, you would manually clone or edit the entire agent configuration. This process could take 5–10 minutes per iteration.
Use the 'agent_with_overrides' type to swap models or system prompts for a specific session. This takes less than 1 minute to define in the API call.
The Prompt
Show me the JSON payload for 'POST /v1/sessions' where I create a session using 'type: agent_with_overrides' to replace the 'system_prompt' and 'model' for one specific interaction with [MODEL_NAME].
Instead of permanently changing an agent's definition, you can pass an override object during session creation. This is ideal for A/B testing or using a cheaper/faster model for simpler tasks without losing the agent's core setup.
Source
Claude Platform - Claude Platform Docs"Pass agent with type: "agent_with_overrides" to replace the model, system prompt, tools... for a single session. The agent itself is unchanged."
