v61

latestOpenAPI 3.1.0Apache 2.0raw.githubusercontent.com2026-08-018131,3812.6 MB
AI Gateway Consumers

Create an AI Gateway Consumer Credential

Pre-release Endpoint This endpoint is currently in beta and is subject to change.

Creates a new credential for an AI Gateway consumer.

post/v1/ai-gateways/{gatewayId}/consumers/{consumerId}/credentials

Request body

display_namestring required

The display name for this credential instance.

namestring required

Identifier for an AI Gateway entity. In some cases, this may be the entity name or ID.

labelsPublicLabels

Public labels store information about an entity that can be used for filtering a list of objects.

Public labels are intended to store PUBLIC metadata.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

managed_byManagedBy

Stores information about what manages this entity, such as the tool or system responsible for its lifecycle (for example, terraform).

Keys must be 1–63 characters long and start with an alphanumeric character.

type'api-key' required
ttlinteger

The API Key's time-to-live in seconds. A value of 0 means the API Key never expires.

api_keystring

The API Key value. If not provided, then the key will be auto generated by the server and returned in the response.

Example request

{
  "display_name": "Greg's Dev Key",
  "name": "my-entity-name",
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "type": "api-key",
  "ttl": 86400,
  "api_key": "sk-387788hd3xnej"
}

Response

AI Gateway Consumer credential created successfully.

display_namestring required

The display name for this credential instance.

namestring required

Identifier for an AI Gateway entity. In some cases, this may be the entity name or ID.

labelsPublicLabels

Public labels store information about an entity that can be used for filtering a list of objects.

Public labels are intended to store PUBLIC metadata.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

managed_byManagedBy

Stores information about what manages this entity, such as the tool or system responsible for its lifecycle (for example, terraform).

Keys must be 1–63 characters long and start with an alphanumeric character.

type'api-key' required
ttlinteger

The API Key's time-to-live in seconds. A value of 0 means the API Key never expires.

api_keystring required

The API Key value. If not provided, then the key will be auto generated by the server and returned in the response.

idstring uuid required

Contains a unique identifier used for this resource.

created_atstring date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_atstring date-time required

An ISO-8601 timestamp representation of entity update date.

Example response

{
  "display_name": "Greg's Dev Key",
  "name": "my-entity-name",
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "type": "api-key",
  "ttl": 86400,
  "api_key": "sk-387788hd3xnej",
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z"
}