pub struct Messages { /* private fields */ }Expand description
client.messages() — Anthropic-format pass-through (spec §9).
Implementations§
Source§impl Messages
impl Messages
Sourcepub async fn create(&self, params: impl Serialize) -> Result<Value, Error>
pub async fn create(&self, params: impl Serialize) -> Result<Value, Error>
Anthropic-format message (POST /v1/messages) — the wire format used by the anthropic SDKs and Claude Code.
Accepts the standard Anthropic Messages request fields (model,
max_tokens, messages, system, tools, …) verbatim and returns
the raw Anthropic-shaped response object. Works with every gateway
model, not just Claude — the gateway bridges the wire format.
Sourcepub async fn create_stream(
&self,
params: impl Serialize,
) -> Result<RawEventStream, Error>
pub async fn create_stream( &self, params: impl Serialize, ) -> Result<RawEventStream, Error>
Streaming Anthropic-format message.
Sets stream: true on the body (all other fields pass through
verbatim) and returns a RawEventStream of raw Anthropic stream
events (message_start … message_stop). There is no [DONE] — a
healthy stream ends with a message_stop event followed by EOF; EOF
before message_stop surfaces Error::ModelStreamError; an error
event aborts with the §4-mapped error.