Relay request
Verifies the agent's signature and project, runs the gateway's plugins, records the exchange for audit, and forwards the request to the absolute http(s) URL in X-Viper-Upstream-URL, which the signature must cover. The destination's path and query replace the gateway path; a suffix after /v1/relay is accepted but used only for plugin matching. The gateway strips its signing and attestation headers before forwarding, refuses loopback, link-local, and unspecified destination addresses, and gives the upstream 30 seconds. Request bodies are capped at the gateway's limit, 32 MiB by default. A plugin denial carries the plugin's status, usually 403 or 503.
delete
https://<host>/v1/relaybash
curl --request DELETE \
--url 'https://<host>/v1/relay' \
--header 'Signature: <api-key>' \
--header 'X-Viper-Upstream-URL: <X-Viper-Upstream-URL>'javascript
const response = await fetch("https://<host>/v1/relay", {
method: "DELETE",
headers: {
"Signature": "<api-key>",
"X-Viper-Upstream-URL": "<X-Viper-Upstream-URL>"
}
});
const data = await response.json();typescript
const response = await fetch("https://<host>/v1/relay", {
method: "DELETE",
headers: {
"Signature": "<api-key>",
"X-Viper-Upstream-URL": "<X-Viper-Upstream-URL>"
}
});
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
const data: string = await response.json();python
import requests
response = requests.delete(
"https://<host>/v1/relay",
headers={
"Signature": "<api-key>",
"X-Viper-Upstream-URL": "<X-Viper-Upstream-URL>",
},
)
response.raise_for_status()
print(response.json())go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest(http.MethodDelete, "https://<host>/v1/relay", nil)
if err != nil {
panic(err)
}
req.Header.Set("Signature", "<api-key>")
req.Header.Set("X-Viper-Upstream-URL", "<X-Viper-Upstream-URL>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(data))
}java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://<host>/v1/relay"))
.header("Signature", "<api-key>")
.header("X-Viper-Upstream-URL", "<X-Viper-Upstream-URL>")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}csharp
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Delete, "https://<host>/v1/relay");
request.Headers.Add("Signature", "<api-key>");
request.Headers.Add("X-Viper-Upstream-URL", "<X-Viper-Upstream-URL>");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");php
<?php
$ch = curl_init('https://<host>/v1/relay');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Signature: <api-key>',
'X-Viper-Upstream-URL: <X-Viper-Upstream-URL>',
],
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status . " " . $response . PHP_EOL;ruby
require "net/http"
uri = URI("https://<host>/v1/relay")
request = Net::HTTP::Delete.new(uri)
request["Signature"] = "<api-key>"
request["X-Viper-Upstream-URL"] = "<X-Viper-Upstream-URL>"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts "#{response.code} #{response.body}"rust
// Cargo.toml dependencies: reqwest, tokio (features "full")
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = reqwest::Client::new()
.delete("https://<host>/v1/relay")
.header("Signature", "<api-key>")
.header("X-Viper-Upstream-URL", "<X-Viper-Upstream-URL>")
.send()
.await?;
println!("{} {}", response.status(), response.text().await?);
Ok(())
}Authorizations
AgentSignature· API key in header "Signature" — An RFC 9421 HTTP message signature by a registered agent's Ed25519 or P-256 key, sent with its Signature-Input header. The keyid is the agent's registered DID, created must fall within the signature's maximum age and clock skew, and the covered components start with @method and @target-uri. A request with a body also covers content-digest. Proxy and relay requests cover x-viper-nonce, x-viper-timestamp, and either x-viper-state-cid (state in an uploaded blob) or x-viper-credential-cid (state in the agent's state attestation credential); credential renewal covers x-viper-nonce. Viper signs every request this way.
Parameters
Header parameters
| Name | Type | Description |
|---|---|---|
X-Viper-Upstream-URLrequired | string | Absolute http(s) destination URL, covered by the signature |
Responses
200Upstream response passthrough
application/json
string
Examplejson
"string"400Bad Request
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}401Unauthorized
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}403Forbidden
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}413Request Entity Too Large
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}500Internal Server Error
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}502Bad Gateway
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}503Service Unavailable
application/json
codestringcorrelation_idstringmessagestring
Examplejson
{
"code": "string",
"correlation_id": "string",
"message": "string"
}