diff --git a/packages/sdk/README.md b/packages/sdk/README.md index afd5ef1..fa5bf2c 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -161,8 +161,8 @@ const pinned = await getPrompt("support/reply", { version: 13 }); its prompt. - getPrompt uses the API key and base URL of an enabled `init()`, or `TELEMETRY_DEV_API_KEY` and `TELEMETRY_DEV_BASE_URL`, or its own `apiKey`, `baseUrl`, and `fetch` options. It reads the same - host that telemetry goes to, `https://api.telemetry.dev` by default. The key needs the read - scope for prompts. + host that telemetry goes to, `https://api.telemetry.dev` by default. The key must have Read + prompts in its Access on the API keys page (the `prompts:read` scope). - When a label sends part of the traffic to a second version, each session keeps one version: the choice uses the session id of `propagateAttributes` (or of `sessionMode: "process"`). Without a session id, each call chooses at random. diff --git a/packages/sdk/src/prompts.ts b/packages/sdk/src/prompts.ts index 2e27b17..1f557b2 100644 --- a/packages/sdk/src/prompts.ts +++ b/packages/sdk/src/prompts.ts @@ -116,7 +116,10 @@ interface GetPromptOptionsBase { version?: number; /** Seconds before a call fetches a kept prompt again, in the background. Default 60. */ cacheTtlSeconds?: number; - /** API key with the prompts:read scope. Falls back to the initialized client, then `TELEMETRY_DEV_API_KEY`. */ + /** + * API key with Read prompts in its Access (the prompts:read scope). Falls back to the initialized + * client, then `TELEMETRY_DEV_API_KEY`. + */ apiKey?: string; /** Falls back to the initialized client, then `TELEMETRY_DEV_BASE_URL`, then `https://api.telemetry.dev`. */ baseUrl?: string; diff --git a/sdks/python/README.md b/sdks/python/README.md index b785d10..95cfb6f 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -232,8 +232,8 @@ pinned = telemetry_dev.get_prompt("support/reply", version=13) without its prompt. - `get_prompt` uses the API key and base URL of an enabled `init()`, or `TELEMETRY_DEV_API_KEY` and `TELEMETRY_DEV_BASE_URL`, or its own `api_key` and `base_url`. It reads the same host that - telemetry goes to, `https://api.telemetry.dev` by default. The key needs the read scope for - prompts. + telemetry goes to, `https://api.telemetry.dev` by default. The key must have Read prompts in + its Access on the API keys page (the `prompts:read` scope). - When a label sends part of the traffic to a second version, each session keeps one version: the choice uses the session id of `propagate_attributes` (or of `session_mode="process"`). Without a session id, each call chooses at random.