---
title: "Create an AI Gateway Datastore"
method: POST
path: "/v1/ai-gateways/{gatewayId}/datastores"
tags: ["AI Gateway Datastores"]
---

# Create an AI Gateway Datastore

`POST /v1/ai-gateways/{gatewayId}/datastores`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v1/ai-gateways/{gatewayId}/datastores`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Creates a new Datastore for the AI Gateway.

## Path parameters

- `gatewayId` string, uuid, required: Contains a unique identifier used for this resource.

## Request body

- union: Configuration for an AI Gateway Datastore.
  - RedisCEDatastore
    - `name` string, required: A user-defined unique identifier for this Datastore, used as a stable human-readable reference. This value is immutable after creation.
    - `display_name` string, required: The display name for this Datastore.
    - `description` string: The description of the Datastore.
    - `labels` PublicLabels: 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_by` ManagedBy: 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, start and end with an alphanumeric character, and may contain dashes (`-`), underscores (`_`), and dots (`.`). Values must be 1–127 characters long and must not be empty. Keys and values must not contain spaces or control characters.
    - `type` 'redis-ce', required
    - `config` RedisCEDatastoreConfig, required
      - `host` string, required
      - `port` integer, nullable
      - `username` string, nullable
      - `password` string, nullable
      - `database` integer, nullable: The Redis database index to use.
      - `timeout` integer, nullable: Timeout in milliseconds for connecting, reading, and writing to the Redis server.
      - `ssl` boolean, nullable
      - `ssl_verify` boolean, nullable
      - `server_name` string, nullable: SNI to use when connecting over SSL.
      - `cloud_authentication` DatastoreRedisCloudAuthentication: Cloud-managed Redis authentication. Only the fields relevant to the chosen `auth_provider` need to be set.
        - `auth_provider` union
          - 'aws' | 'gcp' | 'azure', nullable
          - string
        - `aws_cache_name` string, nullable
        - `aws_region` string, nullable
        - `aws_is_serverless` boolean, nullable
        - `aws_access_key_id` string, nullable
        - `aws_secret_access_key` string, nullable
        - `aws_assume_role_arn` string, nullable
        - `aws_role_session_name` string, nullable
        - `gcp_service_account_json` string, nullable
        - `azure_client_id` string, nullable
        - `azure_client_secret` string, nullable
        - `azure_tenant_id` string, nullable
  - RedisEEDatastore
    - `name` string, required: A user-defined unique identifier for this Datastore, used as a stable human-readable reference. This value is immutable after creation.
    - `display_name` string, required: The display name for this Datastore.
    - `description` string: The description of the Datastore.
    - `labels` PublicLabels: 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_by` ManagedBy: 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, start and end with an alphanumeric character, and may contain dashes (`-`), underscores (`_`), and dots (`.`). Values must be 1–127 characters long and must not be empty. Keys and values must not contain spaces or control characters.
    - `type` 'redis-ee', required
    - `config` RedisEEDatastoreConfig, required
      - `host` string, required
      - `port` union: An integer representing a port number between 0 and 65535, inclusive. This field is [referenceable](https://developer.konghq.com/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).
        - integer
        - string
      - `username` string, nullable
      - `password` string, nullable
      - `database` integer, nullable: The Redis database index to use.
      - `connect_timeout` integer, nullable
      - `send_timeout` integer, nullable
      - `read_timeout` integer, nullable
      - `keepalive_pool_size` integer, nullable
      - `keepalive_backlog` integer, nullable
      - `ssl` boolean, nullable
      - `ssl_verify` boolean, nullable
      - `server_name` string, nullable: SNI to use when connecting over SSL.
      - `connection_is_proxied` boolean, nullable
      - `sentinel_master` string, nullable
      - `sentinel_role` 'master' | 'slave' | 'any', nullable
      - `sentinel_username` string, nullable
      - `sentinel_password` string, nullable
      - `sentinel_nodes` object[], nullable
        - `host` string, required
        - `port` integer, required
      - `cluster_nodes` object[], nullable
        - `ip` string, required
        - `port` integer, required
      - `cluster_max_redirections` integer, nullable
      - `cloud_authentication` DatastoreRedisCloudAuthentication: Cloud-managed Redis authentication. Only the fields relevant to the chosen `auth_provider` need to be set.
        - `auth_provider` union
          - 'aws' | 'gcp' | 'azure', nullable
          - string
        - `aws_cache_name` string, nullable
        - `aws_region` string, nullable
        - `aws_is_serverless` boolean, nullable
        - `aws_access_key_id` string, nullable
        - `aws_secret_access_key` string, nullable
        - `aws_assume_role_arn` string, nullable
        - `aws_role_session_name` string, nullable
        - `gcp_service_account_json` string, nullable
        - `azure_client_id` string, nullable
        - `azure_client_secret` string, nullable
        - `azure_tenant_id` string, nullable
  - VectorDBDatastore: Carries the pgvector connection only. `strategy`, `dimensions`, `distance_metric`, and `threshold` belong to the policy or model referencing this Datastore, not the Datastore itself.
    - `name` string, required: A user-defined unique identifier for this Datastore, used as a stable human-readable reference. This value is immutable after creation.
    - `display_name` string, required: The display name for this Datastore.
    - `description` string: The description of the Datastore.
    - `labels` PublicLabels: 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_by` ManagedBy: 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, start and end with an alphanumeric character, and may contain dashes (`-`), underscores (`_`), and dots (`.`). Values must be 1–127 characters long and must not be empty. Keys and values must not contain spaces or control characters.
    - `type` 'vectordb', required
    - `config` VectorDBDatastoreConfig, required
      - `host` string, required
      - `port` integer
      - `user` string
      - `password` string, nullable
      - `database` string, required
      - `timeout` integer: Timeout in milliseconds for connecting, reading, and writing to the database.
      - `ssl` boolean
      - `ssl_required` boolean
      - `ssl_verify` boolean
      - `ssl_version` string
      - `ssl_cert` string, nullable
      - `ssl_cert_key` string, nullable
  - TokenVaultDatastore
    - `name` string, required: A user-defined unique identifier for this Datastore, used as a stable human-readable reference. This value is immutable after creation.
    - `display_name` string, required: The display name for this Datastore.
    - `description` string: The description of the Datastore.
    - `labels` PublicLabels: 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_by` ManagedBy: 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, start and end with an alphanumeric character, and may contain dashes (`-`), underscores (`_`), and dots (`.`). Values must be 1–127 characters long and must not be empty. Keys and values must not contain spaces or control characters.
    - `type` 'token-vault', required
    - `config` TokenVaultDatastoreConfig, required
      - `directory` string, required: The name of the directory in which tokens are stored.
      - `current_version` string, required: The version of the encryption key used to encrypt new tokens.
      - `keys` TokenVaultDatastoreKey[], required: The encryption keys used to protect stored tokens. Keep previous versions in the list so existing tokens can still be decrypted.
        - `version` string, required: The identifier of this key version.
        - `key` string, nullable: A [vault reference](https://developer.konghq.com/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault) to the encryption key. A literal key value is rejected.

## Response `201`

AI Gateway Datastore created successfully.

- union: Configuration for an AI Gateway Datastore.
  - intersection
    - object
      - `id` string, uuid, required: Contains a unique identifier used for this resource.
      - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
      - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.
      - `konnect_managed` boolean: An immutable read-only flag to identify resource managed by Konnect services.
    - [`RedisCEDatastore`](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd/schema?at=%2Fcomponents%2Fschemas%2FRedisCEDatastore)
  - intersection
    - object
      - `id` string, uuid, required: Contains a unique identifier used for this resource.
      - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
      - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.
      - `konnect_managed` boolean: An immutable read-only flag to identify resource managed by Konnect services.
    - [`RedisEEDatastore`](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd/schema?at=%2Fcomponents%2Fschemas%2FRedisEEDatastore)
  - intersection
    - object
      - `id` string, uuid, required: Contains a unique identifier used for this resource.
      - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
      - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.
      - `konnect_managed` boolean: An immutable read-only flag to identify resource managed by Konnect services.
    - [`VectorDBDatastore`](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd/schema?at=%2Fcomponents%2Fschemas%2FVectorDBDatastore)
  - intersection
    - object
      - `id` string, uuid, required: Contains a unique identifier used for this resource.
      - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
      - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.
      - `konnect_managed` boolean: An immutable read-only flag to identify resource managed by Konnect services.
    - [`TokenVaultDatastore`](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd/schema?at=%2Fcomponents%2Fschemas%2FTokenVaultDatastore)

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests

## Changes

- **2026-12-03** `9c8d300657bd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-beta/changes/v1/ai-gateways/:gatewayId/datastores/post.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-beta.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/9c8d300657bd?raw)
