Skip to content

Latest commit

History

11,797 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

说明

此项目用于启用第三方CC的aws缓存渠道

配置参数

opencode.json 的 provider options 中配置以下参数:

参数类型说明
enableMetaboolean启用后会在请求 header 中注入 x-opencode-session,并在请求 body 的 metadata 字段中注入 user_idproject_idsession_id
enableFastboolean启用后会在请求 body 中设置 service_tier: "priority",用于开启优先级加速(适用于 OpenAI 和 Claude)
setCacheKeyboolean启用缓存 key
baseURLstring自定义 API 地址
apiKeystringAPI 密钥

配置示例

{
"anthropic": {
"name": "fox.anthropic.claude",
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://code.newcli.com/claude/aws/v1",
"apiKey": "sk-ant-oat01-x-x-x",
"setCacheKey": true,
"enableMeta": true,
"enableFast": true
},
"models": {
"claude-sonnet-4-5": {
"id": "claude-sonnet-4-5",
"name": "Claude Sonnet 4.5 (Antigravity)",
"limit": {
"context": 200000,
"output": 64000
},
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
}
},
"claude-sonnet-4-5-thinking": {
"name": "Claude Sonnet 4.5 Thinking (Antigravity)",
"limit": {
"context": 200000,
"output": 64000
},
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
},
"variants": {
"low": {
"thinkingConfig": {
"thinkingBudget": 8192
}
},
"max": {
"thinkingConfig": {
"thinkingBudget": 32768
}
}
}
},
"claude-opus-4-5": {
"name": "Claude Opus 4.5 (Antigravity)",
"limit": {
"context": 200000,
"output": 64000
},
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
},
"variants": {
"low": {
"thinkingConfig": {
"thinkingBudget": 8192
}
},
"max": {
"thinkingConfig": {
"thinkingBudget": 32768
}
}
}
},
"claude-opus-4-6": {
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6 (Antigravity)",
"limit": {
"context": 200000,
"output": 128000
},
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
}
},
"claude-opus-4-5-thinking": {
"name": "Claude Opus 4.5 Thinking (Antigravity)",
"limit": {
"context": 200000,
"output": 64000
},
"modalities": {
"input": [
"text",
"image",
"pdf"
],
"output": [
"text"
]
},
"variants": {
"low": {
"thinkingConfig": {
"thinkingBudget": 8192
}
},
"max": {
"thinkingConfig": {
"thinkingBudget": 32768
}
}
}
}
}
}
}

About

The opencode fix the cache features

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages