> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Models, tools, and accounts

> Use ServerRpc in Laravel Copilot SDK to list models and tools and to check account quotas and authentication status.

## Models, tools, and accounts

Scope: ServerRpc (server-wide operations tied to the Client)

For an overview of RPC and the list of all RPC pages, see [RPC](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc.md).

```php theme={null}
Copilot::client()->rpc()->ping();

// models
Copilot::client()->rpc()->models()->list();
// Get with a per-session GitHub token
Copilot::client()->rpc()->models()->list(new ModelsListRequest(gitHubToken: $token));
// Get the token price units for models. Pass the same account selection info as models.list
$priceUnits = Copilot::client()->rpc()->models()->listTokenPriceUnits(
    new ModelsListTokenPriceUnitsRequest(gitHubToken: $token),
);
// $priceUnits->units has modelId and a unit of TokenPriceUnit|string
foreach ($priceUnits->units as $priceUnit) {
    if ($priceUnit->unit === TokenPriceUnit::NanoAiu) {
        // To convert nano-AIU to AI Credits, divide by 1,000,000,000
    }
}
// Built-in model catalog
Copilot::client()->rpc()->models()->getBuiltInCatalog();

// tools
Copilot::client()->rpc()->tools()->list();

// account
Copilot::client()->rpc()->account()->getQuota();
// Get with a per-session GitHub token
Copilot::client()->rpc()->account()->getQuota(new AccountGetQuotaRequest(gitHubToken: $token));

// Resolve an absolute URL from the configured GitHub host name (no authentication required)
$hostUrl = Copilot::client()->rpc()->account()->getHostUrl([
    'copilotGhHost' => 'github.example.com',
])->url;

// Enroll an authenticated identity, without credentials, in Copilot Free
$enrollment = Copilot::client()->rpc()->account()->subscribeCopilotFree([
    'identity' => [
        'type' => 'token',
        'host' => 'https://github.com',
        'login' => 'octocat',
    ],
]);
// $enrollment->kind / $enrollment->status / $enrollment->message

// tools largeOutput (experimental: clean up expired large tool outputs)
Copilot::client()->rpc()->tools()->largeOutput()->cleanup();
```


## Related topics

- [ServerRpc overview](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc/server-overview.md)
- [RPC (Remote Procedure Call)](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc.md)
- [Tools](https://kawax.biz/en/packages/laravel-copilot-sdk/tools.md)
- [Models](https://kawax.biz/en/packages/laravel-copilot-sdk/models.md)
- [Laravel AI SDK](https://kawax.biz/en/ai-sdk.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.