@@ -9,6 +9,7 @@ This document provides detailed API reference and usage examples for the Copilot
99 - [ CopilotSession] ( #copilotsession )
1010- [ Event Types] ( #event-types )
1111- [ Streaming] ( #streaming )
12+ - [ Listing Models] ( #listing-models )
1213- [ Advanced Usage] ( #advanced-usage )
1314 - [ Manual Server Control] ( #manual-server-control )
1415 - [ Tools] ( #tools )
@@ -83,6 +84,18 @@ Resume an existing session.
8384
8485Ping the server to check connectivity.
8586
87+ ##### ` getStatus(): CompletableFuture<GetStatusResponse> `
88+
89+ Get CLI status including version and protocol information.
90+
91+ ##### ` getAuthStatus(): CompletableFuture<GetAuthStatusResponse> `
92+
93+ Get current authentication status.
94+
95+ ##### ` listModels(): CompletableFuture<List<ModelInfo>> `
96+
97+ List available models with their metadata (id, name, capabilities, billing info).
98+
8699##### ` getState(): ConnectionState `
87100
88101Get current connection state. Returns one of: ` DISCONNECTED ` , ` CONNECTING ` , ` CONNECTED ` , ` ERROR ` .
@@ -111,6 +124,10 @@ Represents a single conversation session.
111124
112125#### Methods
113126
127+ ##### ` send(String prompt): CompletableFuture<String> `
128+
129+ Convenience method to send a simple text message. Equivalent to ` send(new MessageOptions().setPrompt(prompt)) ` .
130+
114131##### ` send(MessageOptions options): CompletableFuture<String> `
115132
116133Send a message to the session.
@@ -123,10 +140,18 @@ Send a message to the session.
123140
124141Returns the message ID.
125142
126- ##### ` sendAndWait(MessageOptions options, long timeoutMs): CompletableFuture<AssistantMessageEvent> `
143+ ##### ` sendAndWait(String prompt): CompletableFuture<AssistantMessageEvent> `
144+
145+ Convenience method to send a simple text message and wait for the session to become idle. Equivalent to ` sendAndWait(new MessageOptions().setPrompt(prompt)) ` .
146+
147+ ##### ` sendAndWait(MessageOptions options): CompletableFuture<AssistantMessageEvent> `
127148
128149Send a message and wait for the session to become idle. Default timeout is 60 seconds.
129150
151+ ##### ` sendAndWait(MessageOptions options, long timeoutMs): CompletableFuture<AssistantMessageEvent> `
152+
153+ Send a message and wait for the session to become idle with custom timeout.
154+
130155##### ` on(Consumer<AbstractSessionEvent> handler): Closeable `
131156
132157Subscribe to session events. Returns a ` Closeable ` to unsubscribe.
@@ -211,6 +236,45 @@ session.send(new MessageOptions().setPrompt("Tell me a short story")).get();
211236done. get();
212237```
213238
239+ ## Listing Models
240+
241+ Query available models and their capabilities before creating a session:
242+
243+ ``` java
244+ try (var client = new CopilotClient ()) {
245+ client. start(). get();
246+
247+ // List all available models
248+ List<ModelInfo > models = client. listModels(). get();
249+
250+ for (ModelInfo model : models) {
251+ System . out. println(" Model: " + model. getId());
252+ System . out. println(" Name: " + model. getName());
253+
254+ if (model. getCapabilities() != null ) {
255+ System . out. println(" Max Output Tokens: " + model. getCapabilities(). getMaxOutputTokens());
256+ }
257+
258+ if (model. getPolicy() != null ) {
259+ System . out. println(" State: " + model. getPolicy(). getState());
260+ }
261+ }
262+
263+ // Use a specific model from the list
264+ var session = client. createSession(
265+ new SessionConfig (). setModel(models. get(0 ). getId())
266+ ). get();
267+ }
268+ ```
269+
270+ Each ` ModelInfo ` contains:
271+
272+ - ` id ` - Model identifier (e.g., "claude-sonnet-4.5", "gpt-4o")
273+ - ` name ` - Human-readable display name
274+ - ` capabilities ` - Model limits including max output tokens
275+ - ` policy ` - Policy state information
276+ - ` billing ` - Billing/usage information
277+
214278## Advanced Usage
215279
216280### Manual Server Control
0 commit comments