Skip to content
Open
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
6 changes: 4 additions & 2 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function AnthropicAuthPlugin({ client }) {
async loader(getAuth, provider) {
const auth = await getAuth();
if (auth.type === "oauth") {
// zero out cost for max plan
// zero out cost for max plan and cap context to 200k (1M beta not available for OAuth)
for (const model of Object.values(provider.models)) {
model.cost = {
input: 0,
Expand All @@ -94,6 +94,7 @@ export async function AnthropicAuthPlugin({ client }) {
write: 0,
},
};
model.limit.context = Math.min(model.limit.context, 200_000);
}
return {
apiKey: "",
Expand Down Expand Up @@ -171,7 +172,8 @@ export async function AnthropicAuthPlugin({ client }) {
const incomingBetasList = incomingBeta
.split(",")
.map((b) => b.trim())
.filter(Boolean);
.filter(Boolean)
.filter((b) => !b.startsWith("context-1m"));

const requiredBetas = [
"oauth-2025-04-20",
Expand Down