Create a dynamic route
create_dynamic_routeCreates a route draft. Omit graph to seed a complete default graph, then use data.draft.graph as a starting point. Empty graphs are invalid. Omit deploy or set deploy=false to keep the route unpublished; deploy=true changes live routing immediately. Review data.draft.validation, save changes with update_dynamic_route_draft, then use simulate_dynamic_route without version_number to test the draft before deploy_dynamic_route. Optional display_name is a human label separate from the route identifier; it preserves case and spaces. Invoke a deployed route with model=dynamic/; invocation_model contains the exact string. Requires the dynamic_routes:write scope.
Graph format: an object with an elements array. Each element has a unique id, a type, optional properties, and outputs, an object mapping output names to {"elementId":"target-node-id"}. Include id: START, type: start and id: END, type: end; input and output are not node types. A minimal deployable graph (replace the model with an available catalog ID permitted by your policy):
{"elements":[{"id":"START","type":"start","outputs":{"next":{"elementId":"primary"}}},{"id":"primary","type":"model","properties":{"model":"cerebras/gpt-oss-120b"},"outputs":{"success":{"elementId":"END"},"fallback":{"elementId":"END"}}},{"id":"END","type":"end","outputs":{}}]}Supported node types and properties:
start: the START node;outputs.nextselects the first node.end: the END node;outputsis{}.model:properties.modelis a catalog model ID.outputs.successtargets END or an observe node;outputs.fallbacktargets another model, pool, or END.pool:properties.modelscontains 2-10{model,metrics}candidates;properties.expressionis a numeric CEL expression such asmodel.cost, sorted ascending. Uses the same success/fallback outputs as model.conditional:properties.casescontains{id,expression}entries; each expression is a CEL predicate overmetadata,auth, andinput. Connect an output for each case ID and adefaultoutput. The first true case wins.percentage:properties.bucketscontains at least two{id,weight}entries with positive integer weights totaling 100. Connect an output for each bucket ID.classifier:properties.casescontains 2-10{id,label,instructions}entries with unique labels, plus optionalcontextandmodelproperties. Connect an output per case ID; no default output. Classification failures fail the route.observe:properties.criteriadefines an asynchronous evaluation, with optionalscore_type(scoreorbinary),model,threshold, andsample_rate(both greater than 0 and at most 1). Place after model/pool success or another observe node;outputs.nextleads to another observe node or END.
Graphs must be acyclic. Every node except END accepts at most one incoming edge; use separate model nodes on separate branches. Deployment requires each path from START to reach a model or pool before END. The route name is the model identifier on chat completions, responses, messages and native calls.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "create_dynamic_route"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Route name; callers invoke the route as dynamic/<name>. Lowercase letters and digits plus '.' '_' '-'; up to 128 characters; unique per organization. | |
| note | No | Release note recorded on the deployed version. Only read when deploy is true. | |
| graph | No | Routing graph object with elements. Each node has id, type, outputs mapping output names to {elementId: targetID}, and optional properties. Include START/start and END/end. Supported types: start, end, model, pool, conditional, percentage, classifier, observe. Omit graph on create to seed a default; copy its returned draft.graph to customize. See tool description for node properties and topology. | |
| deploy | No | When true the draft is validated and deployed as version 1 in the same call; the response then carries deployed_version in meta. | |
| layout | No | Editor canvas positions keyed by element id. Opaque to the gateway; omit when authoring from code. | |
| description | No | Free-text description shown in the platform. | |
| display_name | No | Optional human label; preserves case and spaces. Empty uses the route identifier. Editable without deploying. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| meta | No |