curl --request PATCH \
--url https://openrouter.ai/api/v1/private-endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"declared_parameters": [
"seed"
],
"settings": {
"context_length": 128000
}
}
'import requests
url = "https://openrouter.ai/api/v1/private-endpoints/{id}"
payload = {
"declared_parameters": ["seed"],
"settings": { "context_length": 128000 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({declared_parameters: ['seed'], settings: {context_length: 128000}})
};
fetch('https://openrouter.ai/api/v1/private-endpoints/{id}', 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://openrouter.ai/api/v1/private-endpoints/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'declared_parameters' => [
'seed'
],
'settings' => [
'context_length' => 128000
]
]),
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://openrouter.ai/api/v1/private-endpoints/{id}"
payload := strings.NewReader("{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://openrouter.ai/api/v1/private-endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/private-endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": {
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"settings": {
"completions": {
"chat": true,
"text": false
},
"context_length": 128000,
"excluded_parameters": [
"logit_bias"
],
"inputs": {
"audio": false,
"base64_files": null,
"base64_images": true,
"file_urls": null,
"image_urls": true
},
"max_completion_tokens": 16384,
"max_prompt_tokens": null,
"quantization": "bf16",
"reasoning": {
"return_mechanism": "reasoning",
"supported": true
},
"tool_choice": {
"auto": true,
"function": false,
"none": true,
"required": true
}
},
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 408,
"message": "Operation timed out. Please try again later."
}
}{
"error": {
"code": 409,
"message": "Resource conflict. Please try again later."
}
}{
"error": {
"code": 422,
"message": "Invalid argument"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 502,
"message": "Provider returned error"
}
}Update a private endpoint
Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. pricing and declared_parameters replace their stored value, settings changes only the fields it names (null clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. upstream_model_id, base_url, declared_zdr and declared_region re-point a draft: an omitted upstream_model_id or base_url keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any upstream change clears earlier validation. Naming an upstream field on an active endpoint returns 409 already_active and writes nothing; delete and re-create instead. Every group is checked before anything is written: 400 parameters_invalid when tool_choice is declared without tools tested or declared, 400 settings_invalid when max_prompt_tokens exceeds the context length, both completion APIs are off, or excluded_parameters names a tested parameter, 422 pricing_invalid for rates the provider strategy cannot represent. Management key required.
curl --request PATCH \
--url https://openrouter.ai/api/v1/private-endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"declared_parameters": [
"seed"
],
"settings": {
"context_length": 128000
}
}
'import requests
url = "https://openrouter.ai/api/v1/private-endpoints/{id}"
payload = {
"declared_parameters": ["seed"],
"settings": { "context_length": 128000 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({declared_parameters: ['seed'], settings: {context_length: 128000}})
};
fetch('https://openrouter.ai/api/v1/private-endpoints/{id}', 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://openrouter.ai/api/v1/private-endpoints/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'declared_parameters' => [
'seed'
],
'settings' => [
'context_length' => 128000
]
]),
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://openrouter.ai/api/v1/private-endpoints/{id}"
payload := strings.NewReader("{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://openrouter.ai/api/v1/private-endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/private-endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"declared_parameters\": [\n \"seed\"\n ],\n \"settings\": {\n \"context_length\": 128000\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": {
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"settings": {
"completions": {
"chat": true,
"text": false
},
"context_length": 128000,
"excluded_parameters": [
"logit_bias"
],
"inputs": {
"audio": false,
"base64_files": null,
"base64_images": true,
"file_urls": null,
"image_urls": true
},
"max_completion_tokens": 16384,
"max_prompt_tokens": null,
"quantization": "bf16",
"reasoning": {
"return_mechanism": "reasoning",
"supported": true
},
"tool_choice": {
"auto": true,
"function": false,
"none": true,
"required": true
}
},
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 408,
"message": "Operation timed out. Please try again later."
}
}{
"error": {
"code": 409,
"message": "Resource conflict. Please try again later."
}
}{
"error": {
"code": 422,
"message": "Invalid argument"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 502,
"message": "Provider returned error"
}
}Authorizations
API key as bearer token in Authorization header
Path Parameters
Stable identifier of the private endpoint.
"5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11"
Body
Only the fields present change. base_url, upstream_model_id, declared_zdr and declared_region are accepted on a draft only; pricing and declared_parameters replace their value; settings is itself a partial update where null clears a limit or restores the provider default.
HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).
1"https://contoso.openai.azure.com"
Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. tool_choice requires tools to be tested or declared.
25A chat request parameter the endpoint accepts.
temperature, top_p, top_k, min_p, top_a, frequency_penalty, presence_penalty, repetition_penalty, max_tokens, max_completion_tokens, logit_bias, logprobs, top_logprobs, prediction, seed, response_format, structured_outputs, stop, tools, tool_choice, parallel_tool_calls, reasoning, reasoning_effort, web_search_options, verbosity ["temperature", "seed"]
Attest where this deployment processes data.
global, europe, us, null "us"
Attest that this deployment retains no prompt or completion data.
Replaces the whole pricing object: omitting cache_read or cache_write reverts that rate to the pricing strategy default.
Show child attributes
Show child attributes
{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
}
Only the fields present change; an omitted field keeps its stored value and null clears a limit or reverts a flag to the provider default.
Show child attributes
Show child attributes
{
"context_length": 128000,
"reasoning": { "supported": true }
}
Model or deployment identifier sent to the upstream provider.
1"gpt-4o-prod"
Response
The updated endpoint
Show child attributes
Show child attributes
{
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": ["temperature", "seed"],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": {
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"settings": {
"completions": { "chat": true, "text": false },
"context_length": 128000,
"excluded_parameters": ["logit_bias"],
"inputs": {
"audio": false,
"base64_files": null,
"base64_images": true,
"file_urls": null,
"image_urls": true
},
"max_completion_tokens": 16384,
"max_prompt_tokens": null,
"quantization": "bf16",
"reasoning": {
"return_mechanism": "reasoning",
"supported": true
},
"tool_choice": {
"auto": true,
"function": false,
"none": true,
"required": true
}
},
"status": "active",
"tested_parameters": ["tools", "tool_choice", "response_format"],
"upstream_model_id": "gpt-4o-prod"
}
Was this page helpful?