curl --request GET \
--url https://api.ngrok.ai/gateway-config \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngrok.ai/gateway-config"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ngrok.ai/gateway-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.ai/gateway-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.ai/gateway-config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngrok.ai/gateway-config")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.ai/gateway-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "<string>",
"uri": "<string>",
"totalTimeout": "<string>",
"perRequestTimeout": "<string>",
"maxInputTokens": 123,
"maxOutputTokens": 123,
"metadata": "<string>"
}{
"statusCode": 123,
"msg": "<string>",
"details": {},
"errorCode": "<string>"
}Get AI Gateway configuration
Get the AI Gateway configuration for the authenticated account.
curl --request GET \
--url https://api.ngrok.ai/gateway-config \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ngrok.ai/gateway-config"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ngrok.ai/gateway-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.ai/gateway-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.ai/gateway-config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngrok.ai/gateway-config")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.ai/gateway-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "<string>",
"uri": "<string>",
"totalTimeout": "<string>",
"perRequestTimeout": "<string>",
"maxInputTokens": 123,
"maxOutputTokens": 123,
"metadata": "<string>"
}{
"statusCode": 123,
"msg": "<string>",
"details": {},
"errorCode": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The AI Gateway configuration.
Unique identifier of the account this configuration belongs to.
URI of this AI Gateway Configuration API resource.
Total timeout duration for a request through the AI Gateway (Go duration string, e.g. 30s, 1m). Defaults to 2m. For a streaming response, the default bounds the stream only until its first byte, after which the stream can run for up to 15 minutes. A value you set applies to the whole stream.
Per-request timeout duration for individual upstream requests (Go duration string, e.g. 30s, 1m). Defaults to 1m. Must be less than or equal to totalTimeout, checked against the configuration as it will be after the update.
Maximum number of input tokens allowed per request. Must be greater than zero.
PATCH: omit to preserve, send null to clear the cap (no
limit), or send a number to set it. Accounts that have not
written a value read back the per-account default; once
cleared with null, GET returns null until a new value is
written.
Maximum number of output tokens allowed per request. Must be greater than zero.
PATCH: omit to preserve, send null to clear the cap (no
limit), or send a number to set it. Accounts that have not
written a value read back the per-account default; once
cleared with null, GET returns null until a new value is
written.
Arbitrary user-defined metadata for the AI Gateway configuration.
PATCH: omit to preserve, send null to clear, or send a string
to set it. GET returns null when no value is stored.
4096Was this page helpful?