Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions interface/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ export interface CronExecutionsParams {

export interface ProviderStatus {
anthropic: boolean;
anthropic_oauth: boolean;
openai: boolean;
openai_chatgpt: boolean;
openrouter: boolean;
Expand Down Expand Up @@ -966,6 +967,28 @@ export interface OpenAiOAuthBrowserStatusResponse {
message: string | null;
}

export interface ClaudeCliStatusResponse {
claude_folder_exists: boolean;
credentials_file_exists: boolean;
cli_installed: boolean;
cli_version: string | null;
authenticated: boolean;
email: string | null;
oauth_configured: boolean;
}

export interface AnthropicOAuthStartResponse {
success: boolean;
message: string;
authorize_url: string | null;
state: string | null;
}

export interface AnthropicOAuthExchangeResponse {
success: boolean;
message: string;
}

// -- Model Types --

export interface ModelInfo {
Expand Down Expand Up @@ -1951,6 +1974,29 @@ export const api = {
}
return response.json() as Promise<ProviderModelTestResponse>;
},
claudeCliStatus: () => fetchJson<ClaudeCliStatusResponse>("/providers/anthropic/oauth/cli-status"),
startAnthropicOAuth: async (params: { model: string; mode?: string }) => {
const response = await fetch(`${API_BASE}/providers/anthropic/oauth/start`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(params),
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json() as Promise<AnthropicOAuthStartResponse>;
},
exchangeAnthropicOAuth: async (params: { code: string; state: string }) => {
const response = await fetch(`${API_BASE}/providers/anthropic/oauth/exchange`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(params),
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json() as Promise<AnthropicOAuthExchangeResponse>;
},
startOpenAiOAuthBrowser: async (params: {model: string}) => {
const response = await fetch(`${API_BASE}/providers/openai/oauth/browser/start`, {
method: "POST",
Expand Down
Loading