Skip to main content

RPC (Remote Procedure Call)

In the official SDK, recent new features are supported through auto-generated code from api.schema.json. In the Laravel version, the same features are implemented by following generated SDKs for other languages.

ServerRpc

An RPC class bound to the Client. For an overview of the methods by category, see ServerRpc overview.

Basic call example

Features that were already in the SDK have also been added again in the auto-generated version.

Usage examples by feature

Representative call examples are grouped into pages by feature.

SessionRpc

An RPC class bound to the Session. You can also use features that weren’t possible in earlier SDKs, such as plan mode.
For an overview of the methods by category, see SessionRpc overview.

Usage examples by feature

Representative call examples are grouped into pages by feature.

Using arrays for arguments

Dedicated classes are used for both arguments and return values, but you can also pass arguments as arrays.

Testing

Copilot::fake() mocks are not available, so mock with Copilot::expects('client') or Copilot::expects('start').
Last modified on November 26, 2026