Official Go client for the PgBeam control-plane API — safe, scoped PostgreSQL access for AI agents on a globally distributed proxy with connection pooling and query caching.
The module is imported via the vanity path go.pgbeam.com/sdk; the package name
is pgbeam.
go get go.pgbeam.com/sdkRequires Go 1.24 or newer.
package main
import (
"context"
"fmt"
"log"
"os"
pgbeam "go.pgbeam.com/sdk"
)
func main() {
client := pgbeam.NewClient(&pgbeam.ClientOptions{
APIKey: os.Getenv("PGBEAM_API_KEY"), // prefix: pgb_
// BaseURL: "https://api.pgbeam.com", // optional
})
ctx := context.Background()
resp, err := client.Projects.ListProjects(ctx, &pgbeam.ListProjectsParams{OrgId: "org_123"})
if err != nil {
log.Fatal(err)
}
for _, p := range resp.Projects {
fmt.Printf("Project: %s (%s)\n", p.Name, p.Id)
}
}Operations are grouped into services on the client (client.Projects,
client.Agents, …), mirroring the API's tags.
The client covers the full PgBeam API:
- Projects, Databases, Replicas, Custom Domains, Cache Rules — the proxy and pooling primitives.
- Agent gateway — agent credentials (issue, rotate, revoke), policy profiles (read-only, allowlists, masking, budgets), approval requests, webhook endpoints, anomaly alerts, and audit logs.
- Analytics & Account — plans, usage, spend limits, insights, account export.
Full reference, quickstart, and per-method examples at pgbeam.com/docs/go-sdk.
Apache 2.0 — see LICENSE.