The control plane
Pro uses one origin for extraction and administration. Enterprise uses a separate backend origin.
Configure control_plane_base_url (Python), controlPlaneBaseUrl (TypeScript), or
WithControlPlaneBaseURL (Go) for Enterprise. Set the target to enterprise when it is known.
Choose the method for your deployment
Section titled “Choose the method for your deployment”| Operation | Pro Python / TypeScript / Go | Enterprise Python / TypeScript / Go |
|---|---|---|
| List projects | list_projects / listProjects / ListProjects |
backend_list_projects / backendListProjects / BackendListProjects |
| Create project | create_project / createProject / CreateProject |
backend_create_project / backendCreateProject / BackendCreateProject |
| Create key | create_api_key / createApiKey / CreateAPIKey |
backend_create_api_key / backendCreateApiKey / BackendCreateAPIKey |
| Create integration | create_integration / createIntegration / CreateIntegration |
backend_create_integration / backendCreateIntegration / BackendCreateIntegration |
| Read project RAG configuration | get_rag_config / getRagConfig / GetRagConfig |
backend_get_rag_config / backendGetRagConfig / BackendGetRAGConfig |
Backend methods preserve the backend’s generated request and response types. Pro and backend schemas are not interchangeable merely because their paths match. Use the per-language Python, TypeScript, and Go references for the complete method list.
Authenticate
Section titled “Authenticate”Set a backend bearer with control_plane_token, controlPlaneToken, or WithControlPlaneToken.
The default is the configured API key. A separate token lets the data plane keep a project key while
the backend uses a session token. An explicit empty token disables the fallback.
backend_login / backendLogin / BackendLogin exchanges an external OIDC ID token for a backend
session token. Its response uses the backend login schema. Use the resulting backend token for later
control-plane calls; an external OIDC ID token is not itself a backend session token.
Public sandbox extraction takes a separate explicit token. No project key or backend session token is forwarded implicitly to that endpoint. Fileless extraction requires web mode and a URL.
Backend requests omit inherited cookies and do not follow redirects. The OAuth callback method returns
the server’s Location from a 303 response without navigating to it. Let your application decide
whether and how to open that destination.
Manage resources
Section titled “Manage resources”Create a project before creating its API keys. The create-key response contains the plaintext key; store it in your secret manager and avoid logging it. Key listing does not recover the original secret.
Create an integration to register a document source, then call its connect method to obtain an authorization URL. The provider’s browser consent flow remains an application concern. After connection, list documents and fetch their original bytes before submitting them for extraction.
Enterprise also exposes project membership, invitations, managed webhooks, analytics, usage, and billing. These use the dedicated backend origin. Project RAG configuration sets project defaults; individual RAG collection configuration remains a separate data-plane surface.
The tier matrix distinguishes shared functionality from Enterprise-only operations. The OpenAPI reference shows each deployment’s exact schema.
Enterprise project lifecycle
Section titled “Enterprise project lifecycle”These examples create a scratch project and key, revoke the key, then delete the project.
Set XBERG_CONTROL_PLANE_URL to the backend origin and XBERG_CONTROL_PLANE_TOKEN to an owner
session token, alongside the deployment environment described in the quickstart.
import osfrom uuid import uuid4
from xberg_io_sdk import XbergClient
with XbergClient( api_key=os.environ["XBERG_API_KEY"], base_url=os.environ["XBERG_BASE_URL"], control_plane_base_url=os.environ["XBERG_CONTROL_PLANE_URL"], control_plane_token=os.environ["XBERG_CONTROL_PLANE_TOKEN"], target="enterprise",) as client: project = client.backend_create_project({"name": f"sdk-snippet-{uuid4()}"}) try: key = client.backend_create_api_key(str(project.id), {"name": "snippet-key", "scope": "write"}) try: if not key.key: raise RuntimeError("API key creation returned no credential") fetched = client.get_project(str(project.id)) if fetched.id != project.id: raise RuntimeError("The fetched project did not match the created project") finally: client.backend_revoke_api_key(str(project.id), str(key.id)) finally: client.delete_project(str(project.id), erase=True) print("Project lifecycle verified")import { randomUUID } from "node:crypto";import { XbergClient } from "@xberg-io/sdk";
const baseUrl = process.env.XBERG_BASE_URL;if (!baseUrl) throw new Error("Set XBERG_BASE_URL to your deployment URL");const client = new XbergClient({ apiKey: process.env.XBERG_API_KEY, baseUrl, controlPlaneBaseUrl: process.env.XBERG_CONTROL_PLANE_URL, controlPlaneToken: process.env.XBERG_CONTROL_PLANE_TOKEN, target: "enterprise",});const project = await client.backendCreateProject({ name: `sdk-snippet-${randomUUID()}` });try { const key = await client.backendCreateApiKey(project.id, { name: "snippet-key", scope: "write" }); try { if (!key.key) throw new Error("API key creation returned no credential"); const fetched = await client.getProject(project.id); if (fetched.id !== project.id) throw new Error("The fetched project did not match the created project"); } finally { await client.backendRevokeApiKey(project.id, key.id); }} finally { await client.deleteProject(project.id, { erase: true });}console.log("Project lifecycle verified");package main
import ( "context" "errors" "fmt" "os" "time"
xberg "github.com/xberg-io/sdks/packages/go")
func run() (result error) { client, err := xberg.New( xberg.WithAPIKey(os.Getenv("XBERG_API_KEY")), xberg.WithBaseURL(os.Getenv("XBERG_BASE_URL")), xberg.WithControlPlaneBaseURL(os.Getenv("XBERG_CONTROL_PLANE_URL")), xberg.WithControlPlaneToken(os.Getenv("XBERG_CONTROL_PLANE_TOKEN")), xberg.WithTarget(xberg.TargetEnterprise), ) if err != nil { return err } context := context.Background() project, err := client.BackendCreateProject(context, xberg.CreateProjectRequest{Name: fmt.Sprintf("sdk-snippet-%d", time.Now().UnixNano())}) if err != nil { return err } defer func() { if err := client.DeleteProject(context, project.Id.String(), map[string]string{"erase": "true"}); err != nil { result = errors.Join(result, fmt.Errorf("deleting snippet project %s: %w", project.Id, err)) } }() name := "snippet-key" key, err := client.BackendCreateAPIKey(context, project.Id.String(), xberg.CreateApiKeyRequest{Name: &name}) if err != nil { return err } defer func() { if err := client.BackendRevokeAPIKey(context, project.Id.String(), key.Id.String()); err != nil { result = errors.Join(result, fmt.Errorf("revoking snippet key for project %s: %w", project.Id, err)) } }() if key.Key == "" { return fmt.Errorf("API key creation returned no credential") } fetched, err := client.GetProject(context, project.Id.String()) if err != nil { return err } if fetched.Id != project.Id { return fmt.Errorf("the fetched project did not match the created project") } return nil}
func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } fmt.Println("Project lifecycle verified")}