Skip to content

Commit d2cd844

Browse files
njbrakegithub-actions[bot]
authored andcommitted
chore: regenerate SDK client core from Otari OpenAPI spec
1 parent 3265736 commit d2cd844

30 files changed

Lines changed: 1264 additions & 6 deletions

src/_client/apis/aliases_api.rs

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/*
2+
* otari
3+
*
4+
* Otari, an OpenAI-compatible LLM gateway with API key management
5+
*
6+
* The version of the OpenAPI document: 0.0.0-dev
7+
*
8+
* Generated by: https://openapi-generator.tech
9+
*/
10+
11+
use super::{configuration, ContentType, Error};
12+
use crate::{apis::ResponseContent, models};
13+
use reqwest;
14+
use serde::{de::Error as _, Deserialize, Serialize};
15+
16+
/// struct for typed errors of method [`delete_alias_v1_aliases_name_delete`]
17+
#[derive(Debug, Clone, Serialize, Deserialize)]
18+
#[serde(untagged)]
19+
pub enum DeleteAliasV1AliasesNameDeleteError {
20+
Status422(models::HttpValidationError),
21+
UnknownValue(serde_json::Value),
22+
}
23+
24+
/// struct for typed errors of method [`list_aliases_v1_aliases_get`]
25+
#[derive(Debug, Clone, Serialize, Deserialize)]
26+
#[serde(untagged)]
27+
pub enum ListAliasesV1AliasesGetError {
28+
UnknownValue(serde_json::Value),
29+
}
30+
31+
/// struct for typed errors of method [`set_alias_v1_aliases_post`]
32+
#[derive(Debug, Clone, Serialize, Deserialize)]
33+
#[serde(untagged)]
34+
pub enum SetAliasV1AliasesPostError {
35+
Status422(models::HttpValidationError),
36+
UnknownValue(serde_json::Value),
37+
}
38+
39+
/// Delete a stored alias.
40+
pub async fn delete_alias_v1_aliases_name_delete(
41+
configuration: &configuration::Configuration,
42+
name: &str,
43+
) -> Result<(), Error<DeleteAliasV1AliasesNameDeleteError>> {
44+
// add a prefix to parameters to efficiently prevent name collisions
45+
let p_path_name = name;
46+
47+
let uri_str = format!(
48+
"{}/v1/aliases/{name}",
49+
configuration.base_path,
50+
name = crate::apis::urlencode(p_path_name)
51+
);
52+
let mut req_builder = configuration
53+
.client
54+
.request(reqwest::Method::DELETE, &uri_str);
55+
56+
if let Some(ref user_agent) = configuration.user_agent {
57+
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
58+
}
59+
if let Some(ref apikey) = configuration.api_key {
60+
let key = apikey.key.clone();
61+
let value = match apikey.prefix {
62+
Some(ref prefix) => format!("{} {}", prefix, key),
63+
None => key,
64+
};
65+
req_builder = req_builder.header("Otari-Key", value);
66+
};
67+
68+
let req = req_builder.build()?;
69+
let resp = configuration.client.execute(req).await?;
70+
71+
let status = resp.status();
72+
73+
if !status.is_client_error() && !status.is_server_error() {
74+
Ok(())
75+
} else {
76+
let content = resp.text().await?;
77+
let entity: Option<DeleteAliasV1AliasesNameDeleteError> =
78+
serde_json::from_str(&content).ok();
79+
Err(Error::ResponseError(ResponseContent {
80+
status,
81+
content,
82+
entity,
83+
}))
84+
}
85+
}
86+
87+
/// List every alias in force, from config.yml and from storage.
88+
pub async fn list_aliases_v1_aliases_get(
89+
configuration: &configuration::Configuration,
90+
) -> Result<Vec<models::AliasResponse>, Error<ListAliasesV1AliasesGetError>> {
91+
let uri_str = format!("{}/v1/aliases", configuration.base_path);
92+
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
93+
94+
if let Some(ref user_agent) = configuration.user_agent {
95+
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
96+
}
97+
if let Some(ref apikey) = configuration.api_key {
98+
let key = apikey.key.clone();
99+
let value = match apikey.prefix {
100+
Some(ref prefix) => format!("{} {}", prefix, key),
101+
None => key,
102+
};
103+
req_builder = req_builder.header("Otari-Key", value);
104+
};
105+
106+
let req = req_builder.build()?;
107+
let resp = configuration.client.execute(req).await?;
108+
109+
let status = resp.status();
110+
let content_type = resp
111+
.headers()
112+
.get("content-type")
113+
.and_then(|v| v.to_str().ok())
114+
.unwrap_or("application/octet-stream");
115+
let content_type = super::ContentType::from(content_type);
116+
117+
if !status.is_client_error() && !status.is_server_error() {
118+
let content = resp.text().await?;
119+
match content_type {
120+
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
121+
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::AliasResponse&gt;`"))),
122+
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::AliasResponse&gt;`")))),
123+
}
124+
} else {
125+
let content = resp.text().await?;
126+
let entity: Option<ListAliasesV1AliasesGetError> = serde_json::from_str(&content).ok();
127+
Err(Error::ResponseError(ResponseContent {
128+
status,
129+
content,
130+
entity,
131+
}))
132+
}
133+
}
134+
135+
/// Create or update a stored alias.
136+
pub async fn set_alias_v1_aliases_post(
137+
configuration: &configuration::Configuration,
138+
alias_request: models::AliasRequest,
139+
) -> Result<models::AliasResponse, Error<SetAliasV1AliasesPostError>> {
140+
// add a prefix to parameters to efficiently prevent name collisions
141+
let p_body_alias_request = alias_request;
142+
143+
let uri_str = format!("{}/v1/aliases", configuration.base_path);
144+
let mut req_builder = configuration
145+
.client
146+
.request(reqwest::Method::POST, &uri_str);
147+
148+
if let Some(ref user_agent) = configuration.user_agent {
149+
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
150+
}
151+
if let Some(ref apikey) = configuration.api_key {
152+
let key = apikey.key.clone();
153+
let value = match apikey.prefix {
154+
Some(ref prefix) => format!("{} {}", prefix, key),
155+
None => key,
156+
};
157+
req_builder = req_builder.header("Otari-Key", value);
158+
};
159+
req_builder = req_builder.json(&p_body_alias_request);
160+
161+
let req = req_builder.build()?;
162+
let resp = configuration.client.execute(req).await?;
163+
164+
let status = resp.status();
165+
let content_type = resp
166+
.headers()
167+
.get("content-type")
168+
.and_then(|v| v.to_str().ok())
169+
.unwrap_or("application/octet-stream");
170+
let content_type = super::ContentType::from(content_type);
171+
172+
if !status.is_client_error() && !status.is_server_error() {
173+
let content = resp.text().await?;
174+
match content_type {
175+
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
176+
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AliasResponse`"))),
177+
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AliasResponse`")))),
178+
}
179+
} else {
180+
let content = resp.text().await?;
181+
let entity: Option<SetAliasV1AliasesPostError> = serde_json::from_str(&content).ok();
182+
Err(Error::ResponseError(ResponseContent {
183+
status,
184+
content,
185+
entity,
186+
}))
187+
}
188+
}

src/_client/apis/batches_api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub async fn cancel_batch_v1_batches_batch_id_cancel_post(
117117
}
118118
}
119119

120-
/// Create a batch of LLM requests for asynchronous processing.
120+
/// Create a batch of LLM requests for asynchronous processing. Authentication modes: - Master key + user field: Use specified user (must exist) - API key + user field: Use specified user (must exist) - API key without user field: Use virtual user created with API key
121121
pub async fn create_batch_v1_batches_post(
122122
configuration: &configuration::Configuration,
123123
create_batch_request: models::CreateBatchRequest,
@@ -172,7 +172,7 @@ pub async fn create_batch_v1_batches_post(
172172
}
173173
}
174174

175-
/// List batches for a provider.
175+
/// List batches for a provider. Non-master keys only see batches they own (plus legacy batches without an ownership marker); the page is filtered after the provider call, so a page may contain fewer than ``limit`` items.
176176
pub async fn list_batches_v1_batches_get(
177177
configuration: &configuration::Configuration,
178178
provider: &str,

src/_client/apis/keys_api.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ pub enum ListKeysV1KeysGetError {
4545
UnknownValue(serde_json::Value),
4646
}
4747

48+
/// struct for typed errors of method [`rotate_key_v1_keys_key_id_rotate_post`]
49+
#[derive(Debug, Clone, Serialize, Deserialize)]
50+
#[serde(untagged)]
51+
pub enum RotateKeyV1KeysKeyIdRotatePostError {
52+
Status422(models::HttpValidationError),
53+
UnknownValue(serde_json::Value),
54+
}
55+
4856
/// struct for typed errors of method [`update_key_v1_keys_key_id_patch`]
4957
#[derive(Debug, Clone, Serialize, Deserialize)]
5058
#[serde(untagged)]
@@ -271,6 +279,65 @@ pub async fn list_keys_v1_keys_get(
271279
}
272280
}
273281

282+
/// Rotate an API key's secret in place. Requires master key authentication. Generates a new secret for the same key row (id, user, name, expiry, and metadata are preserved) and returns the new raw key once, using the same response shape as key creation. The previous secret stops authenticating immediately; there is no grace window.
283+
pub async fn rotate_key_v1_keys_key_id_rotate_post(
284+
configuration: &configuration::Configuration,
285+
key_id: &str,
286+
) -> Result<models::CreateKeyResponse, Error<RotateKeyV1KeysKeyIdRotatePostError>> {
287+
// add a prefix to parameters to efficiently prevent name collisions
288+
let p_path_key_id = key_id;
289+
290+
let uri_str = format!(
291+
"{}/v1/keys/{key_id}/rotate",
292+
configuration.base_path,
293+
key_id = crate::apis::urlencode(p_path_key_id)
294+
);
295+
let mut req_builder = configuration
296+
.client
297+
.request(reqwest::Method::POST, &uri_str);
298+
299+
if let Some(ref user_agent) = configuration.user_agent {
300+
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
301+
}
302+
if let Some(ref apikey) = configuration.api_key {
303+
let key = apikey.key.clone();
304+
let value = match apikey.prefix {
305+
Some(ref prefix) => format!("{} {}", prefix, key),
306+
None => key,
307+
};
308+
req_builder = req_builder.header("Otari-Key", value);
309+
};
310+
311+
let req = req_builder.build()?;
312+
let resp = configuration.client.execute(req).await?;
313+
314+
let status = resp.status();
315+
let content_type = resp
316+
.headers()
317+
.get("content-type")
318+
.and_then(|v| v.to_str().ok())
319+
.unwrap_or("application/octet-stream");
320+
let content_type = super::ContentType::from(content_type);
321+
322+
if !status.is_client_error() && !status.is_server_error() {
323+
let content = resp.text().await?;
324+
match content_type {
325+
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
326+
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateKeyResponse`"))),
327+
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateKeyResponse`")))),
328+
}
329+
} else {
330+
let content = resp.text().await?;
331+
let entity: Option<RotateKeyV1KeysKeyIdRotatePostError> =
332+
serde_json::from_str(&content).ok();
333+
Err(Error::ResponseError(ResponseContent {
334+
status,
335+
content,
336+
entity,
337+
}))
338+
}
339+
}
340+
274341
/// Update an API key. Requires master key authentication.
275342
pub async fn update_key_v1_keys_key_id_patch(
276343
configuration: &configuration::Configuration,

src/_client/apis/messages_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub async fn count_message_tokens_v1_messages_count_tokens_post(
8585
}
8686
}
8787

88-
/// Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
88+
/// Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and get multi-attempt fallback across the resolved route, tool-loop requests included (fallback applies up to the pre-lock-in point, same as chat).
8989
pub async fn create_message_v1_messages_post(
9090
configuration: &configuration::Configuration,
9191
messages_request: models::MessagesRequest,

src/_client/apis/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl From<&str> for ContentType {
113113
}
114114
}
115115

116+
pub mod aliases_api;
116117
pub mod audio_api;
117118
pub mod batches_api;
118119
pub mod budgets_api;
@@ -126,8 +127,10 @@ pub mod messages_api;
126127
pub mod models_api;
127128
pub mod moderations_api;
128129
pub mod pricing_api;
130+
pub mod providers_api;
129131
pub mod rerank_api;
130132
pub mod responses_api;
133+
pub mod settings_api;
131134
pub mod usage_api;
132135
pub mod users_api;
133136

0 commit comments

Comments
 (0)