Configure routes¶
The routes
section defines the endpoints that are exposed by the AI Gateway connects them a
policy.
Each route includes the following settings:
Setting |
Description |
Required |
Examples |
---|---|---|---|
|
The path that will be the entrypoint for the request. User-defined and must be unique among the routes. Trailing slashes are not allowed. |
Yes |
|
|
The |
Yes |
|
|
The input and output schema for the route.
|
No |
|
|
The number of seconds before requests to this route time out. |
No |
|
Example routes section YAML:
routes:
- path: /llama3
schema: v1/chat_completions
policy: llama3
timeoutSeconds: 60
Models API¶
If the routes schema is v1/models
models, it will serve the OpenAI v1 List Models API.
routes:
- path: /openai/v1/models
schema: v1/models
policy: demo
The policy
MUST route to a profile
which defines the list of models. See the Configure profiles topic and the Selecting service based on model example.