Skip to main content

anthropic_async/types/
models.rs

1use serde::{Deserialize, Serialize};
2
3/// An Anthropic model
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
5pub struct Model {
6    /// Model identifier
7    pub id: String,
8    /// When the model was created
9    pub created_at: chrono::DateTime<chrono::Utc>,
10    /// Display name for the model
11    pub display_name: String,
12    /// Type of resource (always "model")
13    #[serde(rename = "type")]
14    pub kind: String,
15}
16
17/// Response from listing models
18#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
19pub struct ModelsListResponse {
20    /// List of models
21    pub data: Vec<Model>,
22    /// Whether there are more models available
23    pub has_more: bool,
24    /// ID of the first model in the list
25    pub first_id: Option<String>,
26    /// ID of the last model in the list
27    pub last_id: Option<String>,
28}
29
30/// Parameters for listing models
31#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
32pub struct ModelListParams {
33    /// Return models after this ID (for pagination)
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub after_id: Option<String>,
36    /// Return models before this ID (for pagination)
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub before_id: Option<String>,
39    /// Maximum number of models to return
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub limit: Option<u32>,
42}