9router/open-sse/providers/registry/claude.js

52 lines
1.8 KiB
JavaScript
Raw Normal View History

import { CLAUDE_CLI_SPOOF_HEADERS } from "../shared.js";
export default {
id: "claude",
alias: "cc",
display: {
"name": "Claude Code",
"icon": "smart_toy",
"color": "#D97757",
"website": "https://claude.ai",
"notice": {
"signupUrl": "https://claude.ai"
},
"deprecated": true,
"deprecationNotice": "RISK_NOTICE"
},
category: "oauth",
uiAlias: "cc",
transport: {
baseUrl: "https://api.anthropic.com/v1/messages",
format: "claude",
urlSuffix: "?beta=true",
headers: { ...CLAUDE_CLI_SPOOF_HEADERS },
quirks: { cloakToolsOnOAuth: true },
auth: {"apiKey":{"header":"x-api-key","scheme":"raw"},"oauth":{"header":"Authorization","scheme":"bearer"},"hooks":["claudeOverlay"]},
usage: {
oauthUrl: "https://api.anthropic.com/api/oauth/usage",
orgUrl: "https://api.anthropic.com/v1/organizations/{org_id}/usage",
settingsUrl: "https://api.anthropic.com/v1/settings"
},
},
oauth: {
clientId: "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
authorizeUrl: "https://claude.ai/oauth/authorize",
tokenUrl: "https://api.anthropic.com/v1/oauth/token",
scopes: ["org:create_api_key", "user:profile", "user:inference"],
codeChallengeMethod: "S256",
refreshLeadMs: 14400000,
refresh: {"encoding":"json"}
},
models: [
{ id: "claude-opus-4-8", name: "Claude Opus 4.8" },
{ id: "claude-opus-4-7", name: "Claude Opus 4.7" },
{ id: "claude-opus-4-6", name: "Claude Opus 4.6" },
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
{ id: "claude-opus-4-5-20251101", name: "Claude 4.5 Opus" },
{ id: "claude-sonnet-4-5-20250929", name: "Claude 4.5 Sonnet" },
{ id: "claude-haiku-4-5-20251001", name: "Claude 4.5 Haiku" }
],
features: {"usage":true},
};