Anthropic

Claude Opus 4.7 API

Anthropicclaude-opus-4.71M 上下文Anthropic Messages APIOpenAI Chat Completions
你的应用Claude CodeCodex CLISDKhalfoff1 keyClaude/v1/messagesclaude-opus-4.7claude-opus-5.5claude-sonnet-5.5GPT/v1/responsesgpt-6.1-solgpt-6-astragpt-5.6-terraGemini/v1betagemini-3.1-progemini-3.8-flashgemini-3-flash
输入
$2.50
美元 / 百万 Token
输出
$12.50
美元 / 百万 Token
缓存读取
$0.25
美元 / 百万 Token
缓存写入
$3.13
美元 / 百万 Token

交给你的 AI 智能体

把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。

Integrate the model `claude-opus-4.7` from Half Off Dev into this project through the native Anthropic Messages API.

- Docs (read first): https://halfoff.dev/docs/models/anthropic.md
- Use the official Anthropic SDK and only change the base URL to https://halfoff.dev (or set ANTHROPIC_BASE_URL=https://halfoff.dev). Endpoints: POST https://halfoff.dev/v1/messages and /v1/messages/count_tokens, unchanged from Anthropic, so Anthropic's docs are the reference for every parameter. `Authorization: Bearer` works too.
- Model id: `claude-opus-4.7`. GET https://halfoff.dev/v1/models lists every model with its price.
- Auth: read my API key from the HALFOFF_API_KEY environment variable and send it as `x-api-key: $HALFOFF_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://halfoff.dev/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://halfoff.dev/llms.txt.

My task: <describe what you want to build or get>

单次请求费用

10,000 输入 + 1,000 输出 token:$0.037
其中 9,000 输入 token 来自缓存时:$0.017

提示缓存如何工作

可用性(过去 24 小时)

● 正常

实时状态

各渠道组价格

渠道分组输入输出缓存读取
Claude · Value
Pooled capacity
$2.50$12.50$0.25

什么是渠道组

调用示例

快速开始 →

Anthropic Messages API

curl https://halfoff.dev/v1/messages \
  -H "x-api-key: $HALFOFF_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "claude-opus-4.7", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

常见问题

Claude Opus 4.7 每百万 token 多少钱?

在价格最低的渠道组中,每百万输入 token $2.50,每百万输出 token $12.50。一次 10,000 输入、1,000 输出 token 的请求约 $0.037。

Claude Opus 4.7 支持提示缓存吗?

支持。缓存读取每百万 token $0.25,因此同样的请求若有 9,000 个输入 token 从缓存读取,费用约为 $0.017。Half Off Dev 会让同一对话保持在同一渠道,使缓存持续命中。

Claude Opus 4.7 的上下文窗口有多大?

1M token。

Claude Opus 4.7 使用哪种 API 格式?

Anthropic Messages API, OpenAI Chat Completions。使用你现有的官方 SDK:把 Base URL 改为 Half Off Dev,并使用你的 Half Off Dev API 密钥。

有订阅或速率限制吗?

无需订阅:充值预付费余额,按 token 付费。你可以为每个 API 密钥自行设置每分钟请求数和并发限制。

其他 Anthropic 模型