@anthropic-ai/sdk 0.116.0 → 0.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +1 -0
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +1 -0
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +7 -2
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +8 -3
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +1 -0
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +1 -0
- package/core/error.d.ts.map +1 -1
- package/core/error.js +1 -0
- package/core/error.js.map +1 -1
- package/core/error.mjs +1 -0
- package/core/error.mjs.map +1 -1
- package/core/middleware.js +1 -1
- package/core/middleware.js.map +1 -1
- package/core/middleware.mjs +2 -2
- package/core/middleware.mjs.map +1 -1
- package/helpers/beta/zod.d.mts.map +1 -1
- package/helpers/beta/zod.d.ts.map +1 -1
- package/helpers/beta/zod.js +1 -2
- package/helpers/beta/zod.js.map +1 -1
- package/helpers/beta/zod.mjs +1 -2
- package/helpers/beta/zod.mjs.map +1 -1
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +1 -2
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +1 -2
- package/helpers/zod.mjs.map +1 -1
- package/internal/parse.d.mts +2 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +6 -6
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -5
- package/internal/parse.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts +2 -0
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts +2 -0
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +20 -7
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +20 -7
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.d.mts +2 -0
- package/lib/MessageStream.d.mts.map +1 -1
- package/lib/MessageStream.d.ts +2 -0
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +17 -6
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +17 -6
- package/lib/MessageStream.mjs.map +1 -1
- package/lib/environments/worker.d.mts +10 -6
- package/lib/environments/worker.d.mts.map +1 -1
- package/lib/environments/worker.d.ts +10 -6
- package/lib/environments/worker.d.ts.map +1 -1
- package/lib/environments/worker.js +51 -18
- package/lib/environments/worker.js.map +1 -1
- package/lib/environments/worker.mjs +51 -18
- package/lib/environments/worker.mjs.map +1 -1
- package/lib/tools/BetaRunnableTool.d.mts +20 -42
- package/lib/tools/BetaRunnableTool.d.mts.map +1 -1
- package/lib/tools/BetaRunnableTool.d.ts +20 -42
- package/lib/tools/BetaRunnableTool.d.ts.map +1 -1
- package/lib/tools/BetaRunnableTool.js +3 -17
- package/lib/tools/BetaRunnableTool.js.map +1 -1
- package/lib/tools/BetaRunnableTool.mjs +3 -17
- package/lib/tools/BetaRunnableTool.mjs.map +1 -1
- package/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/lib/tools/BetaToolRunner.js +11 -12
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +11 -12
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/lib/tools/SessionToolRunner.d.mts +6 -0
- package/lib/tools/SessionToolRunner.d.mts.map +1 -1
- package/lib/tools/SessionToolRunner.d.ts +6 -0
- package/lib/tools/SessionToolRunner.d.ts.map +1 -1
- package/lib/tools/SessionToolRunner.js +37 -8
- package/lib/tools/SessionToolRunner.js.map +1 -1
- package/lib/tools/SessionToolRunner.mjs +38 -9
- package/lib/tools/SessionToolRunner.mjs.map +1 -1
- package/package.json +9 -15
- package/resources/beta/agents/agents.d.mts +3 -3
- package/resources/beta/agents/agents.d.ts +3 -3
- package/resources/beta/agents/agents.js +1 -1
- package/resources/beta/agents/agents.mjs +1 -1
- package/resources/beta/beta.d.mts +5 -5
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +5 -5
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/dreams.d.mts +48 -8
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +48 -8
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/environments/environments.d.mts +4 -3
- package/resources/beta/environments/environments.d.mts.map +1 -1
- package/resources/beta/environments/environments.d.ts +4 -3
- package/resources/beta/environments/environments.d.ts.map +1 -1
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/index.d.mts +1 -1
- package/resources/beta/memory-stores/index.d.mts.map +1 -1
- package/resources/beta/memory-stores/index.d.ts +1 -1
- package/resources/beta/memory-stores/index.d.ts.map +1 -1
- package/resources/beta/memory-stores/index.js.map +1 -1
- package/resources/beta/memory-stores/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.mts +2 -2
- package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.ts +2 -2
- package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +17 -2
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +17 -2
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/messages/batches.d.mts +1 -1
- package/resources/beta/messages/batches.d.ts +1 -1
- package/resources/beta/messages/batches.js +1 -1
- package/resources/beta/messages/batches.mjs +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +4 -22
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +4 -22
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +2 -2
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +2 -2
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +1 -1
- package/resources/beta/sessions/sessions.d.ts +1 -1
- package/resources/beta/user-profiles.d.mts +37 -11
- package/resources/beta/user-profiles.d.mts.map +1 -1
- package/resources/beta/user-profiles.d.ts +37 -11
- package/resources/beta/user-profiles.d.ts.map +1 -1
- package/resources/beta/user-profiles.js +5 -5
- package/resources/beta/user-profiles.mjs +5 -5
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/batches.d.mts +1 -1
- package/resources/messages/batches.d.ts +1 -1
- package/resources/messages/batches.js +1 -1
- package/resources/messages/batches.mjs +1 -1
- package/resources/messages/index.d.mts +1 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +4 -22
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +4 -22
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +2 -2
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +2 -2
- package/resources/messages/messages.mjs.map +1 -1
- package/src/client.ts +1 -3
- package/src/core/api-promise.ts +14 -4
- package/src/core/error.ts +2 -0
- package/src/core/middleware.ts +2 -2
- package/src/helpers/beta/zod.ts +1 -3
- package/src/helpers/zod.ts +1 -3
- package/src/internal/parse.ts +6 -6
- package/src/lib/BetaMessageStream.ts +23 -5
- package/src/lib/MessageStream.ts +19 -4
- package/src/lib/environments/worker.ts +56 -17
- package/src/lib/tools/BetaRunnableTool.ts +20 -44
- package/src/lib/tools/BetaToolRunner.ts +11 -12
- package/src/lib/tools/SessionToolRunner.ts +39 -6
- package/src/resources/beta/agents/agents.ts +3 -3
- package/src/resources/beta/beta.ts +7 -2
- package/src/resources/beta/dreams.ts +56 -7
- package/src/resources/beta/environments/environments.ts +4 -3
- package/src/resources/beta/index.ts +3 -1
- package/src/resources/beta/memory-stores/index.ts +1 -0
- package/src/resources/beta/memory-stores/memory-stores.ts +2 -0
- package/src/resources/beta/memory-stores/memory-versions.ts +21 -1
- package/src/resources/beta/messages/batches.ts +1 -1
- package/src/resources/beta/messages/index.ts +0 -1
- package/src/resources/beta/messages/messages.ts +3 -26
- package/src/resources/beta/sessions/sessions.ts +1 -1
- package/src/resources/beta/user-profiles.ts +46 -17
- package/src/resources/index.ts +0 -1
- package/src/resources/messages/batches.ts +1 -1
- package/src/resources/messages/index.ts +0 -1
- package/src/resources/messages/messages.ts +4 -27
- package/src/tools/agent-toolset/fs-util.ts +43 -23
- package/src/tools/agent-toolset/node.ts +1 -1
- package/src/tools/agent-toolset/skills.ts +127 -31
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.d.mts +14 -2
- package/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/tools/agent-toolset/fs-util.d.ts +14 -2
- package/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/tools/agent-toolset/fs-util.js +46 -24
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +45 -24
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/node.js +1 -1
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs +1 -1
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/tools/agent-toolset/skills.d.mts +26 -3
- package/tools/agent-toolset/skills.d.mts.map +1 -1
- package/tools/agent-toolset/skills.d.ts +26 -3
- package/tools/agent-toolset/skills.d.ts.map +1 -1
- package/tools/agent-toolset/skills.js +114 -29
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/skills.mjs +113 -30
- package/tools/agent-toolset/skills.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
import type { BetaToolResultContentBlockParam } from '../../resources/beta';
|
|
12
12
|
import { loggerFor, type Logger } from '../../internal/utils/log';
|
|
13
13
|
import { sleep } from '../../internal/utils/sleep';
|
|
14
|
-
import { isFatal4xx } from '../../internal/utils/backoff';
|
|
14
|
+
import { applyJitter, backoff, isFatal4xx } from '../../internal/utils/backoff';
|
|
15
15
|
import { linkAbort } from '../../internal/utils/abort';
|
|
16
16
|
import { AsyncQueue } from '../../internal/utils/async-queue';
|
|
17
17
|
import { buildHeaders } from '../../internal/headers';
|
|
@@ -27,7 +27,16 @@ const STREAM_BACKOFF_START_MS = 500;
|
|
|
27
27
|
const STREAM_BACKOFF_CAP_MS = 10_000;
|
|
28
28
|
const TOOL_TIMEOUT_MS = 120_000;
|
|
29
29
|
const DRAIN_TIMEOUT_MS = 30_000;
|
|
30
|
-
const
|
|
30
|
+
const SEND_BACKOFF_START_MS = 1_000;
|
|
31
|
+
const SEND_BACKOFF_CAP_MS = 30_000;
|
|
32
|
+
/**
|
|
33
|
+
* How long a transiently failing tool-result send keeps retrying when the
|
|
34
|
+
* runner is used on its own: the server's default work-item lease TTL.
|
|
35
|
+
* `EnvironmentWorker` overrides it with the live TTL from each lease heartbeat
|
|
36
|
+
* (`_setSendRetryWindow`), so a send is only abandoned once the lease can no
|
|
37
|
+
* longer be ours.
|
|
38
|
+
*/
|
|
39
|
+
const SEND_RETRY_WINDOW_MS = 5 * 60_000;
|
|
31
40
|
|
|
32
41
|
/** Block type accepted in a `user.tool_result` event's content — codegen'd, stays in sync with the API. */
|
|
33
42
|
type SessionContentBlock = NonNullable<BetaManagedAgentsUserToolResultEventParams['content']>[number];
|
|
@@ -310,6 +319,7 @@ export class SessionToolRunner implements AsyncIterable<DispatchedToolCall> {
|
|
|
310
319
|
readonly #awaitingConfirmation = new Map<string, DispatchedToolUseEvent>();
|
|
311
320
|
readonly #results = new AsyncQueue<DispatchedToolCall>();
|
|
312
321
|
#inFlightCount = 0;
|
|
322
|
+
#sendRetryWindowMs = SEND_RETRY_WINDOW_MS;
|
|
313
323
|
#onIdle: (() => void) | null = null;
|
|
314
324
|
readonly #idleClock: IdleClock;
|
|
315
325
|
|
|
@@ -343,6 +353,15 @@ export class SessionToolRunner implements AsyncIterable<DispatchedToolCall> {
|
|
|
343
353
|
this.#controller.abort();
|
|
344
354
|
}
|
|
345
355
|
|
|
356
|
+
/**
|
|
357
|
+
* @internal
|
|
358
|
+
* `EnvironmentWorker` keeps this equal to the lease TTL each heartbeat
|
|
359
|
+
* reports; applies to a send already retrying.
|
|
360
|
+
*/
|
|
361
|
+
_setSendRetryWindow(ms: number): void {
|
|
362
|
+
this.#sendRetryWindowMs = ms;
|
|
363
|
+
}
|
|
364
|
+
|
|
346
365
|
async *[Symbol.asyncIterator](): AsyncIterator<DispatchedToolCall> {
|
|
347
366
|
if (this.#consumed) {
|
|
348
367
|
throw new AnthropicError('Cannot iterate over a consumed SessionToolRunner');
|
|
@@ -764,8 +783,11 @@ export class SessionToolRunner implements AsyncIterable<DispatchedToolCall> {
|
|
|
764
783
|
|
|
765
784
|
async #sendResult(result: DispatchedToolResultParams, toolUseId: string): Promise<boolean> {
|
|
766
785
|
const ctrl = this.#controller;
|
|
786
|
+
const start = Date.now();
|
|
767
787
|
let lastErr: unknown;
|
|
768
|
-
|
|
788
|
+
let attempt = 0;
|
|
789
|
+
while (true) {
|
|
790
|
+
attempt++;
|
|
769
791
|
// An abort throws to unwind the caller rather than returning a
|
|
770
792
|
// `posted: false` result the iterator would carry on past.
|
|
771
793
|
ctrl.signal.throwIfAborted();
|
|
@@ -782,13 +804,24 @@ export class SessionToolRunner implements AsyncIterable<DispatchedToolCall> {
|
|
|
782
804
|
// Only short-circuit on a permanent 4xx; 408/409/429 deserve the
|
|
783
805
|
// remaining retries (aligned with the core client's retry policy).
|
|
784
806
|
if (isFatal4xx(e)) break;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
807
|
+
const remainingMs = this.#sendRetryWindowMs - (Date.now() - start);
|
|
808
|
+
if (remainingMs <= 0) break;
|
|
809
|
+
const waitMs = Math.min(
|
|
810
|
+
applyJitter(backoff(attempt - 1, SEND_BACKOFF_START_MS, SEND_BACKOFF_CAP_MS)),
|
|
811
|
+
remainingMs,
|
|
812
|
+
);
|
|
813
|
+
this.#logger.warn('tool result send failed; retrying', {
|
|
814
|
+
tool_use_id: toolUseId,
|
|
815
|
+
attempt,
|
|
816
|
+
backoff_ms: waitMs,
|
|
817
|
+
error: String(e),
|
|
818
|
+
});
|
|
819
|
+
await sleep(waitMs, ctrl.signal);
|
|
788
820
|
}
|
|
789
821
|
}
|
|
790
822
|
this.#logger.error('failed to send tool result', {
|
|
791
823
|
tool_use_id: toolUseId,
|
|
824
|
+
attempts: attempt,
|
|
792
825
|
error: String(lastErr),
|
|
793
826
|
});
|
|
794
827
|
return false;
|
|
@@ -21,7 +21,7 @@ export class Agents extends APIResource {
|
|
|
21
21
|
* ```ts
|
|
22
22
|
* const betaManagedAgentsAgent =
|
|
23
23
|
* await client.beta.agents.create({
|
|
24
|
-
* model: 'claude-
|
|
24
|
+
* model: 'claude-opus-5',
|
|
25
25
|
* name: 'My First Agent',
|
|
26
26
|
* });
|
|
27
27
|
* ```
|
|
@@ -915,7 +915,7 @@ export interface AgentCreateParams {
|
|
|
915
915
|
/**
|
|
916
916
|
* Body param: Model identifier. Accepts the
|
|
917
917
|
* [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison),
|
|
918
|
-
* e.g. `claude-opus-
|
|
918
|
+
* e.g. `claude-opus-5`, or a `model_config` object for additional configuration
|
|
919
919
|
* control
|
|
920
920
|
*/
|
|
921
921
|
model: BetaManagedAgentsModel | BetaManagedAgentsModelConfigParams;
|
|
@@ -1015,7 +1015,7 @@ export interface AgentUpdateParams {
|
|
|
1015
1015
|
/**
|
|
1016
1016
|
* Body param: Model identifier. Accepts the
|
|
1017
1017
|
* [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison),
|
|
1018
|
-
* e.g. `claude-opus-
|
|
1018
|
+
* e.g. `claude-opus-5`, or a `model_config` object for additional configuration
|
|
1019
1019
|
* control. Omit to preserve. Cannot be cleared.
|
|
1020
1020
|
*/
|
|
1021
1021
|
model?: BetaManagedAgentsModel | BetaManagedAgentsModelConfigParams;
|
|
@@ -89,6 +89,9 @@ import {
|
|
|
89
89
|
BetaDreamStatus,
|
|
90
90
|
BetaDreamUsage,
|
|
91
91
|
BetaDreamsPageCursor,
|
|
92
|
+
BetaOutputBehavior,
|
|
93
|
+
BetaOutputBehaviorCreateNew,
|
|
94
|
+
BetaOutputBehaviorUpdateExisting,
|
|
92
95
|
DreamArchiveParams,
|
|
93
96
|
DreamCancelParams,
|
|
94
97
|
DreamCreateParams,
|
|
@@ -400,7 +403,6 @@ import {
|
|
|
400
403
|
BetaMessageParam,
|
|
401
404
|
BetaMessageTokensCount,
|
|
402
405
|
BetaMetadata,
|
|
403
|
-
BetaMidConversationSystemBlockParam,
|
|
404
406
|
BetaOutputConfig,
|
|
405
407
|
BetaOutputTokensDetails,
|
|
406
408
|
BetaPlainTextSource,
|
|
@@ -643,6 +645,7 @@ export type AnthropicBeta =
|
|
|
643
645
|
| 'fast-mode-2026-02-01'
|
|
644
646
|
| 'output-300k-2026-03-24'
|
|
645
647
|
| 'user-profiles-2026-03-24'
|
|
648
|
+
| 'user-profiles-2026-08-18'
|
|
646
649
|
| 'advisor-tool-2026-03-01'
|
|
647
650
|
| 'managed-agents-2026-04-01'
|
|
648
651
|
| 'cache-diagnosis-2026-04-07'
|
|
@@ -921,7 +924,6 @@ export declare namespace Beta {
|
|
|
921
924
|
type BetaMessageParam as BetaMessageParam,
|
|
922
925
|
type BetaMessageTokensCount as BetaMessageTokensCount,
|
|
923
926
|
type BetaMetadata as BetaMetadata,
|
|
924
|
-
type BetaMidConversationSystemBlockParam as BetaMidConversationSystemBlockParam,
|
|
925
927
|
type BetaOutputConfig as BetaOutputConfig,
|
|
926
928
|
type BetaOutputTokensDetails as BetaOutputTokensDetails,
|
|
927
929
|
type BetaPlainTextSource as BetaPlainTextSource,
|
|
@@ -1361,6 +1363,9 @@ export declare namespace Beta {
|
|
|
1361
1363
|
type BetaDreamSessionsInput as BetaDreamSessionsInput,
|
|
1362
1364
|
type BetaDreamStatus as BetaDreamStatus,
|
|
1363
1365
|
type BetaDreamUsage as BetaDreamUsage,
|
|
1366
|
+
type BetaOutputBehavior as BetaOutputBehavior,
|
|
1367
|
+
type BetaOutputBehaviorCreateNew as BetaOutputBehaviorCreateNew,
|
|
1368
|
+
type BetaOutputBehaviorUpdateExisting as BetaOutputBehaviorUpdateExisting,
|
|
1364
1369
|
type BetaDreamsPageCursor as BetaDreamsPageCursor,
|
|
1365
1370
|
type DreamCreateParams as DreamCreateParams,
|
|
1366
1371
|
type DreamRetrieveParams as DreamRetrieveParams,
|
|
@@ -138,9 +138,10 @@ export type BetaDreamsPageCursor = PageCursor<BetaDream>;
|
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* An asynchronous memory-consolidation job that reads a memory store plus a set of
|
|
141
|
-
* session transcripts and writes consolidated memories into
|
|
142
|
-
*
|
|
143
|
-
*
|
|
141
|
+
* session transcripts and writes consolidated memories into an output memory store
|
|
142
|
+
* — a new store by default, or an existing store chosen via output_behavior. The
|
|
143
|
+
* Dreams API is in research preview: the request and response shapes are volatile
|
|
144
|
+
* and may change without the deprecation period that applies to
|
|
144
145
|
* generally-available endpoints.
|
|
145
146
|
*/
|
|
146
147
|
export interface BetaDream {
|
|
@@ -176,6 +177,13 @@ export interface BetaDream {
|
|
|
176
177
|
*/
|
|
177
178
|
model: BetaDreamModelConfig;
|
|
178
179
|
|
|
180
|
+
/**
|
|
181
|
+
* The default destination: the job creates a new output memory store as a clone of
|
|
182
|
+
* the memory_store input and writes the consolidated memories into it. The input
|
|
183
|
+
* store is never mutated.
|
|
184
|
+
*/
|
|
185
|
+
output_behavior: BetaOutputBehavior;
|
|
186
|
+
|
|
179
187
|
outputs: Array<BetaDreamOutput>;
|
|
180
188
|
|
|
181
189
|
session_id: string | null;
|
|
@@ -203,12 +211,16 @@ export interface BetaDreamError {
|
|
|
203
211
|
}
|
|
204
212
|
|
|
205
213
|
/**
|
|
206
|
-
* An input memory store the dream reads from. The dream never mutates this store
|
|
214
|
+
* An input memory store the dream reads from. The dream never mutates this store
|
|
215
|
+
* unless it is also the destination: with output_behavior {type:
|
|
216
|
+
* "update_existing"} the job consolidates this store in place.
|
|
207
217
|
*/
|
|
208
218
|
export type BetaDreamInput = BetaDreamMemoryStoreInput | BetaDreamSessionsInput;
|
|
209
219
|
|
|
210
220
|
/**
|
|
211
|
-
* An input memory store the dream reads from. The dream never mutates this store
|
|
221
|
+
* An input memory store the dream reads from. The dream never mutates this store
|
|
222
|
+
* unless it is also the destination: with output_behavior {type:
|
|
223
|
+
* "update_existing"} the job consolidates this store in place.
|
|
212
224
|
*/
|
|
213
225
|
export interface BetaDreamMemoryStoreInput {
|
|
214
226
|
memory_store_id: string;
|
|
@@ -231,7 +243,7 @@ export interface BetaDreamMemoryStoreOutput {
|
|
|
231
243
|
*/
|
|
232
244
|
export interface BetaDreamModelConfig {
|
|
233
245
|
/**
|
|
234
|
-
* Model identifier, e.g. "claude-opus-
|
|
246
|
+
* Model identifier, e.g. "claude-opus-5". 1-256 characters.
|
|
235
247
|
*/
|
|
236
248
|
id: string;
|
|
237
249
|
|
|
@@ -248,7 +260,7 @@ export interface BetaDreamModelConfig {
|
|
|
248
260
|
*/
|
|
249
261
|
export interface BetaDreamModelConfigParam {
|
|
250
262
|
/**
|
|
251
|
-
* Model identifier, e.g. "claude-opus-
|
|
263
|
+
* Model identifier, e.g. "claude-opus-5". 1-256 characters.
|
|
252
264
|
*/
|
|
253
265
|
id: string;
|
|
254
266
|
|
|
@@ -308,6 +320,33 @@ export interface BetaDreamUsage {
|
|
|
308
320
|
output_tokens: number;
|
|
309
321
|
}
|
|
310
322
|
|
|
323
|
+
/**
|
|
324
|
+
* The default destination: the job creates a new output memory store as a clone of
|
|
325
|
+
* the memory_store input and writes the consolidated memories into it. The input
|
|
326
|
+
* store is never mutated.
|
|
327
|
+
*/
|
|
328
|
+
export type BetaOutputBehavior = BetaOutputBehaviorCreateNew | BetaOutputBehaviorUpdateExisting;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* The default destination: the job creates a new output memory store as a clone of
|
|
332
|
+
* the memory_store input and writes the consolidated memories into it. The input
|
|
333
|
+
* store is never mutated.
|
|
334
|
+
*/
|
|
335
|
+
export interface BetaOutputBehaviorCreateNew {
|
|
336
|
+
type: 'create_new';
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* The job writes the consolidated memories into this existing memory store instead
|
|
341
|
+
* of creating one. In EAP the store must be the job's own memory_store input, so
|
|
342
|
+
* the job consolidates the store in place.
|
|
343
|
+
*/
|
|
344
|
+
export interface BetaOutputBehaviorUpdateExisting {
|
|
345
|
+
memory_store_id: string;
|
|
346
|
+
|
|
347
|
+
type: 'update_existing';
|
|
348
|
+
}
|
|
349
|
+
|
|
311
350
|
export interface DreamCreateParams {
|
|
312
351
|
/**
|
|
313
352
|
* Body param
|
|
@@ -324,6 +363,13 @@ export interface DreamCreateParams {
|
|
|
324
363
|
*/
|
|
325
364
|
instructions?: string | null;
|
|
326
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Body param: The default destination: the job creates a new output memory store
|
|
368
|
+
* as a clone of the memory_store input and writes the consolidated memories into
|
|
369
|
+
* it. The input store is never mutated.
|
|
370
|
+
*/
|
|
371
|
+
output_behavior?: BetaOutputBehavior;
|
|
372
|
+
|
|
327
373
|
/**
|
|
328
374
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
329
375
|
*/
|
|
@@ -394,6 +440,9 @@ export declare namespace Dreams {
|
|
|
394
440
|
type BetaDreamSessionsInput as BetaDreamSessionsInput,
|
|
395
441
|
type BetaDreamStatus as BetaDreamStatus,
|
|
396
442
|
type BetaDreamUsage as BetaDreamUsage,
|
|
443
|
+
type BetaOutputBehavior as BetaOutputBehavior,
|
|
444
|
+
type BetaOutputBehaviorCreateNew as BetaOutputBehaviorCreateNew,
|
|
445
|
+
type BetaOutputBehaviorUpdateExisting as BetaOutputBehaviorUpdateExisting,
|
|
397
446
|
type BetaDreamsPageCursor as BetaDreamsPageCursor,
|
|
398
447
|
type DreamCreateParams as DreamCreateParams,
|
|
399
448
|
type DreamRetrieveParams as DreamRetrieveParams,
|
|
@@ -260,9 +260,9 @@ export interface BetaEnvironment {
|
|
|
260
260
|
created_at: string;
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
|
-
* User-provided description for the environment
|
|
263
|
+
* User-provided description for the environment; null when unset
|
|
264
264
|
*/
|
|
265
|
-
description: string;
|
|
265
|
+
description: string | null;
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* User-provided metadata key-value pairs
|
|
@@ -525,7 +525,8 @@ export interface EnvironmentUpdateParams {
|
|
|
525
525
|
config?: BetaCloudConfigParams | BetaSelfHostedConfigParams | null;
|
|
526
526
|
|
|
527
527
|
/**
|
|
528
|
-
* Body param: Updated description of the environment
|
|
528
|
+
* Body param: Updated description of the environment. Omit to preserve; null
|
|
529
|
+
* clears to null; an empty string is stored as an empty string.
|
|
529
530
|
*/
|
|
530
531
|
description?: string | null;
|
|
531
532
|
|
|
@@ -156,6 +156,9 @@ export {
|
|
|
156
156
|
type BetaDreamSessionsInput,
|
|
157
157
|
type BetaDreamStatus,
|
|
158
158
|
type BetaDreamUsage,
|
|
159
|
+
type BetaOutputBehavior,
|
|
160
|
+
type BetaOutputBehaviorCreateNew,
|
|
161
|
+
type BetaOutputBehaviorUpdateExisting,
|
|
159
162
|
type DreamCreateParams,
|
|
160
163
|
type DreamRetrieveParams,
|
|
161
164
|
type DreamListParams,
|
|
@@ -333,7 +336,6 @@ export {
|
|
|
333
336
|
type BetaMessageParam,
|
|
334
337
|
type BetaMessageTokensCount,
|
|
335
338
|
type BetaMetadata,
|
|
336
|
-
type BetaMidConversationSystemBlockParam,
|
|
337
339
|
type BetaOutputConfig,
|
|
338
340
|
type BetaOutputTokensDetails,
|
|
339
341
|
type BetaPlainTextSource,
|
|
@@ -38,6 +38,7 @@ export {
|
|
|
38
38
|
type BetaManagedAgentsAPIActor,
|
|
39
39
|
type BetaManagedAgentsMemoryVersion,
|
|
40
40
|
type BetaManagedAgentsMemoryVersionOperation,
|
|
41
|
+
type BetaManagedAgentsServiceAccountActor,
|
|
41
42
|
type BetaManagedAgentsSessionActor,
|
|
42
43
|
type BetaManagedAgentsUserActor,
|
|
43
44
|
type MemoryVersionRetrieveParams,
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
BetaManagedAgentsMemoryVersion,
|
|
31
31
|
BetaManagedAgentsMemoryVersionOperation,
|
|
32
32
|
BetaManagedAgentsMemoryVersionsPageCursor,
|
|
33
|
+
BetaManagedAgentsServiceAccountActor,
|
|
33
34
|
BetaManagedAgentsSessionActor,
|
|
34
35
|
BetaManagedAgentsUserActor,
|
|
35
36
|
MemoryVersionListParams,
|
|
@@ -408,6 +409,7 @@ export declare namespace MemoryStores {
|
|
|
408
409
|
type BetaManagedAgentsAPIActor as BetaManagedAgentsAPIActor,
|
|
409
410
|
type BetaManagedAgentsMemoryVersion as BetaManagedAgentsMemoryVersion,
|
|
410
411
|
type BetaManagedAgentsMemoryVersionOperation as BetaManagedAgentsMemoryVersionOperation,
|
|
412
|
+
type BetaManagedAgentsServiceAccountActor as BetaManagedAgentsServiceAccountActor,
|
|
411
413
|
type BetaManagedAgentsSessionActor as BetaManagedAgentsSessionActor,
|
|
412
414
|
type BetaManagedAgentsUserActor as BetaManagedAgentsUserActor,
|
|
413
415
|
type BetaManagedAgentsMemoryVersionsPageCursor as BetaManagedAgentsMemoryVersionsPageCursor,
|
|
@@ -117,7 +117,8 @@ export type BetaManagedAgentsMemoryVersionsPageCursor = PageCursor<BetaManagedAg
|
|
|
117
117
|
export type BetaManagedAgentsActor =
|
|
118
118
|
| BetaManagedAgentsSessionActor
|
|
119
119
|
| BetaManagedAgentsAPIActor
|
|
120
|
-
| BetaManagedAgentsUserActor
|
|
120
|
+
| BetaManagedAgentsUserActor
|
|
121
|
+
| BetaManagedAgentsServiceAccountActor;
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Attribution for a write made directly via the public API (outside of any
|
|
@@ -228,6 +229,19 @@ export interface BetaManagedAgentsMemoryVersion {
|
|
|
228
229
|
*/
|
|
229
230
|
export type BetaManagedAgentsMemoryVersionOperation = 'created' | 'modified' | 'deleted';
|
|
230
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Attribution for a write made by a workload authenticated as a service account,
|
|
234
|
+
* for example via Workload Identity Federation.
|
|
235
|
+
*/
|
|
236
|
+
export interface BetaManagedAgentsServiceAccountActor {
|
|
237
|
+
/**
|
|
238
|
+
* ID of the service account that performed the write (a `svac_...` value).
|
|
239
|
+
*/
|
|
240
|
+
service_account_id: string;
|
|
241
|
+
|
|
242
|
+
type: 'service_account_actor';
|
|
243
|
+
}
|
|
244
|
+
|
|
231
245
|
/**
|
|
232
246
|
* Attribution for a write made by an agent during a session, through the mounted
|
|
233
247
|
* filesystem at `/mnt/memory/`.
|
|
@@ -298,6 +312,11 @@ export interface MemoryVersionListParams extends PageCursorParams {
|
|
|
298
312
|
*/
|
|
299
313
|
operation?: BetaManagedAgentsMemoryVersionOperation;
|
|
300
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Query param: Query parameter for service_account_id
|
|
317
|
+
*/
|
|
318
|
+
service_account_id?: string;
|
|
319
|
+
|
|
301
320
|
/**
|
|
302
321
|
* Query param: Query parameter for session_id
|
|
303
322
|
*/
|
|
@@ -332,6 +351,7 @@ export declare namespace MemoryVersions {
|
|
|
332
351
|
type BetaManagedAgentsAPIActor as BetaManagedAgentsAPIActor,
|
|
333
352
|
type BetaManagedAgentsMemoryVersion as BetaManagedAgentsMemoryVersion,
|
|
334
353
|
type BetaManagedAgentsMemoryVersionOperation as BetaManagedAgentsMemoryVersionOperation,
|
|
354
|
+
type BetaManagedAgentsServiceAccountActor as BetaManagedAgentsServiceAccountActor,
|
|
335
355
|
type BetaManagedAgentsSessionActor as BetaManagedAgentsSessionActor,
|
|
336
356
|
type BetaManagedAgentsUserActor as BetaManagedAgentsUserActor,
|
|
337
357
|
type BetaManagedAgentsMemoryVersionsPageCursor as BetaManagedAgentsMemoryVersionsPageCursor,
|
|
@@ -70,7 +70,7 @@ export class Messages extends APIResource {
|
|
|
70
70
|
* const betaMessage = await client.beta.messages.create({
|
|
71
71
|
* max_tokens: 1024,
|
|
72
72
|
* messages: [{ content: 'Hello, world', role: 'user' }],
|
|
73
|
-
* model: 'claude-opus-
|
|
73
|
+
* model: 'claude-opus-5',
|
|
74
74
|
* });
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
@@ -110,7 +110,7 @@ export class Messages extends APIResource {
|
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
let timeout = (this._client as any)._options.timeout as number | null;
|
|
113
|
+
let timeout = options?.timeout ?? ((this._client as any)._options.timeout as number | null);
|
|
114
114
|
if (!body.stream && timeout == null) {
|
|
115
115
|
const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
|
|
116
116
|
timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
|
|
@@ -192,7 +192,7 @@ export class Messages extends APIResource {
|
|
|
192
192
|
* const betaMessageTokensCount =
|
|
193
193
|
* await client.beta.messages.countTokens({
|
|
194
194
|
* messages: [{ content: 'Hello, world', role: 'user' }],
|
|
195
|
-
* model: 'claude-opus-
|
|
195
|
+
* model: 'claude-opus-5',
|
|
196
196
|
* });
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
@@ -1419,7 +1419,6 @@ export type BetaContentBlockParam =
|
|
|
1419
1419
|
| BetaRequestMCPToolResultBlockParam
|
|
1420
1420
|
| BetaContainerUploadBlockParam
|
|
1421
1421
|
| BetaCompactionBlockParam
|
|
1422
|
-
| BetaMidConversationSystemBlockParam
|
|
1423
1422
|
| BetaRequestToolAdditionBlock
|
|
1424
1423
|
| BetaRequestToolRemovalBlock
|
|
1425
1424
|
| BetaFallbackBlockParam;
|
|
@@ -2418,27 +2417,6 @@ export interface BetaMetadata {
|
|
|
2418
2417
|
user_id?: string | null;
|
|
2419
2418
|
}
|
|
2420
2419
|
|
|
2421
|
-
/**
|
|
2422
|
-
* System instructions that appear mid-conversation.
|
|
2423
|
-
*
|
|
2424
|
-
* Use this block to provide or update system-level instructions at a specific
|
|
2425
|
-
* point in the conversation, rather than only via the top-level `system`
|
|
2426
|
-
* parameter.
|
|
2427
|
-
*/
|
|
2428
|
-
export interface BetaMidConversationSystemBlockParam {
|
|
2429
|
-
/**
|
|
2430
|
-
* System instruction text blocks.
|
|
2431
|
-
*/
|
|
2432
|
-
content: Array<BetaTextBlockParam | BetaRequestToolAdditionBlock | BetaRequestToolRemovalBlock>;
|
|
2433
|
-
|
|
2434
|
-
type: 'mid_conv_system';
|
|
2435
|
-
|
|
2436
|
-
/**
|
|
2437
|
-
* Create a cache control breakpoint at this content block.
|
|
2438
|
-
*/
|
|
2439
|
-
cache_control?: BetaCacheControlEphemeral | null;
|
|
2440
|
-
}
|
|
2441
|
-
|
|
2442
2420
|
export interface BetaOutputConfig {
|
|
2443
2421
|
/**
|
|
2444
2422
|
* All possible effort levels.
|
|
@@ -5560,7 +5538,6 @@ export declare namespace Messages {
|
|
|
5560
5538
|
type BetaMessageParam as BetaMessageParam,
|
|
5561
5539
|
type BetaMessageTokensCount as BetaMessageTokensCount,
|
|
5562
5540
|
type BetaMetadata as BetaMetadata,
|
|
5563
|
-
type BetaMidConversationSystemBlockParam as BetaMidConversationSystemBlockParam,
|
|
5564
5541
|
type BetaOutputConfig as BetaOutputConfig,
|
|
5565
5542
|
type BetaOutputTokensDetails as BetaOutputTokensDetails,
|
|
5566
5543
|
type BetaPlainTextSource as BetaPlainTextSource,
|
|
@@ -370,7 +370,7 @@ export interface BetaManagedAgentsAgentWithOverridesParams {
|
|
|
370
370
|
mcp_servers?: Array<AgentsAPI.BetaManagedAgentsURLMCPServerParams>;
|
|
371
371
|
|
|
372
372
|
/**
|
|
373
|
-
* Replacement model. Accepts the model string, e.g. `claude-opus-
|
|
373
|
+
* Replacement model. Accepts the model string, e.g. `claude-opus-5`, or a
|
|
374
374
|
* `model_config` object. Omit to use the agent's model.
|
|
375
375
|
*/
|
|
376
376
|
model?: AgentsAPI.BetaManagedAgentsModel | AgentsAPI.BetaManagedAgentsModelConfigParams;
|
|
@@ -24,7 +24,7 @@ export class UserProfiles extends APIResource {
|
|
|
24
24
|
body,
|
|
25
25
|
...options,
|
|
26
26
|
headers: buildHeaders([
|
|
27
|
-
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-
|
|
27
|
+
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
|
|
28
28
|
options?.headers,
|
|
29
29
|
]),
|
|
30
30
|
});
|
|
@@ -50,7 +50,7 @@ export class UserProfiles extends APIResource {
|
|
|
50
50
|
return this._client.get(path`/v1/user_profiles/${userProfileID}?beta=true`, {
|
|
51
51
|
...options,
|
|
52
52
|
headers: buildHeaders([
|
|
53
|
-
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-
|
|
53
|
+
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
|
|
54
54
|
options?.headers,
|
|
55
55
|
]),
|
|
56
56
|
});
|
|
@@ -77,7 +77,7 @@ export class UserProfiles extends APIResource {
|
|
|
77
77
|
body,
|
|
78
78
|
...options,
|
|
79
79
|
headers: buildHeaders([
|
|
80
|
-
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-
|
|
80
|
+
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
|
|
81
81
|
options?.headers,
|
|
82
82
|
]),
|
|
83
83
|
});
|
|
@@ -103,7 +103,7 @@ export class UserProfiles extends APIResource {
|
|
|
103
103
|
query,
|
|
104
104
|
...options,
|
|
105
105
|
headers: buildHeaders([
|
|
106
|
-
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-
|
|
106
|
+
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
|
|
107
107
|
options?.headers,
|
|
108
108
|
]),
|
|
109
109
|
});
|
|
@@ -129,7 +129,7 @@ export class UserProfiles extends APIResource {
|
|
|
129
129
|
return this._client.post(path`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {
|
|
130
130
|
...options,
|
|
131
131
|
headers: buildHeaders([
|
|
132
|
-
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-
|
|
132
|
+
{ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
|
|
133
133
|
options?.headers,
|
|
134
134
|
]),
|
|
135
135
|
});
|
|
@@ -155,13 +155,6 @@ export interface BetaUserProfile {
|
|
|
155
155
|
*/
|
|
156
156
|
metadata: { [key: string]: string };
|
|
157
157
|
|
|
158
|
-
/**
|
|
159
|
-
* How the entity behind a user profile relates to the platform that owns the API
|
|
160
|
-
* key. `external`: an individual end-user of the platform. `resold`: a company the
|
|
161
|
-
* platform resells Claude access to. `internal`: the platform's own usage.
|
|
162
|
-
*/
|
|
163
|
-
relationship: 'external' | 'resold' | 'internal';
|
|
164
|
-
|
|
165
158
|
/**
|
|
166
159
|
* Trust grants for this profile, keyed by grant name. Key omitted when no grant is
|
|
167
160
|
* active or in flight.
|
|
@@ -178,16 +171,33 @@ export interface BetaUserProfile {
|
|
|
178
171
|
*/
|
|
179
172
|
updated_at: string;
|
|
180
173
|
|
|
174
|
+
/**
|
|
175
|
+
* How the platform uses the API on behalf of the entity this profile represents.
|
|
176
|
+
* `application`: the platform sells a product that uses the API behind the scenes,
|
|
177
|
+
* and the profile represents an individual end-user of that product.
|
|
178
|
+
* `passthrough`: the platform resells raw inference, and the profile identifies
|
|
179
|
+
* the resold-to company.
|
|
180
|
+
*/
|
|
181
|
+
access_type?: 'application' | 'passthrough';
|
|
182
|
+
|
|
181
183
|
/**
|
|
182
184
|
* Platform's own identifier for this user. Not enforced unique.
|
|
183
185
|
*/
|
|
184
186
|
external_id?: string | null;
|
|
185
187
|
|
|
186
188
|
/**
|
|
187
|
-
*
|
|
188
|
-
* resold-to company
|
|
189
|
+
* Real-world name of the entity this profile represents (company or individual).
|
|
190
|
+
* For a resold-to company (`access_type` `passthrough`, or `relationship` `resold`
|
|
191
|
+
* under the `user-profiles-2026-03-24` header) this is that company's name.
|
|
189
192
|
*/
|
|
190
193
|
name?: string | null;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* How the entity behind a user profile relates to the platform that owns the API
|
|
197
|
+
* key. `external`: an individual end-user of the platform. `resold`: a company the
|
|
198
|
+
* platform resells Claude access to. `internal`: the platform's own usage.
|
|
199
|
+
*/
|
|
200
|
+
relationship?: 'external' | 'resold' | 'internal';
|
|
191
201
|
}
|
|
192
202
|
|
|
193
203
|
export interface BetaUserProfileEnrollmentURL {
|
|
@@ -215,6 +225,15 @@ export interface BetaUserProfileTrustGrant {
|
|
|
215
225
|
}
|
|
216
226
|
|
|
217
227
|
export interface UserProfileCreateParams {
|
|
228
|
+
/**
|
|
229
|
+
* Body param: How the platform uses the API on behalf of the entity this profile
|
|
230
|
+
* represents. `application`: the platform sells a product that uses the API behind
|
|
231
|
+
* the scenes, and the profile represents an individual end-user of that product.
|
|
232
|
+
* `passthrough`: the platform resells raw inference, and the profile identifies
|
|
233
|
+
* the resold-to company.
|
|
234
|
+
*/
|
|
235
|
+
access_type?: 'application' | 'passthrough';
|
|
236
|
+
|
|
218
237
|
/**
|
|
219
238
|
* Body param: Platform's own identifier for this user. Not enforced unique.
|
|
220
239
|
* Maximum 255 characters.
|
|
@@ -229,9 +248,10 @@ export interface UserProfileCreateParams {
|
|
|
229
248
|
metadata?: { [key: string]: string };
|
|
230
249
|
|
|
231
250
|
/**
|
|
232
|
-
* Body param:
|
|
233
|
-
*
|
|
234
|
-
*
|
|
251
|
+
* Body param: Optional for all profiles. Real-world name of the entity this
|
|
252
|
+
* profile represents (company or individual); for a resold-to company
|
|
253
|
+
* (`relationship` `resold` / `access_type` `passthrough`), that company's name
|
|
254
|
+
* where known. Maximum 255 characters.
|
|
235
255
|
*/
|
|
236
256
|
name?: string | null;
|
|
237
257
|
|
|
@@ -257,6 +277,15 @@ export interface UserProfileRetrieveParams {
|
|
|
257
277
|
}
|
|
258
278
|
|
|
259
279
|
export interface UserProfileUpdateParams {
|
|
280
|
+
/**
|
|
281
|
+
* Body param: How the platform uses the API on behalf of the entity this profile
|
|
282
|
+
* represents. `application`: the platform sells a product that uses the API behind
|
|
283
|
+
* the scenes, and the profile represents an individual end-user of that product.
|
|
284
|
+
* `passthrough`: the platform resells raw inference, and the profile identifies
|
|
285
|
+
* the resold-to company.
|
|
286
|
+
*/
|
|
287
|
+
access_type?: 'application' | 'passthrough' | null;
|
|
288
|
+
|
|
260
289
|
/**
|
|
261
290
|
* Body param: If present, replaces the stored external_id. Omit to leave
|
|
262
291
|
* unchanged. Maximum 255 characters.
|
package/src/resources/index.ts
CHANGED