Créer un certificat de tunnel
POST/v1/tunnels/{tunnel_id}/certificates
L'API Tunnels est en « research preview » (aperçu de recherche). Elle nécessite l'en-tête anthropic-beta: mcp-tunnels-2026-06-22 et peut changer sans période de dépréciation. Elle remplace les points de terminaison de l'Admin API situés sous /v1/organizations/tunnels, qui restent disponibles pendant une fenêtre de migration.
Enregistre un certificat d'autorité de certification (CA) public sur un tunnel. Anthropic vérifie le certificat serveur de la passerelle par rapport à cette CA lorsqu'elle termine la session TLS interne. Un tunnel contient au plus deux certificats non archivés.
Parameters
Returns
Créer un certificat de tunnel
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaTunnelCertificate, err := client.Beta.Tunnels.Certificates.New(
context.TODO(),
"tunnel_id",
anthropic.BetaTunnelCertificateNewParams{
CACertificatePEM: "ca_certificate_pem",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaTunnelCertificate.ID)
}Response 200
{
"id": "id",
"archived_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"fingerprint": "fingerprint",
"tunnel_id": "tunnel_id",
"type": "tunnel_certificate"
}Returns Examples
Response 200
{
"id": "id",
"archived_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"fingerprint": "fingerprint",
"tunnel_id": "tunnel_id",
"type": "tunnel_certificate"
}