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
| Field | Type | Description |
|---|---|---|
| apiKeyrequired | string | Bearer token. Defaults to PROMPTFLOE_API_KEY env var if unset. |
| baseUrl | string | Override the API endpoint. Defaults to https://api.promptfloe.com. |
| timeoutMs | number | Per-request timeout. Default 60_000 (60s). Streaming endpoints aren't bounded by this. |
| maxRetries | number | Auto-retry on 429 + 5xx. Default 2. Set 0 to disable. |
| retryBackoff | "exponential" | "linear" | Default exponential. Linear adds a fixed 1s per retry. |
| fetch | fn | Custom fetch implementation. Useful for telemetry, proxy, or testing. |
| headers | object | Extra headers attached to every request (e.g. for tracing). |
| workspaceId | string | Override the workspace ID. Defaults to the API key's workspace. |
| idempotencyKeyPrefix | string | Prefix 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