Skip to main content

anthropic_async/types/
models.rs

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