Skip to content

Commit fc99bf3

Browse files
Merge branch 'production' into aig-header-hierarchy
2 parents b506154 + 1bd6c18 commit fc99bf3

File tree

13 files changed

+130
-29
lines changed

13 files changed

+130
-29
lines changed

src/content/docs/ai-gateway/configuration/custom-metadata.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ Custom metadata in AI Gateway allows you to tag requests with user IDs or other
1414
* **Enhanced Logging**: Metadata appears in your logs, allowing for detailed inspection and troubleshooting.
1515
* **Search and Filter**: Use metadata to efficiently search and filter through logged requests.
1616

17+
:::note
18+
19+
20+
AI Gateway allows you to pass up to five custom metadata entries per request. If more than five entries are provided, only the first five will be saved; additional entries will be ignored. Ensure your custom metadata is limited to five entries to avoid unprocessed or lost data.
21+
22+
:::
23+
1724
## Supported Metadata Types
1825

1926
* String
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Glossary
3+
pcx_content_type: glossary
4+
---
5+
6+
import { Glossary } from "~/components";
7+
8+
AI Gateway supports a variety of headers to help you configure, customize, and manage your API requests. This page provides a complete list of all supported headers, along with a short description
9+
10+
<Glossary product="ai-gateway" />
11+
12+
## Configuration hierarchy
13+
14+
Settings in AI Gateway can be configured at three levels: **Provider**, **Request**, and **Gateway**. Since the same settings can be configured in multiple locations, the following hierarchy determines which value is applied:
15+
16+
1. **Provider-level headers**:
17+
Relevant only when using the [Universal Endpoint](/ai-gateway/providers/universal/), these headers take precedence over all other configurations.
18+
2. **Request-level headers**:
19+
Apply if no provider-level headers are set.
20+
3. **Gateway-level settings**:
21+
Act as the default if no headers are set at the provider or request levels.
22+
23+
This hierarchy ensures consistent behavior, prioritizing the most specific configurations. Use provider-level and request-level headers for more fine-tuned control, and gateway settings for general defaults.

src/content/docs/ai-gateway/providers/workersai.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export default {
9898
} satisfies ExportedHandler<Env>;
9999
```
100100

101+
For a detailed step-by-step guide on integrating Workers AI with AI Gateway using a binding, see [Integrations in AI Gateway](/ai-gateway/integrations/aig-workers-ai-binding/).
102+
101103
Workers AI supports the following parameters for AI gateways:
102104

103105
- `id` string

src/content/docs/ai-gateway/reference/limits.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ The following limits apply to gateway configurations, logs, and related features
1111

1212
| Feature | Limit |
1313
| --------------------------------------------------------------- | ----------------------------------- |
14+
| Cacheable request size | 25 MB per request |
15+
| Custom metadata | 5 entries per request |
1416
| Datasets | 10 per gateway |
1517
| Gateways | 10 per account |
18+
| Gateway name length | 64 characters |
1619
| Logs stored [paid plan](/ai-gateway/reference/pricing/) | 10 million per gateway <sup>1</sup> |
1720
| Logs stored [free plan](/ai-gateway/reference/pricing/) | 100,000 per account <sup>2</sup> |
1821
| Log size stored | 10 MB per log <sup>3</sup> |
1922
| Logpush jobs | 4 per account |
2023
| Logpush size limit | 1MB per log |
21-
| Gateway name length | 64 characters |
22-
| Cacheable request size | 25 MB per request |
2324

2425
<sup>1</sup> If you have reached 10 million logs stored per gateway, new logs
2526
will stop being saved. To continue saving logs, you must delete older logs in

src/content/docs/hyperdrive/examples/aws-rds-aurora.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ summary: Connect Hyperdrive to an AWS RDS or Aurora database instance.
44
pcx_content_type: example
55
title: Connect to AWS RDS and Aurora
66
sidebar:
7-
order: 11
7+
order: 12
88
description: Connect Hyperdrive to an AWS RDS or Aurora database instance.
99
---
1010

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
type: example
3+
summary: Connect Hyperdrive to an Azure Database for PostgreSQL instance.
4+
pcx_content_type: example
5+
title: Connect to Azure Database
6+
sidebar:
7+
order: 10
8+
description: Connect Hyperdrive to a Azure Database for PostgreSQL instance.
9+
---
10+
11+
import { Render } from "~/components";
12+
13+
This example shows you how to connect Hyperdrive to an Azure Database for PostgreSQL instance.
14+
15+
## 1. Allow Hyperdrive access
16+
17+
To allow Hyperdrive to connect to your database, you will need to ensure that Hyperdrive has valid credentials and network access.
18+
19+
<Render file="public-connectivity" />
20+
21+
### Azure Portal
22+
23+
#### Public access networking
24+
25+
To connect to your Azure Database for PostgreSQL instance using public Internet connectivity:
26+
27+
1. In the [Azure Portal](https://portal.azure.com/), select the instance you want Hyperdrive to connect to.
28+
2. Expand **Settings** > **Networking** > ensure **Public access** is enabled > in **Firewall rules** add `0.0.0.0` as **Start IP address** and `255.255.255.255` as **End IP address**.
29+
3. Select **Save** to persist your changes.
30+
4. Select **Overview** from the sidebar and note down the **Server name** of your instance.
31+
32+
With the username, password, server name, and database name (default: `postgres`), you can now create a Hyperdrive database configuration.
33+
34+
#### Private access networking
35+
36+
To connect to a private Azure Database for PostgreSQL instance, refer to [Connect to a private database using Tunnel](/hyperdrive/configuration/connect-to-private-database/).
37+
38+
## 2. Create a database configuration
39+
40+
<Render file="create-hyperdrive-config" />

src/content/docs/hyperdrive/examples/google-cloud-sql.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ summary: Connect Hyperdrive to a Google Cloud SQL database instance.
44
pcx_content_type: example
55
title: Connect to Google Cloud SQL
66
sidebar:
7-
order: 10
7+
order: 11
88
description: Connect Hyperdrive to a Google Cloud SQL database instance.
99
---
1010

src/content/docs/hyperdrive/examples/neon.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ title: Connect to Neon
66
sidebar:
77
order: 4
88
description: Connect Hyperdrive to a Neon Postgres database.
9-
109
---
1110

12-
import { Render } from "~/components"
11+
import { Render } from "~/components";
1312

1413
This example shows you how to connect Hyperdrive to a [Neon](https://neon.tech/) Postgres database.
1514

src/content/docs/hyperdrive/examples/pgedge.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ title: Connect to pgEdge Cloud
66
sidebar:
77
order: 9
88
description: Connect Hyperdrive to a pgEdge Postgres database.
9-
109
---
1110

12-
import { Render } from "~/components"
11+
import { Render } from "~/components";
1312

14-
This example shows you how to connect Hyperdrive to a [pgEdge](https://pgedge.com/) Postgres database. pgEdge Cloud provides easy deployment of fully-managed, fully-distributed, and secure Postgres.
13+
This example shows you how to connect Hyperdrive to a [pgEdge](https://pgedge.com/) Postgres database. pgEdge Cloud provides easy deployment of fully-managed, fully-distributed, and secure Postgres.
1514

1615
## 1. Allow Hyperdrive access
1716

18-
You can connect Hyperdrive to any existing pgEdge database with the default user and password
19-
provided by pgEdge.
17+
You can connect Hyperdrive to any existing pgEdge database with the default user and password provided by pgEdge.
2018

2119
### pgEdge dashboard
2220

21+
To retrieve your connection string from the pgEdge dashboard:
22+
2323
1. Go to the [**pgEdge dashboard**](https://app.pgedge.com) and select the database you wish to connect to.
2424
2. From the **Connect to your database** section, note down the connection string (starting with `postgres://app@...`) from the **Connection String** text box.
2525

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
type: example
3+
summary: Connect Hyperdrive to a Xata database instance.
4+
pcx_content_type: example
5+
title: Connect to Xata
6+
sidebar:
7+
order: 2
8+
description: Connect Hyperdrive to a Xata database instance.
9+
---
10+
11+
import { Render } from "~/components";
12+
13+
This example shows you how to connect Hyperdrive to a Xata PostgreSQL database instance.
14+
15+
## 1. Allow Hyperdrive access
16+
17+
You can connect Hyperdrive to any existing Xata database with the default user and password provided by Xata.
18+
19+
### Xata dashboard
20+
21+
To retrieve your connection string from the Xata dashboard:
22+
23+
1. Go to the [**Xata dashboard**](https://app.xata.io/).
24+
2. Select the database you want to connect to.
25+
3. Select **Settings**.
26+
4. Copy the connection string from the `PostgreSQL endpoint` section and add your API key.
27+
28+
## 2. Create a database configuration
29+
30+
<Render file="create-hyperdrive-config" />

0 commit comments

Comments
 (0)