curl --request PUT \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/draft"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123
},
"latest_version_number": 123
},
"meta": {
"issues": [
{
"code": "<string>",
"message": "<string>",
"severity": "<string>",
"field": "<string>",
"node_id": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Replace the draft
Saves draft changes without deploying. Omitted description, graph and layout are preserved; an empty description clears it. Supply the complete graph to replace it. Structural errors reject the save; inspect meta.issues and data.draft.validation for remaining issues before deployment. Use simulate_dynamic_route without version_number to test the saved draft; deploy_dynamic_route performs full deployment validation. 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.
curl --request PUT \
--url https://api.opper.ai/management/v1/dynamic-routes/{name}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.opper.ai/management/v1/dynamic-routes/{name}/draft"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.opper.ai/management/v1/dynamic-routes/{name}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"draft": {
"graph": {},
"layout": {},
"revision": 123,
"validation": "<array>"
},
"route": {
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"draft_revision": 123,
"invocation_model": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted_at": "2023-11-07T05:31:56Z",
"draft_graph": {},
"draft_layout": {},
"draft_validation": "<array>"
},
"version_count": 123,
"active_version": {
"created_at": "2023-11-07T05:31:56Z",
"note": "<string>",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_number": 123
},
"latest_version_number": 123
},
"meta": {
"issues": [
{
"code": "<string>",
"message": "<string>",
"severity": "<string>",
"field": "<string>",
"node_id": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
Management API authentication. Pass an op-mak-… management token as a Bearer token. Runtime op-… API keys are rejected with 403 — they belong on the data-plane endpoints. Mint a management key from the platform UI under Settings → API keys.
Path Parameters
Route name
Body
New description. Omit to leave it unchanged.
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.
Show child attributes
Show child attributes
{
"elements": [
{
"id": "START",
"outputs": { "next": { "elementId": "model_default" } },
"type": "start"
},
{
"id": "model_default",
"outputs": {
"fallback": { "elementId": "END" },
"success": { "elementId": "END" }
},
"properties": {
"label": "Default model",
"model": "cerebras/gpt-oss-120b"
},
"type": "model"
},
{ "id": "END", "outputs": {}, "type": "end" }
]
}
Editor canvas positions keyed by element id. Opaque to the gateway.