Routes
A route publishes an HTTP or WebSocket API of your own through DIAL Core. Core matches a request's path and method to the route, authenticates and authorizes the caller, and proxies the request to the route's upstreams with load balancing. Clients such as DIAL Chat can then call the API with their DIAL credentials. This reference is for platform engineers who expose custom APIs; it assumes you know how DIAL Core is configured.
For when to use a route instead of an application or a toolset, see Custom APIs through routes.
Where routes are defined
| Source | Location |
|---|---|
| Config file | routes.<name>, for global routes |
| Configuration API | /v1/routes/platform/<name> |
| An application | applications.<name>.routes, see Application routes |
Routes are matched by their paths, not their names, so a file route and a blob route with the same name both stay in force. DIAL Admin manages routes in Routes.
Fields
| Field | Description |
|---|---|
paths | The paths matched against the request path. A path can be a plain string or a regular expression. If any path matches, the route handles the request. |
methods | The HTTP methods the route accepts: GET, POST, PUT, DELETE, HEAD, or PATCH. |
rewritePath | When true, the upstream path is replaced with the path of the original request. |
userRoles | The roles, from identity provider claims or API keys, that may call the route. When unset, every user may call it. |
order | The priority among global routes; a lower value wins. Cannot be negative. Default 2147483647. |
upstreams | The servers the route proxies to. See Upstreams. Set upstreams or response. |
response | A fixed response Core returns at once, with status and body. Set upstreams or response. |
maxRetryAttempts | The maximum number of attempts when an upstream answers with an error; Core tries another available upstream. See Load balancing and upstreams. |
Upstreams
| Field | Default | Description |
|---|---|---|
endpoint | — | The backend URL: http://, https://, ws://, or wss://. Routes support HTTP and WebSocket. |
key | — | The API key, token, or credential sent to the upstream. |
authType | API_KEY | How key is sent: API_KEY as API-KEY: <key>, or BEARER as Authorization: Bearer <key>, which OpenRouter requires, for example. BEARER requires key. Honored on global routes only. |
weight | 1 | The upstream's share of traffic within its tier. 0 or below takes it out of routing. |
tier | 0 | The priority group; the lowest value is used first. |
extraData | — | Additional data passed to the upstream, as JSON or a string. |
Upstream keys are encrypted at rest in the platform bucket and never returned by the Configuration API.
Example
{
"routes": {
"vector_store_query": {
"paths": ["/v1/vector_store(/[^/]+)*$"],
"rewritePath": true,
"methods": ["GET", "HEAD"],
"userRoles": ["analyst"],
"upstreams": [
{ "endpoint": "http://vector-store-1:9876" },
{ "endpoint": "http://vector-store-2:9876" }
],
"maxRetryAttempts": 2
},
"rate": {
"paths": ["/v1/rate"],
"methods": ["GET", "HEAD"],
"response": { "status": 200, "body": "OK" }
},
"openai-realtime": {
"paths": ["/openai/realtime"],
"rewritePath": true,
"upstreams": [
{
"endpoint": "wss://${AZURE_FOUNDRY_PROJECT_NAME}.cognitiveservices.azure.com/openai/realtime",
"key": "${AZURE_FOUNDRY_API_KEY}"
}
]
},
"openrouter": {
"paths": ["/v1/chat/completions"],
"rewritePath": true,
"methods": ["POST"],
"upstreams": [
{
"endpoint": "https://openrouter.ai/api/v1/chat/completions",
"key": "${OPENROUTER_API_KEY}",
"authType": "BEARER"
}
]
}
}
}
Call an application route
Core exposes an application's routes at:
<METHOD> /v1/deployments/<application>/route/<route_path>
<METHOD>is one of the route'smethods.<application>is the application's deployment ID.<route_path>is matched against the route'spaths. It must not contain the wordroute, so Core can split the deployment ID from the route path.
Further reading
- Load balancing and upstreams — how tiers, weights, and retries work
- Application routes — routes that belong to an application
- Roles — control who can call a route
- Tools and enterprise data — how Toolsets, REST APIs, routes, and RAG reach enterprise systems
- DIAL Admin: Routes — add and configure routes in DIAL Admin
- Request flow — how a request travels from DIAL Core to models, apps, and tools