AI Certificates

Related Documentation
Minimum Version
AI Gateway - 2.0
Incompatible with
on-prem

What is an AI Certificate?

An AI Certificate holds a PEM-encoded public certificate chain and its matching private key. An AI Gateway data plane uses it to terminate TLS connections from clients, and to originate TLS connections to LLM providers.

Each AI Certificate belongs to exactly one AI Gateway instance. An AI Gateway can hold many AI Certificates, so you can serve several hostnames from the same data plane, each with its own certificate. For example, by exposing your LLM, MCP, and A2A traffic on separate hostnames.

Associate hostnames with an AI Certificate

To decide which AI Certificate the data plane presents for a given connection, create one or more AI SNIs that name this AI Certificate. The mapping is many-to-one: a single AI Certificate can back many hostnames.

You can create the AI SNIs:

  • From the AI SNI endpoint, /v1/ai-gateways/{aiGatewayId}/snis, naming the AI Certificate in the request body
  • From the AI Certificate’s nested endpoint, /v1/ai-gateways/{aiGatewayId}/certificates/{certificateIdOrName}/snis

Alternative certificates

Set cert_alt and key_alt to serve a second certificate alongside the first. The alternative certificate must use a different key algorithm than the main cert. This allows an AI Certificate to carry, for example, both an RSA and an ECDSA chain. The data plane then picks whichever one the connecting client supports.

The alternative fields go together: key_alt requires cert_alt to be set.

Store keys in an AI Vault

The cert, key, cert_alt, and key_alt fields are referenceable, so you can keep the material in an AI Vault instead of sending it to Konnect in the request body. Set the field to a vault reference string:

{vault://vault-name/secret-key}

The entire field value must be the reference. Partial references aren’t resolved.

Lifecycle

AI Certificates support create, list, get, update, and delete operations.

To rotate a certificate in place, update the existing AI Certificate with the new cert and key. Every AI SNI pointing at it starts using the new material without any change to the AI SNIs themselves.

Deleting an AI Certificate leaves any AI SNI that names it without a usable certificate, and the data plane falls back to its default certificate for those hostnames.

Set up an AI Certificate

The following example registers a certificate and its private key. Reference it afterwards from an AI SNI to bind it to a hostname.

To create an AI Certificate, call the Konnect AI Gateway API’s /certificates endpoint.

curl -X POST https://{region}.api.konghq.com/v1/ai-gateways/{AIGatewayId}/certificates \
    --header "accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer $KONNECT_TOKEN" \
    --data '
    {
      "name": "my-tls-cert",
      "cert": "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
      "key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n"
    }
    '

Make sure to replace the following placeholders with your own values:

  • region: Geographic region where your Kong Konnect is hosted and operates.

  • KONNECT_TOKEN: Your Personal Access Token (PAT) associated with your Konnect account.

  • AIGatewayId: The id of the AI Gateway.

See the Konnect AI Gateway API reference to learn about region-specific URLs and personal access tokens.

Schema

FAQs

Both hold a PEM-encoded certificate and private key for TLS, but they’re separate entities, and the Kong Gateway Certificate documentation doesn’t fully carry over:

  • Hostname association: A Kong Gateway Certificate accepts an inline snis array at creation time. An AI Certificate has no such field. Create AI SNIs separately and point them at the AI Certificate by name.
  • Identifier: A Kong Gateway Certificate is referenced by id. An AI Certificate has an immutable name that acts as its stable reference.
  • Metadata: A Kong Gateway Certificate uses tags. An AI Certificate uses labels, following the AI Gateway entity convention.
  • Tooling: Kong Gateway Certificates are managed through the Admin API, Konnect API, decK, KIC, and Terraform. AI Certificates are managed through the Konnect AI Gateway API.
  • Scope: A Kong Gateway Certificate is scoped to a control plane, and to a Workspace on Konnect. An AI Certificate is scoped to a single AI Gateway instance, which doesn’t participate in Workspaces.

An AI Certificate is an identity the data plane uses itself: it carries a private key and is presented to complete a TLS handshake. An AI CA Certificate represents a trusted certificate authority, carries no private key, and is used to verify the certificate a client or an upstream server presents. AI CA Certificates are managed through their own endpoint, /v1/ai-gateways/{aiGatewayId}/ca-certificates.

An AI Data Plane Certificate authenticates a data plane node to the AI Gateway control plane over mTLS, so the node can pull configuration. An AI Certificate is used on the traffic path instead, for TLS with the LLM, MCP, and A2A clients calling the data plane and with the upstreams it connects to.

No. The key and key_alt fields are write-only. They’re accepted on create and update, but never returned by a read. Keep your own copy of any key you register, or store it in an AI Vault and register a reference to it instead of the literal value.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!