PromptFloe Developer Docs
Client SDKs

Client options

All SDK clients accept the same set of configuration knobs. Set sensible defaults at construction; override per-call when needed.

#Configuration options

FieldTypeDescription
apiKeyrequiredstringBearer token. Defaults to PROMPTFLOE_API_KEY env var if unset.
baseUrlstringOverride the API endpoint. Defaults to https://api.promptfloe.com.
timeoutMsnumberPer-request timeout. Default 60_000 (60s). Streaming endpoints aren't bounded by this.
maxRetriesnumberAuto-retry on 429 + 5xx. Default 2. Set 0 to disable.
retryBackoff"exponential" | "linear"Default exponential. Linear adds a fixed 1s per retry.
fetchfnCustom fetch implementation. Useful for telemetry, proxy, or testing.
headersobjectExtra headers attached to every request (e.g. for tracing).
workspaceIdstringOverride the workspace ID. Defaults to the API key's workspace.
idempotencyKeyPrefixstringPrefix used for auto-generated Idempotency-Key headers on writes.

#Examples

const client = new PromptFloe({
  apiKey: process.env.PROMPTFLOE_API_KEY,
  baseUrl: 'https://api.promptfloe.com',
  timeoutMs: 30_000,
  maxRetries: 3,
  headers: {
    'X-Trace-Id': traceId,
  },
});

#Per-call overrides

Most options can be overridden on individual calls — useful for a single slow operation that needs a longer timeout, or to bypass retries for an idempotency-sensitive write.

await client.apps.generate(
  { prompt: '...' },
  {
    timeoutMs: 120_000,    // 2 minute timeout for this call
    maxRetries: 0,         // don't retry
    signal: ac.signal,     // cancellation
  },
);

#Where to go next

PromptFloe developer docs