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

# 모델·도구·계정

> ServerRpc로 모델 목록, 도구 목록, 계정의 쿼터와 인증 상태를 가져오는 사용 예시입니다.

## 모델·도구·계정

대상: ServerRpc (Client에 연결된 서버 전체 작업)

RPC 전체 개요와 페이지 목록은 [RPC](https://kawax.biz/ko/packages/laravel-copilot-sdk/rpc.md)를 참조하세요.

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

// models
Copilot::client()->rpc()->models()->list();
// 세션별 GitHub 토큰으로 가져오기
Copilot::client()->rpc()->models()->list(new ModelsListRequest(gitHubToken: $token));
// 모델 토큰 가격 단위를 가져온다. models.list와 같은 계정 선택 정보를 전달
$priceUnits = Copilot::client()->rpc()->models()->listTokenPriceUnits(
    new ModelsListTokenPriceUnitsRequest(gitHubToken: $token),
);
// $priceUnits->units 는 modelId 와 TokenPriceUnit|string 타입의 unit 을 가짐
foreach ($priceUnits->units as $priceUnit) {
    if ($priceUnit->unit === TokenPriceUnit::NanoAiu) {
        // nano-AIU 를 AI Credits 로 환산하려면 1,000,000,000 으로 나눈다
    }
}
// 내장 모델 카탈로그
Copilot::client()->rpc()->models()->getBuiltInCatalog();

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

// account
Copilot::client()->rpc()->account()->getQuota();
// 세션별 GitHub 토큰으로 가져오기
Copilot::client()->rpc()->account()->getQuota(new AccountGetQuotaRequest(gitHubToken: $token));

// 설정된 GitHub 호스트 이름으로부터 절대 URL을 해석(인증 불필요)
$hostUrl = Copilot::client()->rpc()->account()->getHostUrl([
    'copilotGhHost' => 'github.example.com',
])->url;

// 인증된 자격 증명을 포함하지 않는 identity를 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: 만료된 대용량 도구 출력 정리)
Copilot::client()->rpc()->tools()->largeOutput()->cleanup();
```


## Related topics

- [ServerRpc 개요](https://kawax.biz/ko/packages/laravel-copilot-sdk/rpc/server-overview.md)
- [RPC(Remote Procedure Call)](https://kawax.biz/ko/packages/laravel-copilot-sdk/rpc.md)
- [도구](https://kawax.biz/ko/packages/laravel-copilot-sdk/tools.md)
- [모델](https://kawax.biz/ko/packages/laravel-copilot-sdk/models.md)
- [Laravel AI SDK](https://kawax.biz/ko/ai-sdk.md)


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