---
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
      - `username` string, nullable
      - `password` string, nullable
      - `database` integer: The Redis database index to use.
      - `timeout` integer: Timeout in milliseconds for connecting, reading, and writing to the Redis server.
      - `ssl` boolean
      - `ssl_verify` boolean
      - `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: The Redis database index to use.
      - `connect_timeout` integer
      - `send_timeout` integer
      - `read_timeout` integer
      - `keepalive_pool_size` integer
      - `keepalive_backlog` integer, nullable
      - `ssl` boolean
      - `ssl_verify` boolean
      - `server_name` string, nullable: SNI to use when connecting over SSL.
      - `connection_is_proxied` boolean
      - `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
      - `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: 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-go-sdk/revisions/3b071797f6e4/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-go-sdk/revisions/3b071797f6e4/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-go-sdk/revisions/3b071797f6e4/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-go-sdk/revisions/3b071797f6e4/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-11-16** `a209c8bfa7b7`: 8 breaking, 8 info
  - the `type` request property const value `redis-ce` was added
  - the `type` request property const value `redis-ee` was added
  - the `type` request property const value `token-vault` was added
  - the `type` request property const value `vectordb` was added
  - …12 more
- **2026-11-12** `0c641a350d72`: 9 breaking
  - the `oneOf[#/components/schemas/RedisCEDatastore]/config/host` request property's minLength was increased from `0` to `1`
  - the `oneOf[#/components/schemas/RedisEEDatastore]/config/cluster_nodes/items/ip` request property's minLength was increased from `0` to `1`
  - the `oneOf[#/components/schemas/RedisEEDatastore]/config/host` request property's minLength was increased from `0` to `1`
  - the `oneOf[#/components/schemas/RedisEEDatastore]/config/sentinel_nodes/items/host` request property's minLength was increased from `0` to `1`
  - …5 more
- **2026-11-12** `d8bd04cfbaf7`: 12 breaking, 8 warning, 16 info
  - request property `oneOf[#/components/schemas/RedisCEDatastore]/type` was restricted to a list of enum values
  - request property `oneOf[#/components/schemas/RedisEEDatastore]/type` was restricted to a list of enum values
  - request property `oneOf[#/components/schemas/TokenVaultDatastore]/type` was restricted to a list of enum values
  - request property `oneOf[#/components/schemas/VectorDBDatastore]/type` was restricted to a list of enum values
  - …32 more
- …earlier changes not shown

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

---

[API](https://skmtc.dev/kong/apis/konnect-api-go-sdk.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-go-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4?raw)
