Client Setup

If you are setting up a new integration, start in the product at AI Platform -> Authentication first. It will give you the current organizationId, a copyable access token, API key creation, and verification before you paste SDK code.

import { PromptOrchestraClient } from "@prompt-mv/orchestration";

const client = new PromptOrchestraClient({
  baseUrl: "https://your-api.example.com",
  accessToken: process.env.PROMPT_ORCHESTRA_ACCESS_TOKEN!,
});

const verification = await client.setup.verify({
  organizationId: process.env.PROMPT_ORCHESTRA_ORG_ID!,
});

Optional fetch override for tests or edge runtimes. The SDK is ESM-first and expects Node 18+ or another runtime with fetch.

baseUrl should be the origin of saas-ai-api (no trailing / required). Paths are resolved with new URL(path, baseUrl) in buildUrl (core/http.ts).

client.setup.verify(...) is the quickest stable check that your token, org access, and SDK-facing route path are all valid before you start building.

Discover available models

const authoringClient = new PromptOrchestraClient({
  baseUrl: "https://your-api.example.com",
  apiKey: process.env.PROMPT_ORCHESTRA_AUTHORING_API_KEY!,
});

const models = await authoringClient.setup.listModels({
  organizationId: process.env.PROMPT_ORCHESTRA_ORG_ID!,
  includeUnavailable: false,
});

Use model discovery to choose a supported model from the public surface instead of hardcoding private model ids into builder flows.

See also

Was this page helpful?