import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const gatewayConfigView = await client.gatewayConfigs.create({
auth_mechanism: { type: 'type' },
endpoint: 'endpoint',
name: 'name',
});
console.log(gatewayConfigView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
gateway_config_view = client.gateway_configs.create(
auth_mechanism={
"type": "type"
},
endpoint="endpoint",
name="name",
)
print(gateway_config_view.id)curl --request POST \
--url https://api.runloop.ai/v1/gateway-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"endpoint": "<string>",
"auth_mechanism": {
"type": "<string>",
"key": "<string>"
},
"description": "<string>",
"custom_headers": [
{
"name": "<string>",
"secret": "<string>",
"value": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/gateway-configs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'endpoint' => '<string>',
'auth_mechanism' => [
'type' => '<string>',
'key' => '<string>'
],
'description' => '<string>',
'custom_headers' => [
[
'name' => '<string>',
'secret' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/gateway-configs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/gateway-configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/gateway-configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"endpoint": "<string>",
"auth_mechanism": {
"type": "<string>",
"key": "<string>"
},
"create_time_ms": 123,
"account_id": "<string>",
"description": "<string>",
"custom_headers": [
{
"name": "<string>",
"secret": "<string>",
"value": "<string>"
}
]
}Create a GatewayConfig.
Create a new GatewayConfig to proxy API requests through the agent gateway. The config specifies the target endpoint and how credentials should be applied.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const gatewayConfigView = await client.gatewayConfigs.create({
auth_mechanism: { type: 'type' },
endpoint: 'endpoint',
name: 'name',
});
console.log(gatewayConfigView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
gateway_config_view = client.gateway_configs.create(
auth_mechanism={
"type": "type"
},
endpoint="endpoint",
name="name",
)
print(gateway_config_view.id)curl --request POST \
--url https://api.runloop.ai/v1/gateway-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"endpoint": "<string>",
"auth_mechanism": {
"type": "<string>",
"key": "<string>"
},
"description": "<string>",
"custom_headers": [
{
"name": "<string>",
"secret": "<string>",
"value": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/gateway-configs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'endpoint' => '<string>',
'auth_mechanism' => [
'type' => '<string>',
'key' => '<string>'
],
'description' => '<string>',
'custom_headers' => [
[
'name' => '<string>',
'secret' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/gateway-configs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/gateway-configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/gateway-configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"auth_mechanism\": {\n \"type\": \"<string>\",\n \"key\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"custom_headers\": [\n {\n \"name\": \"<string>\",\n \"secret\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"endpoint": "<string>",
"auth_mechanism": {
"type": "<string>",
"key": "<string>"
},
"create_time_ms": 123,
"account_id": "<string>",
"description": "<string>",
"custom_headers": [
{
"name": "<string>",
"secret": "<string>",
"value": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Parameters required to create a new GatewayConfig.
The human-readable name for the GatewayConfig. Must be unique within your account.
The target endpoint URL (e.g., 'https://api.anthropic.com').
How credentials should be applied to proxied requests. Specify the type ('header', 'bearer') and optional key field.
Show child attributes
Show child attributes
Optional description for this gateway configuration.
Additional headers applied to proxied requests after the auth mechanism. At most 8 entries.
Show child attributes
Show child attributes
Response
GatewayConfig created successfully.
A GatewayConfig defines a configuration for proxying API requests through the agent gateway. It specifies the target endpoint and how credentials should be applied.
The unique identifier of the GatewayConfig.
The human-readable name of the GatewayConfig. Unique per account (or globally for system configs).
The target endpoint URL (e.g., 'https://api.anthropic.com').
How credentials should be applied to proxied requests.
Show child attributes
Show child attributes
Creation time of the GatewayConfig (Unix timestamp in milliseconds).
The account ID that owns this config.
Optional description for this gateway configuration.
Additional headers applied to proxied requests after the auth mechanism. Secret-backed entries reference the secret by 'sec_' id; values are never returned.
Show child attributes
Show child attributes
Was this page helpful?
