Interface MessageServiceAsync
-
- All Implemented Interfaces:
public interface MessageServiceAsync
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageServiceAsync.WithRawResponseA view of MessageServiceAsync that provides access to raw HTTP responses for each method.
-
Method Summary
Modifier and Type Method Description abstract MessageServiceAsync.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. abstract BatchServiceAsyncbatches()CompletableFuture<BetaMessage>create(MessageCreateParams params)Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. abstract CompletableFuture<BetaMessage>create(MessageCreateParams params, RequestOptions requestOptions)AsyncStreamResponse<BetaRawMessageStreamEvent>createStreaming(MessageCreateParams params)Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. abstract AsyncStreamResponse<BetaRawMessageStreamEvent>createStreaming(MessageCreateParams params, RequestOptions requestOptions)CompletableFuture<BetaMessageTokensCount>countTokens(MessageCountTokensParams params)Count the number of tokens in a Message. abstract CompletableFuture<BetaMessageTokensCount>countTokens(MessageCountTokensParams params, RequestOptions requestOptions)-
-
Method Detail
-
withRawResponse
abstract MessageServiceAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
batches
abstract BatchServiceAsync batches()
-
create
CompletableFuture<BetaMessage> create(MessageCreateParams params)
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our /en/docs/initial-setup
-
create
abstract CompletableFuture<BetaMessage> create(MessageCreateParams params, RequestOptions requestOptions)
-
createStreaming
AsyncStreamResponse<BetaRawMessageStreamEvent> createStreaming(MessageCreateParams params)
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our /en/docs/initial-setup
-
createStreaming
abstract AsyncStreamResponse<BetaRawMessageStreamEvent> createStreaming(MessageCreateParams params, RequestOptions requestOptions)
-
countTokens
CompletableFuture<BetaMessageTokensCount> countTokens(MessageCountTokensParams params)
Count the number of tokens in a Message.
The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
Learn more about token counting in our /en/docs/build-with-claude/token-counting
-
countTokens
abstract CompletableFuture<BetaMessageTokensCount> countTokens(MessageCountTokensParams params, RequestOptions requestOptions)
-
-
-
-