---
title: Hyperdrive
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Hyperdrive

##### ModelsExpand Collapse 

Configuration \= HyperdriveInternetOrigin { host, port, database, 3 more } | HyperdriveOverAccessOrigin { access\_client\_id, access\_client\_secret, host, 4 more } | HyperdriveVPCServiceOrigin { service\_id, database, password, 2 more } 

Connect to a database through a Workers VPC Service. TLS settings (mTLS, sslmode) cannot be configured on the Hyperdrive when using a VPC Service origin; TLS must be managed on the VPC Service itself.

One of the following:

HyperdriveInternetOrigin { host, port, database, 3 more } 

host: string

Defines the host (hostname or IP) of your origin database.

port: number

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

database?: string

Set the name of your origin database.

password?: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme?: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

user?: string

Set the user of your origin database.

HyperdriveOverAccessOrigin { access\_client\_id, access\_client\_secret, host, 4 more } 

access\_client\_id: string

Defines the Client ID of the Access token to use when connecting to the origin database.

access\_client\_secret: string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

host: string

Defines the host (hostname or IP) of your origin database.

database?: string

Set the name of your origin database.

password?: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme?: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

user?: string

Set the user of your origin database.

HyperdriveVPCServiceOrigin { service\_id, database, password, 2 more } 

Connect to a database through a Workers VPC Service. TLS settings (mTLS, sslmode) cannot be configured on the Hyperdrive when using a VPC Service origin; TLS must be managed on the VPC Service itself.

service\_id: string

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

database?: string

Set the name of your origin database.

password?: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme?: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

user?: string

Set the user of your origin database.

Hyperdrive { id, name, origin, 6 more } 

id: string

Define configurations using a unique string identifier.

maxLength32

name: string

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

origin: PublicDatabase { database, host, password, 3 more } | AccessProtectedDatabaseBehindCloudflareTunnel { access\_client\_id, access\_client\_secret, database, 4 more } | DatabaseReachableThroughAWorkersVPC { database, password, scheme, 2 more } 

One of the following:

PublicDatabase { database, host, password, 3 more } 

database: string

Set the name of your origin database.

host: string

Defines the host (hostname or IP) of your origin database.

password: string

Set the password needed to access your origin database. The API never returns this write-only value.

port: number

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

scheme: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

user: string

Set the user of your origin database.

AccessProtectedDatabaseBehindCloudflareTunnel { access\_client\_id, access\_client\_secret, database, 4 more } 

access\_client\_id: string

Defines the Client ID of the Access token to use when connecting to the origin database.

access\_client\_secret: string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

database: string

Set the name of your origin database.

host: string

Defines the host (hostname or IP) of your origin database.

password: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

user: string

Set the user of your origin database.

DatabaseReachableThroughAWorkersVPC { database, password, scheme, 2 more } 

database: string

Set the name of your origin database.

password: string

Set the password needed to access your origin database. The API never returns this write-only value.

scheme: "postgres" | "postgresql" | "mysql"

Specifies the URL scheme used to connect to your origin database.

One of the following:

"postgres"

"postgresql"

"mysql"

service\_id: string

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

user: string

Set the user of your origin database.

caching?: HyperdriveHyperdriveCachingCommon { disabled } | HyperdriveHyperdriveCachingEnabled { disabled, max\_age, stale\_while\_revalidate } 

One of the following:

HyperdriveHyperdriveCachingCommon { disabled } 

disabled?: boolean

Set to true to disable caching of SQL responses. Default is false.

HyperdriveHyperdriveCachingEnabled { disabled, max\_age, stale\_while\_revalidate } 

disabled?: boolean

Set to true to disable caching of SQL responses. Default is false.

max\_age?: number

Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.

stale\_while\_revalidate?: number

Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.

created\_on?: string

Defines the creation time of the Hyperdrive configuration.

formatdate-time

modified\_on?: string

Defines the last modified time of the Hyperdrive configuration.

formatdate-time

mtls?: MTLS { ca\_certificate\_id, mtls\_certificate\_id, sslmode } 

mTLS configuration for the origin connection. Cannot be used with VPC Service origins; TLS must be managed on the VPC Service.

ca\_certificate\_id?: string

Define CA certificate ID obtained after uploading CA cert.

mtls\_certificate\_id?: string

Define mTLS certificate ID obtained after uploading client cert.

sslmode?: string

Set SSL mode to ‘require’, ‘verify-ca’, or ‘verify-full’ to verify the CA.

origin\_connection\_limit?: number

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Certain Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare if you need a higher limit.

minimum5

restarted\_on?: string | null

Defines the last time the Hyperdrive connection pool was explicitly restarted via the restart endpoint. Omitted if the pool has never been explicitly restarted.

formatdate-time

#### HyperdriveConfigs

##### [List Hyperdrives](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/list)

client.hyperdrive.configs.list(ConfigListParams { account\_id, page, per\_page } params, RequestOptionsoptions?): V4PagePaginationArray<[Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive%20%3E%20%28model%29%20hyperdrive%20%3E%20%28schema%29) { id, name, origin, 6 more } \>

GET/accounts/{account\_id}/hyperdrive/configs

##### [Get Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/get)

client.hyperdrive.configs.get(stringhyperdriveID, ConfigGetParams { account\_id } params, RequestOptionsoptions?): [Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive%20%3E%20%28model%29%20hyperdrive%20%3E%20%28schema%29) { id, name, origin, 6 more } 

GET/accounts/{account\_id}/hyperdrive/configs/{hyperdrive\_id}

##### [Create Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/create)

client.hyperdrive.configs.create(ConfigCreateParams { account\_id, name, origin, 3 more } params, RequestOptionsoptions?): [Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive%20%3E%20%28model%29%20hyperdrive%20%3E%20%28schema%29) { id, name, origin, 6 more } 

POST/accounts/{account\_id}/hyperdrive/configs

##### [Replace Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/update)

client.hyperdrive.configs.update(stringhyperdriveID, ConfigUpdateParams { account\_id, name, origin, 3 more } params, RequestOptionsoptions?): [Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive%20%3E%20%28model%29%20hyperdrive%20%3E%20%28schema%29) { id, name, origin, 6 more } 

PUT/accounts/{account\_id}/hyperdrive/configs/{hyperdrive\_id}

##### [Update Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/edit)

client.hyperdrive.configs.edit(stringhyperdriveID, ConfigEditParams { account\_id, caching, mtls, 3 more } params, RequestOptionsoptions?): [Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive%20%3E%20%28model%29%20hyperdrive%20%3E%20%28schema%29) { id, name, origin, 6 more } 

PATCH/accounts/{account\_id}/hyperdrive/configs/{hyperdrive\_id}

##### [Delete Hyperdrive](https://developers.cloudflare.com/api/typescript/resources/hyperdrive/subresources/configs/methods/delete)

client.hyperdrive.configs.delete(stringhyperdriveID, ConfigDeleteParams { account\_id } params, RequestOptionsoptions?): [ConfigDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/hyperdrive#%28resource%29%20hyperdrive.configs%20%3E%20%28model%29%20config%5Fdelete%5Fresponse%20%3E%20%28schema%29) | null

DELETE/accounts/{account\_id}/hyperdrive/configs/{hyperdrive\_id}

##### ModelsExpand Collapse 

ConfigDeleteResponse \= unknown