curl --request POST \
--url https://api.coreweave.com/v1alpha1/inference/gateways \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"id": "<string>",
"zones": [
"<string>"
],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": true,
"enableRateLimiting": true
},
"endpointConfiguration": {
"additionalDns": [
"<string>"
]
},
"pathBasedRouting": {}
}
'import requests
url = "https://api.coreweave.com/v1alpha1/inference/gateways"
payload = {
"name": "<string>",
"id": "<string>",
"zones": ["<string>"],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": True,
"enableRateLimiting": True
},
"endpointConfiguration": { "additionalDns": ["<string>"] },
"pathBasedRouting": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '<string>',
zones: ['<string>'],
coreWeaveAuth: {},
weightsAndBiasesAuth: {
apiKey: '<string>',
serverUrl: '<string>',
enableUsageReports: true,
enableRateLimiting: true
},
endpointConfiguration: {additionalDns: ['<string>']},
pathBasedRouting: {}
})
};
fetch('https://api.coreweave.com/v1alpha1/inference/gateways', 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.coreweave.com/v1alpha1/inference/gateways",
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>',
'id' => '<string>',
'zones' => [
'<string>'
],
'coreWeaveAuth' => [
],
'weightsAndBiasesAuth' => [
'apiKey' => '<string>',
'serverUrl' => '<string>',
'enableUsageReports' => true,
'enableRateLimiting' => true
],
'endpointConfiguration' => [
'additionalDns' => [
'<string>'
]
],
'pathBasedRouting' => [
]
]),
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.coreweave.com/v1alpha1/inference/gateways"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\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.coreweave.com/v1alpha1/inference/gateways")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1alpha1/inference/gateways")
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 \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\n}"
response = http.request(request)
puts response.read_body{
"gateway": {
"spec": {
"id": "<string>",
"name": "<string>",
"zones": [
"<string>"
],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": true,
"enableRateLimiting": true
},
"organizationId": "<string>",
"endpointConfiguration": {
"additionalDns": [
"<string>"
]
},
"bodyBasedRouting": {
"apiType": "API_TYPE_OPENAI"
},
"headerBasedRouting": {
"headerName": "<string>"
},
"pathBasedRouting": {}
},
"status": {
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"conditions": [
{
"type": "<string>",
"lastUpdateTime": "2023-11-07T05:31:56Z",
"reason": "<string>",
"message": "<string>",
"zone": "<string>"
}
],
"endpoints": [
"<string>"
]
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Create gateway
Create a CoreWeave inference gateway with one authentication type and one routing strategy.
curl --request POST \
--url https://api.coreweave.com/v1alpha1/inference/gateways \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"id": "<string>",
"zones": [
"<string>"
],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": true,
"enableRateLimiting": true
},
"endpointConfiguration": {
"additionalDns": [
"<string>"
]
},
"pathBasedRouting": {}
}
'import requests
url = "https://api.coreweave.com/v1alpha1/inference/gateways"
payload = {
"name": "<string>",
"id": "<string>",
"zones": ["<string>"],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": True,
"enableRateLimiting": True
},
"endpointConfiguration": { "additionalDns": ["<string>"] },
"pathBasedRouting": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '<string>',
zones: ['<string>'],
coreWeaveAuth: {},
weightsAndBiasesAuth: {
apiKey: '<string>',
serverUrl: '<string>',
enableUsageReports: true,
enableRateLimiting: true
},
endpointConfiguration: {additionalDns: ['<string>']},
pathBasedRouting: {}
})
};
fetch('https://api.coreweave.com/v1alpha1/inference/gateways', 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.coreweave.com/v1alpha1/inference/gateways",
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>',
'id' => '<string>',
'zones' => [
'<string>'
],
'coreWeaveAuth' => [
],
'weightsAndBiasesAuth' => [
'apiKey' => '<string>',
'serverUrl' => '<string>',
'enableUsageReports' => true,
'enableRateLimiting' => true
],
'endpointConfiguration' => [
'additionalDns' => [
'<string>'
]
],
'pathBasedRouting' => [
]
]),
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.coreweave.com/v1alpha1/inference/gateways"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\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.coreweave.com/v1alpha1/inference/gateways")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1alpha1/inference/gateways")
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 \"id\": \"<string>\",\n \"zones\": [\n \"<string>\"\n ],\n \"coreWeaveAuth\": {},\n \"weightsAndBiasesAuth\": {\n \"apiKey\": \"<string>\",\n \"serverUrl\": \"<string>\",\n \"enableUsageReports\": true,\n \"enableRateLimiting\": true\n },\n \"endpointConfiguration\": {\n \"additionalDns\": [\n \"<string>\"\n ]\n },\n \"pathBasedRouting\": {}\n}"
response = http.request(request)
puts response.read_body{
"gateway": {
"spec": {
"id": "<string>",
"name": "<string>",
"zones": [
"<string>"
],
"coreWeaveAuth": {},
"weightsAndBiasesAuth": {
"apiKey": "<string>",
"serverUrl": "<string>",
"enableUsageReports": true,
"enableRateLimiting": true
},
"organizationId": "<string>",
"endpointConfiguration": {
"additionalDns": [
"<string>"
]
},
"bodyBasedRouting": {
"apiType": "API_TYPE_OPENAI"
},
"headerBasedRouting": {
"headerName": "<string>"
},
"pathBasedRouting": {}
},
"status": {
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"conditions": [
{
"type": "<string>",
"lastUpdateTime": "2023-11-07T05:31:56Z",
"reason": "<string>",
"message": "<string>",
"zone": "<string>"
}
],
"endpoints": [
"<string>"
]
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
CoreWeave API access token sent as a bearer token.
Body
Request for CreateGateway
The human readable name of the gateway. Capped at 38 characters so the derived production FQDN (..gw.cwinference.com) fits within the 64-character X.509 Common Name limit.
The unique identifier of the gateway, UUID format
The zones to make the gateway available in, limits where deployments associated with the gateway may exist, no zones means all may be used.
CoreWeave IAM
Weights & Biases
Show child attributes
Show child attributes
Additional endpoint configuration options
Show child attributes
Show child attributes
Body based routing
Show child attributes
Show child attributes
Header based routing
Show child attributes
Show child attributes
Path based routing
Response
OK
Response for CreateGateway
The gateway that was created
Show child attributes
Show child attributes
Was this page helpful?