Portkey
and instantiate it using the Portkey API Key
portkey
instance with apiKey
and virtualKey
parameters. You can find the arguments for both of them in your Portkey Dashboard.
Visit the reference to obtain the Portkey API key and learn how to create Virtual Keys.
retry
object with attempts
and on_status_codes
keys. The value of attempts
can be bumped up to 5
times to retry automatically, while on_status_codes
is an optional key. By default, Portkey will attempt to retry on the status codes [429, 500, 502, 503, 504]
.
Refer to the 101 on Gateway Configs and Automatic Retries.
See the full code