consumers
Create a consumer
Creates a new consumer in a gateway.
POST
/
v1
/
gateways
/
{gateway_id}
/
consumers
Create a consumer
curl --request POST \
--url https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": [
"<string>"
],
"enabled": true,
"triggers": [
"<string>"
]
},
"headers": {},
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": true,
"members": [
{
"models": [
"<string>"
],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registries": [
{
"id": "<string>",
"model_policies": {
"allowed": [
"<string>"
],
"default": "<string>"
},
"weight": 1
}
],
"roles": [
"<string>"
],
"routing_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>"
}
'import requests
url = "https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers"
payload = {
"active": True,
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": ["<string>"],
"enabled": True,
"triggers": ["<string>"]
},
"headers": {},
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": True,
"members": [
{
"models": ["<string>"],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": ["<string>"],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registries": [
{
"id": "<string>",
"model_policies": {
"allowed": ["<string>"],
"default": "<string>"
},
"weight": 1
}
],
"roles": ["<string>"],
"routing_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
active: true,
fail_mode: '<string>',
fallback: {
budget: {max_attempts: 123, max_total_latency_ms: 123},
chain: ['<string>'],
enabled: true,
triggers: ['<string>']
},
headers: {},
lb_config: {
algorithm: '<string>',
embedding_config: {
auth: {
api_key: '<string>',
header_name: '<string>',
header_value: '<string>',
param_location: '<string>',
param_name: '<string>',
param_value: '<string>'
},
model: '<string>',
provider: '<string>'
},
enabled: true,
members: [{models: ['<string>'], registry_id: '<string>'}],
pool_alias: '<string>'
},
model_policies: [{allowed: ['<string>'], default: '<string>', registry_id: '<string>'}],
name: '<string>',
registries: [
{
id: '<string>',
model_policies: {allowed: ['<string>'], default: '<string>'},
weight: 1
}
],
roles: ['<string>'],
routing_mode: '<string>',
toolkit: [
{
expose_as: '<string>',
prompt: '<string>',
registry_id: '<string>',
resource: '<string>',
tool: '<string>'
}
],
type: '<string>'
})
};
fetch('https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers', 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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers",
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([
'active' => true,
'fail_mode' => '<string>',
'fallback' => [
'budget' => [
'max_attempts' => 123,
'max_total_latency_ms' => 123
],
'chain' => [
'<string>'
],
'enabled' => true,
'triggers' => [
'<string>'
]
],
'headers' => [
],
'lb_config' => [
'algorithm' => '<string>',
'embedding_config' => [
'auth' => [
'api_key' => '<string>',
'header_name' => '<string>',
'header_value' => '<string>',
'param_location' => '<string>',
'param_name' => '<string>',
'param_value' => '<string>'
],
'model' => '<string>',
'provider' => '<string>'
],
'enabled' => true,
'members' => [
[
'models' => [
'<string>'
],
'registry_id' => '<string>'
]
],
'pool_alias' => '<string>'
],
'model_policies' => [
[
'allowed' => [
'<string>'
],
'default' => '<string>',
'registry_id' => '<string>'
]
],
'name' => '<string>',
'registries' => [
[
'id' => '<string>',
'model_policies' => [
'allowed' => [
'<string>'
],
'default' => '<string>'
],
'weight' => 1
]
],
'roles' => [
'<string>'
],
'routing_mode' => '<string>',
'toolkit' => [
[
'expose_as' => '<string>',
'prompt' => '<string>',
'registry_id' => '<string>',
'resource' => '<string>',
'tool' => '<string>'
]
],
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers"
payload := strings.NewReader("{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"auth_ids": [
"<string>"
],
"created_at": "<string>",
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": [
"<string>"
],
"enabled": true,
"triggers": [
"<string>"
]
},
"gateway_id": "<string>",
"headers": {},
"id": "<string>",
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": true,
"members": [
{
"models": [
"<string>"
],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registry_ids": [
"<string>"
],
"registry_weights": [
{
"registry_id": "<string>",
"weight": 123
}
],
"role_ids": [
"<string>"
],
"routing_mode": "<string>",
"slug": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>",
"updated_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Gateway id
Body
application/json
Consumer to create
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Create a consumer
curl --request POST \
--url https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": [
"<string>"
],
"enabled": true,
"triggers": [
"<string>"
]
},
"headers": {},
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": true,
"members": [
{
"models": [
"<string>"
],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registries": [
{
"id": "<string>",
"model_policies": {
"allowed": [
"<string>"
],
"default": "<string>"
},
"weight": 1
}
],
"roles": [
"<string>"
],
"routing_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>"
}
'import requests
url = "https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers"
payload = {
"active": True,
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": ["<string>"],
"enabled": True,
"triggers": ["<string>"]
},
"headers": {},
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": True,
"members": [
{
"models": ["<string>"],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": ["<string>"],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registries": [
{
"id": "<string>",
"model_policies": {
"allowed": ["<string>"],
"default": "<string>"
},
"weight": 1
}
],
"roles": ["<string>"],
"routing_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
active: true,
fail_mode: '<string>',
fallback: {
budget: {max_attempts: 123, max_total_latency_ms: 123},
chain: ['<string>'],
enabled: true,
triggers: ['<string>']
},
headers: {},
lb_config: {
algorithm: '<string>',
embedding_config: {
auth: {
api_key: '<string>',
header_name: '<string>',
header_value: '<string>',
param_location: '<string>',
param_name: '<string>',
param_value: '<string>'
},
model: '<string>',
provider: '<string>'
},
enabled: true,
members: [{models: ['<string>'], registry_id: '<string>'}],
pool_alias: '<string>'
},
model_policies: [{allowed: ['<string>'], default: '<string>', registry_id: '<string>'}],
name: '<string>',
registries: [
{
id: '<string>',
model_policies: {allowed: ['<string>'], default: '<string>'},
weight: 1
}
],
roles: ['<string>'],
routing_mode: '<string>',
toolkit: [
{
expose_as: '<string>',
prompt: '<string>',
registry_id: '<string>',
resource: '<string>',
tool: '<string>'
}
],
type: '<string>'
})
};
fetch('https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers', 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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers",
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([
'active' => true,
'fail_mode' => '<string>',
'fallback' => [
'budget' => [
'max_attempts' => 123,
'max_total_latency_ms' => 123
],
'chain' => [
'<string>'
],
'enabled' => true,
'triggers' => [
'<string>'
]
],
'headers' => [
],
'lb_config' => [
'algorithm' => '<string>',
'embedding_config' => [
'auth' => [
'api_key' => '<string>',
'header_name' => '<string>',
'header_value' => '<string>',
'param_location' => '<string>',
'param_name' => '<string>',
'param_value' => '<string>'
],
'model' => '<string>',
'provider' => '<string>'
],
'enabled' => true,
'members' => [
[
'models' => [
'<string>'
],
'registry_id' => '<string>'
]
],
'pool_alias' => '<string>'
],
'model_policies' => [
[
'allowed' => [
'<string>'
],
'default' => '<string>',
'registry_id' => '<string>'
]
],
'name' => '<string>',
'registries' => [
[
'id' => '<string>',
'model_policies' => [
'allowed' => [
'<string>'
],
'default' => '<string>'
],
'weight' => 1
]
],
'roles' => [
'<string>'
],
'routing_mode' => '<string>',
'toolkit' => [
[
'expose_as' => '<string>',
'prompt' => '<string>',
'registry_id' => '<string>',
'resource' => '<string>',
'tool' => '<string>'
]
],
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers"
payload := strings.NewReader("{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/consumers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"fail_mode\": \"<string>\",\n \"fallback\": {\n \"budget\": {\n \"max_attempts\": 123,\n \"max_total_latency_ms\": 123\n },\n \"chain\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"triggers\": [\n \"<string>\"\n ]\n },\n \"headers\": {},\n \"lb_config\": {\n \"algorithm\": \"<string>\",\n \"embedding_config\": {\n \"auth\": {\n \"api_key\": \"<string>\",\n \"header_name\": \"<string>\",\n \"header_value\": \"<string>\",\n \"param_location\": \"<string>\",\n \"param_name\": \"<string>\",\n \"param_value\": \"<string>\"\n },\n \"model\": \"<string>\",\n \"provider\": \"<string>\"\n },\n \"enabled\": true,\n \"members\": [\n {\n \"models\": [\n \"<string>\"\n ],\n \"registry_id\": \"<string>\"\n }\n ],\n \"pool_alias\": \"<string>\"\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"registries\": [\n {\n \"id\": \"<string>\",\n \"model_policies\": {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\"\n },\n \"weight\": 1\n }\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routing_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ],\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"auth_ids": [
"<string>"
],
"created_at": "<string>",
"fail_mode": "<string>",
"fallback": {
"budget": {
"max_attempts": 123,
"max_total_latency_ms": 123
},
"chain": [
"<string>"
],
"enabled": true,
"triggers": [
"<string>"
]
},
"gateway_id": "<string>",
"headers": {},
"id": "<string>",
"lb_config": {
"algorithm": "<string>",
"embedding_config": {
"auth": {
"api_key": "<string>",
"header_name": "<string>",
"header_value": "<string>",
"param_location": "<string>",
"param_name": "<string>",
"param_value": "<string>"
},
"model": "<string>",
"provider": "<string>"
},
"enabled": true,
"members": [
{
"models": [
"<string>"
],
"registry_id": "<string>"
}
],
"pool_alias": "<string>"
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"registry_ids": [
"<string>"
],
"registry_weights": [
{
"registry_id": "<string>",
"weight": 123
}
],
"role_ids": [
"<string>"
],
"routing_mode": "<string>",
"slug": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
],
"type": "<string>",
"updated_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}