Skip to main content
Generated by node scripts/reference.mjs in the TypeScript package. Covers atlaso, atlaso/ai-sdk, and atlaso/testing, including referenced local types. Run with --check to detect drift or missing public documentation.

AddResult

safeToRepeat applies when the returned idempotencyKey is reused with the same text within 24 hours. A fresh key may store another fact.

AiSdkProviderRouting

The provider field as JSON the AI SDK’s provider options accept.

AiSdkRoutingOptions

What routing() from “atlaso/ai-sdk” returns: pass it as providerOptions.

AiSdkToolOptions

Controls which memory tools the AI SDK adapter exposes.

AiSdkToolOptions.allowForget

Adds forget. Off by default so a model that misreads a turn cannot delete.

AiSdkToolOptions.receipt

Receipts whose memoryIds forget may delete, besides ids the model listed.

answeredBy

The provider that answered a call, as a name routing() accepts (such as “bedrock”), read from the receipt’s model id; null when no provider answered. receipt.providerHost is the host name of the server that answered.

AnthropicLike

Minimal surface of the official Anthropic client; the package is an optional peer.

AnthropicLike.baseURL

Anthropic’s origin-only base URL.

AnthropicLike.withOptions

Create a copy that preserves the shared client and transport.

AppUserUsage

One app-user aggregate in the requested date window.

AppUserUsage.appUserLabel

One-way label for this app user.

AppUserUsage.calls

Number of calls in the window.

AppUserUsage.cost_usd

USD cost, or null when a cost in the window is unknown.

AppUserUsage.cost_complete

Whether every billed call has a known cost.

AppUserUsage.estimated

True when interrupted or other estimated usage contributes to this total.

AppUserUsage.unpriced_calls

Calls whose price is not yet known.

AppUserUsage.refused_calls

Refused calls in the window.

AppUserUsage.first_call

First call timestamp in the window, when the gateway supplies it.

AppUserUsage.last_call

Last call timestamp in the window, when the gateway supplies it.

Atlaso

Client library entry point. Holds no user; create a scope per request.

Atlaso.calls

Developer-key call lookup.

Atlaso.usage

App-user usage pages.

Atlaso.baseURL

Gateway base URL used for requests and scope validation.

Atlaso.constructor

Create Atlaso with the supplied configuration.

Atlaso.clientOptions

Spread into your provider client’s constructor. Carries no user.

Atlaso.memory

Your own memory, with a “Me” key: add, addMany, list, search, update and delete. No erase. A key set to “Memory for each user of my app” uses forUser(id).memory instead (this one answers memory_scope_per_user); a key whose memory is Off answers memory_off. With a browser token, the token’s fixed user’s memory, as before.

Atlaso.shared

Shared facts for this server key’s project.

Atlaso.anthropicOptions

Spread into new Anthropic(...); Anthropic appends /v1/messages itself.

Atlaso.openai

The shared OpenAI client built on first use from new Atlaso({ OpenAI }). It carries no user. With a key whose memory is for “Me”, calls use your own memory; with a per-user key, a call without a user goes out with no memory. For your app’s users, use forUser(id).openai().

Atlaso.anthropic

The shared Anthropic client built on first use from new Atlaso({ Anthropic }). It carries no user.

Atlaso.forUser

Scope one request (or one run) to one app user. Create it per request; do not store it globally.

Atlaso.revokeBrowserToken

Revoke one browser token by public id on your server.

Atlaso.readReceipt

Read a call’s receipt from .withResponse(). Never changes the data or chunks.

Atlaso.receiptFromHeaders

For frameworks that expose only reply headers.

Atlaso.classify

Any error (ours, the provider client’s, or a network failure) into typed info.

Atlaso.toJSON

Keeps the key out of logs and console output.

AtlasoAiSdk

Shared AI SDK adapter, with per-user model and memory scopes.

AtlasoAiSdk.atlaso

The core client: memory API, receipts, classify. Holds no user.

AtlasoAiSdk.forUser

Create models and memory tools for this request’s user.

AtlasoAiSdk.forToken

Models and memory bound to a browser token, without a user header.

AtlasoAiSdkScope

AI SDK models and memory tools bound to one user.

AtlasoAiSdkScope.userId

The user attached to this scope, never a shared client default.

AtlasoAiSdkScope.headers

For streamText({ headers }) when you keep your own provider.

AtlasoAiSdkScope.chat

Chat Completions model for this user.

AtlasoAiSdkScope.responses

Responses model for this user (needs @ai-sdk/openai).

AtlasoAiSdkScope.memory

Memory metadata or operations scoped to this user.

AtlasoAiSdkScope.tools

Memory tools for this user: remember, list_memories, search_memories, and forget only with allowForget.

AtlasoAiSdkTokenScope

AI SDK models for a browser token’s fixed user.

AtlasoAiSdkTokenScope.chat

Chat Completions model using the browser token.

AtlasoAiSdkTokenScope.responses

Responses model using the browser token.

AtlasoAiSdkTokenScope.memory

Memory API bound to the token.

AtlasoAiSdkTokenScope.tools

Memory tools bound to the token.

AtlasoError

Base class for every error this library throws.

AtlasoError.info

Structured error details used by application error handling.

AtlasoError.idempotencyKey

Write key to reuse with the same body when an idempotent write is uncertain.

AtlasoError.constructor

Create AtlasoError with the supplied configuration.

AtlasoError.code

Gateway error code, or null for an unclassified failure.

AtlasoError.kind

Typed category describing the observed result.

AtlasoError.status

Reported status; unavailable HTTP status is null.

AtlasoLanguageModel

The language model type of the installed AI SDK provider packages.

AtlasoOptions

Options shared by every scope created from this client.

AtlasoOptions.OpenAI

The OpenAI class (import OpenAI from "openai"), so forUser(id).openai() needs no client of your own.

AtlasoOptions.Anthropic

The Anthropic class (import Anthropic from "@anthropic-ai/sdk"), for forUser(id).anthropic().

AtlasoOptions.clientHeader

Set false to omit the automatic library name/version header.

AtlasoOptions.apiKey

Defaults to the ATLASO_KEY environment variable when one is readable.

AtlasoOptions.baseURL

Defaults to https://api.atlaso.ai/v1.

AtlasoOptions.fetch

Your own fetch (for tests or a custom agent). Also used by the clients behind openai() and anthropic().

AtlasoOptions.timeoutMs

Memory API (default 30000), and the clients behind openai() / anthropic() when you set it (else the provider’s default).

AtlasoOptions.maxRetries

Memory API and the clients behind openai() / anthropic(). Default 2.

AtlasoOptions.browserToken

Short-lived bearer value or an async function that returns and refreshes one.

BrowserToken

The minted token and its server-reported lifetime. Treat token as a secret.

BrowserToken.id

Public token id for revocation.

BrowserToken.token

Bearer value. Send this only to the intended user.

BrowserToken.expiresIn

Seconds remaining at mint.

BrowserToken.expiresAt

Unix expiry time in seconds.

BrowserTokenLimits

Limits applied by the gateway to a browser token.

BrowserTokenLimits.models

Exact model ids this token may use.

BrowserTokenLimits.dailySpendUsd

Maximum daily spend for this user, as decimal USD.

BrowserTokenLimits.memory

Memory permission. Defaults to read_only.

BrowserTokenOptions

Options for a server-side token mint.

BrowserTokenOptions.ttlSeconds

Lifetime in seconds, from 60 to 3600.

BrowserTokenOptions.limits

Optional restrictions on the token.

BrowserTokenRevoke

Result of revoking one token.

BrowserTokenRevoke.id

Public token id.

BrowserTokenRevoke.revoked

Whether an active token was revoked.

BrowserTokenSource

Source for a browser token, including a server route that refreshes it.

BrowserTokensRevoke

Result of revoking all tokens for one user.

BrowserTokensRevoke.revoked

Number of active tokens revoked.

CallsApi

Read a call by id; recent calls may need a short wait for receipt storage.

CallsApi.get

Poll 404 call_not_ready and in_progress rows until waitMs expires; other 404s are final.

ConfigurationError

A setup mistake found before any request left the process.

ConfigurationError.constructor

Create ConfigurationError with the supplied configuration.

ConnectionError

No reply came back (timeout or connection failure).

ConnectionError.constructor

Create ConnectionError with the supplied configuration.

CoreAtlaso

The part of the core Atlaso this adapter needs.

CoreAtlaso.baseURL

Gateway base URL used for requests and scope validation.

CoreAtlaso.clientOptions

Provider constructor options; contains no user header.

CoreAtlaso.forUser

Create a scope for one user in the current project.

CoreAtlaso.memory

Your own memory with a “Me” key (no erase), or a browser token’s fixed user’s memory.

CoreAtlaso.receiptFromHeaders

Parse gateway reply headers into typed metadata.

CoreAtlaso.classify

Classify an exception without logging it.

CoreOptions

Core Atlaso options accepted by the AI SDK adapter.

CoreScope

The part of the core UserScope this adapter needs.

CoreScope.userId

The user attached to this scope, never a shared client default.

CoreScope.headers

Copy the scope’s headers for a single framework request.

CoreScope.memory

Memory metadata or operations scoped to this user.

createAtlaso

Build an AI SDK adapter. Create its user scope inside each request.

CreateAtlasoOptions

Core client configuration and optional AI SDK provider factories.

CreateAtlasoOptions.atlaso

Reuse a core client you already built. Its options are not read back: pass the same fetch here too if you gave it a custom one.

CreateAtlasoOptions.includeUsage

Passed to the provider package as is. When true the stream asks for usage and the receipt gets its cost in-band. Left unset, nothing is added to the request and stream receipts say usage_not_requested.

CreateAtlasoOptions.createOpenAI

createOpenAI from @ai-sdk/openai, for .responses(). Optional: without it the package is imported on the first Responses call. Pass it when your bundler cannot resolve that lazy import.

createFakeGateway

Create an offline gateway using synthetic users, facts, and scripted replies.

CursorInvalidError

The list cursor no longer exists (400 invalid_after). The iterator never restarts silently.

CursorInvalidError.constructor

Create CursorInvalidError with the supplied configuration.

DeleteResult

A completed deletion, an absent fact, or a pending deletion with resume().

EngineFacets

Field 3.0 facets. Absent until the wire carries them.

EngineFacets.polarity

Optional stance of the fact.

EngineFacets.evidenceGrade

Optional evidence quality reported by the engine.

EngineFacets.scope

Optional engine scope facets.

EngineFacets.contradicts

Optional identifiers of facts this fact contradicts.

EraseResult

A completed user erase or a pending erase with resume().

ErrorInfo

Typed facts about any error. Plain data: safe to compare, never logged by this library.

ErrorInfo.code

Gateway error code, or null for an unclassified failure.

ErrorInfo.kind

Typed category describing the observed result.

ErrorInfo.status

Reported status; unavailable HTTP status is null.

ErrorInfo.type

Error type reported by the gateway, or null when absent.

ErrorInfo.param

Parameter associated with the error, or null when absent.

ErrorInfo.message

Error explanation. Treat remote messages as untrusted text.

ErrorInfo.requestId

Gateway request identifier, or null when unavailable.

ErrorInfo.retryable

Eligibility only. An uncertain write (a memory add) is never repeated on this alone.

ErrorInfo.retryAfterMs

Suggested delay before another attempt, in milliseconds.

ErrorInfo.docUrl

Documentation URL supplied with the error, or null when absent.

ErrorInfo.known

True only for an exact status and code pair from the wire table.

ErrorInfo.inStream

Whether the error occurred while consuming a stream.

ErrorKind

Stable error categories for application handling.

Fact

The synthetic gateway’s wire-format memory fact.

Fact.id

Stable identifier of the stored fact.

Fact.text

Stored synthetic fact text.

Fact.source

Origin label supplied by the gateway.

Fact.created

Synthetic fact creation time as Unix seconds.

Fact.app_user

Synthetic short app-user label.

Fact.object

Wire object discriminator for a fact.

FakeGateway

Deterministic in-process gateway. It never contacts a network destination.

FakeGateway.apiKey

Obviously synthetic key for this offline fake.

FakeGateway.baseURL

Gateway base URL used for requests and scope validation.

FakeGateway.requests

Recorded synthetic requests in arrival order.

FakeGateway.constructor

Create FakeGateway with the supplied configuration.

FakeGateway.next

Queue a synthetic reply or fault; returns this fake for chaining.

FakeGateway.users

A copied snapshot of the default project’s synthetic users.

FakeGateway.snapshot

Copy all synthetic stores belonging to one project.

FakeGateway.owner

Copy a “Me” key’s own facts: a project’s, or the personal ones (project null).

FakeGateway.shared

Copy one project’s shared facts.

FakeGateway.fetch

Bound function: pass directly as a client’s fetch option. Never calls the network.

FakeOptions

Synthetic gateway stores, keys, deterministic seed, and fault scripts.

FakeOptions.users

Synthetic facts grouped by user in the default project.

FakeOptions.shared

Initial shared facts grouped by project.

FakeOptions.projects

Additional synthetic project stores, each isolated by project and user.

FakeOptions.seed

Unsigned 32-bit seed controlling deterministic fact identifiers.

FakeOptions.baseURL

Gateway base URL used for requests and scope validation.

FakeOptions.keys

Synthetic bearer keys mapped to independent key settings.

FakeOptions.scripts

Queued synthetic replies and faults.

FakeOptions.costUsd

Synthetic cost expressed as a decimal string.

GatewayCall

Content-free call record returned by the developer-key lookup.

GatewayCall.id

Gateway call id.

GatewayCall.object

Wire object kind.

GatewayCall.outcome

In-progress calls have not settled. Interrupted calls use the last checkpoint.

GatewayCall.estimated

True for checkpoints and interrupted estimates; a late final can replace them.

GatewayCall.cost

Provider list price, with the estimate explicitly labelled.

GatewayCall.call

Other gateway call fields, including cost, tokens and memory metadata.

InvalidRequestError

An argument refused before anything was sent (for example a malformed fact id). Kind invalid_request, never retryable: resending the same arguments cannot succeed.

InvalidRequestError.constructor

Create InvalidRequestError with the supplied configuration.

KeyOptions

Synthetic key scope, memory mode, and project association.

KeyOptions.project

Project namespace; null selects a namespace private to the key.

KeyOptions.keyScope

Owner or per-user key behavior to simulate.

KeyOptions.required

Whether model calls require an accepted user id.

KeyOptions.memory

Memory metadata or operations scoped to this user.

KnownModelName

A catalog model id. Use this strict type when you want typo checking.

KnownProviderName

One of the provider names the gateway lists today.

LocalHooks

Local callbacks receive Receipt, ErrorInfo, or retirement-notice text. Remote metadata and error text are untrusted.

LocalHooks.onReceipt

Called with a final receipt after a tracked call or memory page/operation.

LocalHooks.onError

Called with typed error information on a failed tracked call or memory operation.

LocalHooks.onNotice

Called for each reply carrying a validated client retirement notice.

Memory

One stored fact returned by the gateway.

Memory.id

Stable identifier of the stored fact.

Memory.text

The stored text. Stored text may differ from the input: recognised passwords, API keys and tokens are redacted, but unrecognised secrets and other sensitive details can remain.

Memory.source

How the fact arrived: “sdk” (saved with this library), “api” (any other direct request), “learned”, “dashboard”, or for your own memory also “plugin” or “import”.

Memory.createdAt

Fact creation time as a Date.

Memory.appUserLabel

A short label for the app user. Never the raw user id.

Memory.engine

Optional engine facets, absent until the wire exposes them.

MemoryApi

Memory operations scoped to one user and the key’s project.

MemoryApi.export

Collect every page or fail without a partial object; an erase during an export can end it early.

MemoryApi.exportStream

Iterate newest first with bounded page memory.

MemoryApi.add

Save one fact with an automatic idempotency key; reuse the returned key for manual resend.
Preview recall for this user. Scores compare only within one answer.

MemoryApi.addMany

Save 1 to 50 facts with per-item results.

MemoryApi.update

Replace a fact with a new id; the old id is hidden from list and recall.

MemoryApi.list

Read newest-first facts, fetching pages lazily.

MemoryApi.delete

Delete one fact in this scope; a pending result can be resumed.

MemoryApi.erase

Erase every memory of this user in this project.

MemoryAPIError

An error reply from the Atlaso memory API.

MemoryAPIError.replacedBy

Current fact id on fact_replaced; null means the replacement chain was deleted.

MemoryAPIError.constructor

Create MemoryAPIError with the supplied configuration.

MemoryApiLike

The part of the core memory API the AI SDK tools use (design 1.2).

MemoryApiLike.export

Collect all facts for a right-of-access response within this user and project.

MemoryApiLike.exportStream

Lazily iterate all exported facts, newest first.

MemoryApiLike.add

Save one fact with an automatic idempotency key; reuse its key for manual resend.
Search this user’s recall candidates.

MemoryApiLike.addMany

Add 1-50 facts with one idempotency key and per-item results.

MemoryApiLike.update

Correct a fact and receive its replacement id.

MemoryApiLike.list

Read newest-first facts, fetching pages lazily.

MemoryApiLike.delete

Delete one fact in this scope; a pending result can be resumed.

MemoryExport

A complete, newest-first export within this user and key project. Not a transactional snapshot.

MemoryExport.generatedAt

UTC time when collection completed.

MemoryExport.data

All facts returned by the gateway, newest first.

MemoryExport.factCount

Number of exported facts.

MemoryExport.pageCount

Number of pages read, including an empty final page.

MemoryTools

Tool adapters bound to this user’s memory API.

MemoryTools.forOpenAI

Function definitions for an OpenAI-style tools: list (.definitions) and their runner (.run(call)).

MemoryToolsOptions

Controls whether the model may request deletion of previously seen facts.

MemoryToolsOptions.allowForget

Expose forget. Off by default so a model cannot delete.

MemoryToolsOptions.format

Tool definition shape: Chat Completions (default) or Responses.

MemoryToolsOptions.receipt

Ids in this receipt may be forgotten (in addition to ids the tools listed).

MODEL_NAMES

Callable canonical model ids at this release; availability depends on your key.

ModelName

Suggested catalog ids plus any future model string; never validates or rewrites a request.

NotSentError

The request never reached the server (the connection did not open), so nothing was saved. Thrown by memory.add() once its retries are used up. Sending the same add again is safe.

NotSentError.safeToRepeat

True only when the request provably never reached the server.

NotSentError.constructor

Create NotSentError with the supplied configuration.

OpenAILike

The smallest shape of a provider client this library can scope.

OpenAILike.baseURL

Gateway base URL used for requests and scope validation.

OpenAILike.withOptions

Return a provider client copy with the given options.

OpenAIMemoryTools

Function definitions and a safe executor for memory tools.

OpenAIMemoryTools.definitions

Function definitions to pass to the provider request.

OpenAIMemoryTools.run

Run one tool call from your own loop. Returns the tool result text. Never throws for API errors.

OwnerMemoryApi

Your own memory, for a “Me” key: atlaso.memory. The memory the Atlaso plugins use: facts land in the key’s project, or in your personal memory when the key has none, and a delete is a real forget everywhere. There is no erase: a key never deletes all of your memories at once (use the dashboard).

OwnerMemoryApi.add

Save one fact with an automatic idempotency key; reuse the returned key for manual resend.

OwnerMemoryApi.addMany

Save 1 to 50 facts with per-item results.

OwnerMemoryApi.list

Read newest-first facts, fetching pages lazily.
Preview recall of your own memory. Scores compare only within one answer.

OwnerMemoryApi.update

Correct a fact: the new fact has a new id, and the old wording is forgotten everywhere.

OwnerMemoryApi.delete

Delete one fact everywhere; a pending result can be resumed. An id this key cannot reach is fact_not_found.

Page

A newest-first page of stored facts with its continuation cursor.

Page.data

The provider result or facts returned by this operation.

Page.hasMore

Whether another page follows this page.

Page.firstId

First fact id in this page, or null for an empty page.

Page.lastId

Continuation cursor: last fact id, or null for an empty page.

PendingResult

The server accepted the operation but has not finished it yet.

PendingResult.outcome

Discriminant describing the operation result.

PendingResult.retryAfterMs

Suggested delay before another attempt, in milliseconds.

PROVIDER_NAMES

Provider names the gateway lists today (catalog providers with a live model).

ProviderClass

A provider client class, passed once so user.openai() / user.anthropic() can build the shared client. The library never imports a provider package itself, so it stays dependency-free on Node, Bun and Deno.

ProviderName

A provider name as the gateway lists it, such as “anthropic” or “bedrock”. Autocomplete offers today’s names; any other string is accepted too, so a provider the gateway adds later works without a new release of this library.

ProviderRouting

The gateway’s provider request field, with its wire names.

ProviderRouting.order

Try these providers first, in this order.

ProviderRouting.only

Use only these providers.

ProviderRouting.ignore

Never use these providers.

ProviderRouting.allow_fallbacks

Whether a backup may answer if the selected provider fails.

Receipt

One typed record per call. Plain data.

Receipt.kind

Typed category describing the observed result.

Receipt.requestId

Gateway request identifier, or null when unavailable.

Receipt.callId

Gateway call identifier, or null when unavailable.

Receipt.providerHost

Host reported by the gateway, or null when unavailable.

Receipt.model

Model reported by the gateway, or null when unavailable.

Receipt.memory

Memory metadata or operations scoped to this user.

Receipt.cost

usd is a decimal string, never a float, and null whenever the cost is not known.

Receipt.cache

Reported cache read and write counts; unavailable values are null.

Receipt.ignoredParams

Request parameter names the gateway ignored.

Receipt.tagsDropped

Tag names the gateway dropped.

Receipt.reason

Gateway explanation, or null when none was reported.

Receipt.streamState

Current or final tracked stream state.

Receipt.error

Typed failure information when the operation failed.

Receipt.raw

Only lowercased x-atlaso-* headers and x-request-id, plus the in-band atlaso object.

ReceiptCost

Known decimal cost, pending cost, or an explicit reason cost is unknown.

ReceiptKind

The API and delivery mode observed for this receipt.

ReceiptMemory

Memory activity reported for this request, not proof of model use.

ReceiptMemory.status

Reported status; unavailable HTTP status is null.

ReceiptMemory.memoryIds

Ids of the memories put into this request’s prompt. Not proof the model used them.

ReceiptMemory.sharedIds

Prompt memory ids supplied by the project’s shared store. Always a subset of memoryIds.

ReceiptMemory.memoriesInPrompt

How many memories were added to this request’s prompt (not saved, not proven used). Null if unreadable.

ReceiptMemory.gatewayOverheadMs

Atlaso’s time before the provider call, in milliseconds.

ReceiptMemory.reason

Gateway explanation, or null when none was reported.

ReceiptMemory.action

Memory action reported by the gateway.

RecordedRequest

Synthetic request observation. Authorization is excluded.

RecordedRequest.clientName

Client name cleaned using the gateway rules; null for credential shapes.

RecordedRequest.route

Gateway route matched or observed by the fake.

RecordedRequest.userHeader

User header observed by the fake; null when absent.

RecordedRequest.project

Project namespace; null selects a namespace private to the key.

RecordedRequest.method

HTTP request method.

RecordedRequest.url

Request URL observed by the fake.

RecordedRequest.headers

Observed headers excluding authorization.

RecordedRequest.body

Synthetic parsed request body.

RecordedRequest.bodyBytes

Exact serialized synthetic request body.

RecordedRequest.step

Optional test step identifier.

RecordedRequest.streamReads

Number of stream chunks read by the consumer.

RecordedRequest.closed

Whether the synthetic response connection was closed.

ResponsesFactory

Provider factory used to build a Responses model with scoped headers.

Route

Deterministic offline wire fake. Tests behavior, never retrieval quality.

routing

Build the gateway’s provider field. Spread the result into a create() call:
Checked here, before anything is sent: unknown options, a non-boolean allowFallbacks, and lists that are not lists of distinct, non-empty names throw InvalidRequestError (code invalid_routing). Options left out (or undefined) are not sent; with none set this returns {}, which adds nothing.

ai-sdk.routing

Same options and checks as the core routing(); the result goes in providerOptions.

RoutingBody

What routing() returns: { provider }, or {} when no option was set. Spread it into create().

RoutingBody.provider

Only the routing options explicitly supplied by the caller.

RoutingOptions

What routing() accepts. Every option is optional; leave one out and the gateway’s default applies.

RoutingOptions.order

Try these providers first, in this order.

RoutingOptions.only

Use only these providers.

RoutingOptions.ignore

Never use these providers.

RoutingOptions.allowFallbacks

false: if the provider the gateway picked fails, fail the call instead of trying a backup.

ScopeOptions

Optional per-request memory, tags, and session settings.

ScopeOptions.memory

Sends x-atlaso-memory only when set. “off” = no recall and no learning; “use” = recall only.

ScopeOptions.tags

Sends x-atlaso-tags only when set.

ScopeOptions.sessionId

Sends x-atlaso-session-id only when set.

Script

A deterministic reply or fault selected by route and optional user.

Script.route

Gateway route matched or observed by the fake.

Script.user

Synthetic user id used to select this script.

Script.project

Project namespace; null selects a namespace private to the key.

Script.times

Number of matching requests for which this script applies.

Script.match

Route, user, and optional step matcher.

Script.reply

Synthetic response body, transport failure, or named fault.

Script.status

Reported status; unavailable HTTP status is null.

Script.retryAfter

Synthetic Retry-After delay, in seconds.

Script.stream

Synthetic streaming behavior for this request.

Script.effects

Synthetic store changes applied before the scripted response.

SharedAddResult

The outcome of a shared add. safeToRepeat applies when the returned idempotencyKey is reused with the same text within 24 hours. A fresh key may store another fact.

SharedApi

Shared operations belong to the server-key client, never a user scope.

SharedApi.add

Store one project fact with an automatic idempotency key, or the one you pass to resend an uncertain add safely. An uncertain write is never retried automatically.

SharedApi.list

Read newest-first shared facts, fetching later pages lazily.

SharedApi.delete

Delete one shared fact; a pending result can be resumed.

SharedApi.deleteAll

Permanently delete every shared fact in this key’s project.

SharedFact

A fact supplied to every app user of the key’s project. It has no app-user label: it belongs to the project.

SharedFact.id

Stable identifier of the shared fact.

SharedFact.text

The stored text. Stored text may differ from the input: recognised passwords, API keys and tokens are redacted, but unrecognised secrets and other sensitive details can remain.

SharedFact.source

Who wrote it: this library (“sdk”), another web request (“api”) or the dashboard (“dashboard”).

SharedFact.createdAt

Fact creation time as a Date.

SharedPage

A newest-first page of shared facts.

SharedPage.data

The shared facts on this page.

SharedPage.hasMore

Whether another page follows this page.

SharedPage.firstId

First fact id in this page, or null for an empty page.

SharedPage.lastId

Continuation cursor: last fact id, or null for an empty page.

SharedPage.total

How many shared facts the project keeps, whatever the page; null when the reply did not say.

StreamPlan

Synthetic stream chunks, terminal markers, and interruption points.

StreamPlan.chunks

Exact synthetic stream chunk objects.

StreamPlan.cutAfter

Cut the stream after this many chunks.

StreamPlan.sseError

Error code to emit in a synthetic SSE error event.

StreamPlan.after

Chunk count before the scripted event.

StreamPlan.errorAfter

Chunk count before the scripted error.

StreamPlan.terminal

Stream terminal event or deliberately missing terminal marker.

StreamPlan.error

Typed failure information when the operation failed.

StreamState

The tracked stream lifecycle, including interruption and cancellation.

TEST_HOOKS

Internal hooks a test kit can install (a virtual clock). Keyed by a symbol so it never shows up in autocomplete.

TestHooks

Test-only virtual time controls. Production uses real time and sleep.

TestHooks.sleep

Advance the test clock instead of waiting in real time.

TestHooks.now

Read the test clock in milliseconds.

ToolCallLike

The function name and serialized arguments from a model tool call.

ToolCallLike.function

Chat Completions tool call.

ToolCallLike.name

Responses function_call item.

ToolCallLike.arguments

JSON argument string, parsed and validated before tool execution.

Tracked

Provider data and a per-call receipt; consume stream to update streaming receipts.

Tracked.data

The provider result or facts returned by this operation.

Tracked.stream

Yields the provider client’s own chunk objects, unchanged. Empty for non-stream calls.

Tracked.receipt

A snapshot: final at once for non-stream calls, live for streams.

Tracked.done

Resolves when the stream ends for any reason. Never rejects.

UnknownCostWhy

Why the receipt cannot report a known cost.

UsageApi

Paginate and read app-user cost aggregates.

UsageApi.appUsers

Yield each row over all pages in the requested UTC date window.

UsageApi.get

Return the first row for a scoped user, or null when they have no calls.

Users

Synthetic user ids mapped to initial facts or fact text.

UserScope

One user in this key’s project. Shared clients must stay user-free.

UserScope.userId

The user attached to this scope, never a shared client default.

UserScope.headers

Per-call headers for frameworks: pass them on each call, never on a shared client.

UserScope.client

A cheap copy of your provider client with this user fixed on every request.

UserScope.openai

This user’s copy of the shared OpenAI client built from new Atlaso({ OpenAI }). Make one per request.
With a client of your own, the same as client(openai).

UserScope.anthropic

This user’s copy of the shared Anthropic client built from new Atlaso({ Anthropic }).
A guarded per-user copy of an official Anthropic client you pass.

UserScope.memory

Memory metadata or operations scoped to this user.

UserScope.usage

Usage for this one scoped app user.

UserScope.tools

Memory tools bound to this scope.

UserScope.createBrowserToken

Mint a short-lived token for this user on your server.

UserScope.revokeBrowserTokens

Revoke this user’s active browser tokens on your server.