Skip to main content
Every namespace is a named export from the SDK entry for its runtime and a property of the default arg object. Custom apps use the host-provided @arg-ai/sdk; agent scripts and installed factory clients use @arg/sdk. arg.ready is a promise; await it before reading arg.context. Imported namespaces are lazy and follow the current host. A client from one of the factories is bound to its transport until dispose().

Namespaces and methods

Every method accepts an optional final { signal, timeoutMs } argument through the explicit clients; the lazy imports take it as their last parameter where shown.

Availability by host

A dash means the call rejects with unsupported_capability; the SDK never falls back to another credential to satisfy it.

Client factories

A custom Transport implements context, call(operation, args, options) and dispose(). The wire operations it must answer are the SDK_OPERATIONS export (isSdkOperation narrows a string); an unknown operation must reject, and a transport’s policy must validate resource arguments, not only operation names.

Error codes

Every rejection is an SdkError with a code, a message, and when it came from a request, status and requestId. Key on the code, never the message. Codes the API returns for its own reasons, such as credits_exhausted, pass through unchanged.