Skip to integration documentation
ProviderDock

Server-side integration guide

Integrate ProviderDock in the language you already use

JavaScript and TypeScript use the official provider-dock package. Python, Go, C#, Java, PHP, Ruby, and other server runtimes use the same secure OpenAI-compatible HTTPS endpoint.

Configure the workspace first

  1. Create a ProviderDock workspace and select the active organization.
  2. Create one customer tenant in the ProviderDock Console.
  3. Add the tenant's OpenAI, Anthropic, or Azure OpenAI credentials in the provider connections area.
  4. Create a tenant API token with only the gateway:invoke scope.
  5. Store the token only in your server secret manager.
PROVIDERDOCK_API_KEY=pd_live_…
PROVIDERDOCK_MODEL=gpt-4.1-mini

Never expose the token through NEXT_PUBLIC_, client-side JavaScript, browser storage, a desktop bundle, or a mobile application.

Choose your server language

Select a language to get a minimal production-safe starting point. JavaScript and TypeScript use the native SDK; every other example uses the same authenticated REST gateway.

Native SDK · Node.js server
ask.tsNative SDK
npm install provider-dock
import ProviderDock from "provider-dock";

const providerDock = new ProviderDock({
  apiKey: process.env.PROVIDERDOCK_API_KEY!
});

const response = await providerDock.responses.create({
  model: process.env.PROVIDERDOCK_MODEL ?? "gpt-4.1-mini",
  input: "Hello from TypeScript"
});

console.log(response.output_text);

Keep PROVIDERDOCK_API_KEY in server-side secrets. Browser and mobile clients should call your authenticated application endpoint, never ProviderDock directly.

Tools, structured output, and routing policy

SDK 0.3.1 types function tools, structured response formats, provider capability requirements, provider order, and request-level failover control.

import ProviderDock from "provider-dock";

const providerDock = new ProviderDock({
  apiKey: process.env.PROVIDERDOCK_API_KEY
});

const completion = await providerDock.chat.completions.create({
  model: "gpt-4.1-mini",
  messages: [{ role: "user", content: "Weather in Richmond?" }],
  tools: [{
    type: "function",
    function: {
      name: "lookup_weather",
      parameters: { type: "object", properties: { city: { type: "string" } } },
      strict: true
    }
  }],
  tool_choice: "auto",
  providerdock: {
    allowed_providers: ["OPENAI", "AZURE_OPENAI"],
    provider_order: ["AZURE_OPENAI", "OPENAI"],
    require_capabilities: ["tools"],
    allow_failover: true
  }
});

What the TypeScript SDK includes

  • providerDock.responses.create()
  • providerDock.chat.completions.create()
  • Typed tools, structured outputs, model policies, and streaming tool-call deltas
  • Async-iterable streaming responses
  • Typed authentication, budget, rate-limit, provider, timeout, and connection errors
  • provider-dock/mock test transport helpers
  • ESM, CommonJS, and TypeScript declarations

Production resources

Start with the language selector above, keep credentials server-side, and use the Prayer Companion guide as a real production example.

Open language setupPrayer Companion guideRead the PrayWithMe.faith story
ProviderDock v0.15.5•Accessibility