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
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
Create a service extension
Go to the ALB console - Service Extensions page, select the region of the target ALB instance, and click Create Service Extension.
Enter an Extension name, select an Extension Type and a Component name, and configure the component parameters.
(Optional) To add more components, click Add Extension Component in the lower-left corner of the component card.
Click Create.
Associate a forwarding rule
In the ALB console, click the ID of the target instance.
Click the Listener tab. In the Actions column of the target listener, click View/Modify Forwarding Rule.
Click Add New Rule or edit an existing rule. In the Service Extension section, select the target service extension.
Confirm and click OK.
NoteEach 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 |
| Service extensions per region | 50 |
| Associated resources per service extension | 200 |
| Components per service extension | 5 |