Read more
429 Too Many Requests
.Nadles API Gateway performs the following steps in order to check metrics limits and record the usage:x-consumed-cpu-seconds
.The expression in this case can be:x-consumed-cpu-seconds
header as usage for the current request.GET /prompt/{LLM_MODEL}
allows sending textual prompts to two different AI models: gpt3
and gpt4
.The API provider would like calls to gpt4
to consume 2 quota units and calls to gpt3
to consume 1 quota unit.To achieve that, the expression should evaluate to 2
if the path parameter LLM_MODEL
equals to gpt4
, 1
otherwise.E.g.:LLM_MODEL
equals gpt4
, and 1 unit otherwise.POST /process
accepts a JSON array of elements to process
and the request body looks like:Quota usage condition
expression will be:200 OK
.path.params.*
— placeholder values specified in the endpoint URL.
/resource/{resourceId}
and the HTTP request URL is /resource/801d49c2-ca05-42b1-97af-baf0ddf36ba3
,then there will be a variable path.params.resourceId
with value "801d49c2-ca05-42b1-97af-baf0ddf36ba3"
.request.remote_addr
— Client IP address.
request.headers['header-name']
— Request header values.
request.query['query_string_parameter_name']
— Request query string parameters.
request.body
— Request body.
response.statusCode
— HTTP status code of the response from the upstream.
response.headers['header-name']
— Response header values.
response.body
— Raw response body.