Route management

更新时间:
复制 MD 格式

Agent API supports custom routes for fine-grained routing based on request features.

Create a route

  1. Log on to the AI Gateway console and select the region where your instance is located.

  2. Go to the instance details page. In the navigation pane on the left, choose Agent API.

  3. Click Create Route. In the Create Route panel, configure the following settings:

    • Route Name: Enter a name for the route.

    • Path: Specify the path to match in the HTTP request.

      • If multiple routes use the same match type, the route with the longer path has higher priority.

      • If routes have different match types, the priority order is Equals To > Prefix > Regular Expression Match.

        • Equals To: The path must be an exact match. For example, /user.

        •  Prefix: The path must start with the specified prefix. For example, /user.

        • Regular Expression Match: The path must match the specified regular expression.

    • More Match Rules: To create multiple routes with the same path, configure Method, Header, and Query Parameters to differentiate them.

    • Services: By default, the list does not display services whose names start with "consumers".

Edit a route

  1. Log on to the AI Gateway console and select the region where your instance is located.

  2. Go to the instance details page. In the navigation pane on the left, choose Agent API.

  3. On the route list page, find the target route and click Edit Route on the right. Modify the Basic Information and Backend Services settings. Click OK.

Publish a route

  1. Log on to the AI Gateway console and select the region where your instance is located.

  2. Go to the instance details page. In the navigation pane on the left, choose Agent API.

  3. On the route list page, find the target route and click Publish Route on the right. In the confirmation dialog box, click OK.

Unpublish a route

  1. Log on to the AI Gateway console and select the region where your instance is located.

  2. Go to the instance details page. In the navigation pane on the left, choose Agent API.

  3. On the route list page, find the target route, click the image icon, and then click Shutdown. In the Confirm unpublish dialog box, click Shutdown.

Delete a route

Note

You can only delete unpublished routes.

  1. Log on to the AI Gateway console and select the region where your instance is located.

  2. Go to the instance details page. In the navigation pane on the left, choose Agent API.

  3. On the route list page, find the target route, click the image icon, and then click Delete. In the confirmation dialog box, click Delete.