Service Extensions

更新时间:
复制 MD 格式

ALB service extensions inject custom logic into request forwarding through built-in components. Add authentication, content rewriting, and AI context awareness at key processing stages without modifying application code or deploying extra proxies.

Use cases:

  • Authenticate requests to AI service endpoints using API keys or JWTs

  • Control token consumption for AI workloads with per-user or per-account rate limiting

  • Add custom processing logic to request and response flows

Note

Service extensions require ALB Extensible Edition, currently in public preview. For more information, see Public preview of ALB Extensible Edition.

Supported components

A service extension contains one or more components, up to 5, each adding specific functionality to the request processing pipeline. Duplicate components are not allowed.

Traffic management

Component

Description

Token rate limiting

Enforces token-level rate limits for AI applications. Parses OpenAI-compatible request and response payloads, extracts token usage, and counts tokens with a sliding window algorithm. Supports per-user and per-account rate limiting.

Authentication

Component

Description

API key authentication

Authenticates and authorizes inbound requests using API keys parsed from HTTP headers, URL parameters, or cookies, validating their legitimacy and access permissions. Low overhead, suitable for non-sensitive operations. Less secure than JWT authentication — strict credential management is required.

JWT authentication

Authenticates and authorizes inbound requests using JWTs parsed from HTTP headers, URL parameters, or cookies. Verifies signatures with HMAC, RSA, or ECDSA algorithms and checks access permissions. More secure than API key authentication.

Configure service extensions

Create a service extension with components, then associate it with an ALB forwarding rule.

Console

  1. Create a service extension

    1. Go to the ALB console - Service Extensions page, select the region of the target ALB instance, and click Create Service Extension.

    2. Enter an Extension name, select an Extension Type and a Component name, and configure the component parameters.

    3. (Optional) To add more components, click Add Extension Component in the lower-left corner of the component card.

    4. Click Create.

  2. Associate a forwarding rule

    1. In the ALB console, click the ID of the target instance.

    2. Click the Listener tab. In the Actions column of the target listener, click View/Modify Forwarding Rule.

    3. Click Add New Rule or edit an existing rule. In the Service Extension section, select the target service extension.

    4. Confirm and click OK.

    Note

    Each forwarding rule can be associated with only one service extension.

Manage service extensions

Edit or delete service extensions on the Service Extensions page. To delete a service extension associated with a forwarding rule, first disassociate it by editing or deleting the rule.

Billing

During public preview, ALB Extensible Edition instances and service extensions are free. Internet data transfer fees follow standard Alibaba Cloud Internet data transfer pricing. After public preview ends, official pricing applies.

Quotas

To request a quota increase, contact your account manager.

Quota name

Description

Default value

alb_quota_service_extensions_num

Service extensions per region

50

alb_quota_service_extension_attached_num

Associated resources per service extension

200

alb_quota_service_extension_components_num

Components per service extension

5

References