Traffic Policy Unit (TPU) Pricing
Traffic Processing Units (TPUs) are ngrok's usage-based unit for measuring how much processing your traffic policies perform. Instead of charging per request or connection, ngrok charges based on the combined cost of the actions, variables, and macros you use.
TPUs are sold in bundles of 100,000
for $1, and are deducted as your policies run.
TPU pricing breakdown
- Actions: Define what happens when a traffic policy rule matches (such as adding headers, denying a request, or forwarding traffic).
- Expressions: Conditions (written in ) that determine whether actions execute, based on request or connection properties.
- Variables: Metadata about connections or requests that you can use in expressions or actions (e.g. client IP, headers).
Variables
Actions
Name | TPU Cost |
---|---|
add-headers | Free |
basic-auth | Free |
circuit-breaker | 10 TPU |
compress-response | 10 TPU |
custom-response | Free |
deny | Free |
forward-internal | Free |
forward-external | 10 TPU |
http-request | 1 TPU |
jwt-validation | 10 TPU |
log | Free |
oauth | Free |
oidc | Free |
owasp-crs-request | 10 TPU |
owasp-crs-response | 10 TPU |
rate-limit | 1 TPU |
redirect | 10 TPU |
remove-headers | 1 TPU |
restrict-ips | 10 TPU |
saml | Free |
set-vars | Free |
terminate-tls | 100 TPU |
url-rewrite | 10 TPU |
verify-webhook | 1 TPU |
Macros
| Name | TPU Cost | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------- | | b64.decode(string) | 3 TPU per GB after 1 GB | | b64.encode(string) | 3 TPU per GB after 1 GB | | basic_auth.encode(username, password) | Free | | http.header(name) | Free | | http.header(name, default) | Free | | http.param(name) | Free | | http.param(name, default) | Free | | http.path() | Free | | http.path_segment(index) | Free | | http.path_segment(index, default) | Free | | http.query() | Free | | http.query_param(name) | Free | | http.query_param(name, default) | Free | | http.remote_addr() | Free | | http.request_body() | Free | | http.request_body_json() | Free | | http.request_body_query() | Free | | http.request_method() | Free | | http.request_uri() | Free | | http.response_body() | Free | | http.response_body_json() | Free | | http.response_body_query() | Free | | http.scheme() | Free | | http.status() | Free | | http.status_text() | Free | | http.user_agent() | Free | | inCidrRange(ip, cidr) | Free | | inCidrRanges(ip, cidrs) | Free | | json.decode(string) | 3 TPU per GB after 1 GB | | json.encode(list | map) | 3 TPU per GB after 1 GB | | list.encodeJson() | Free | | object.encodeJson() | Free | | object.encodeQueryString() | Free | | queryString.decode(string) | Free | | queryString.encode(map) | Free | | rand.double() | Free | | rand.int(min, max) | Free | | security.secret(string, string) | Free | | string.decodeBase64() | Free | | string.decodeJson() | Free | | string.decodeQueryString() | Free | | string.encodeBase64() | Free | | string.escapeUrl() | Free | | string.isJson() | Free | | string.isQueryString() | Free | | string.isURL() | Free | | string.parseUrl() | Free | | string.unescapeUrl() | Free | | url.escape(string) | Free | | url.parse(string) | Free | | url.unescape(string) | Free | | utility.base64_decode(string) | Free | | utility.base64_encode(string) | Free | | utility.basic_auth_encode(username, password) | Free | | utility.in_cidr_range(ip, cidr) | Free | | utility.in_cidr_ranges(ip, cidrs) | Free | | utility.json_decode(string) | Free | | utility.json_encode(list | map) | Free | | utility.list_encode_json() | Free | | utility.object_encode_json() | Free | | utility.object_encode_query_string() | Free | | utility.query_string_decode(string) | Free | | utility.query_string_encode(map) | Free | | utility.rand_double() | Free | | utility.rand_int(min, max) | Free | | utility.string_decode_base64() | Free | | utility.string_decode_json() | Free | | utility.string_decode_query_string() | Free | | utility.string_encode_base64() | Free | | utility.string_escape_url() | Free | | utility.string_is_json() | Free | | utility.string_is_query_string() | Free | | utility.string_is_url() | Free | | utility.string_parse_url() | Free | | utility.string_unescape_url() | Free | | utility.url_escape(string) | Free | | utility.url_parse(string) | Free | | utility.url_unescape(string) | Free |
Traffic Policy Unit (TPU) discounts at scale
The pay-as-you-go plan discounts TPUs at a large scale, so you don't have to talk to sales to get the best price as you grow. Discounted pricing is as follows:
Count | TPU Cost |
---|---|
0+ | $1/100k |
1M+ | $.75/100k |
10M+ | $.55/100k |
100M+ | $0.35/100k |
1B+ | $0.25/100k |