|
近日,美国大模型公司 Anthropic 宣布停止向中资控股集团提供其语言模型 Claude 的服务,这将导致在华企业和开发者无法继续使用 Claude,范围涵盖中国大陆及通过海外注册或云服务间接使用的企业。
今天,美团 LongCat 团队重磅推出了「LongCat API开放平台」,为更多 Claude 用户提供平滑迁移方案,每日提供10万免费 tokens。同时,平台支持主流的 OpenAI API 和 Anthropic API 两种格式。只需三步,即可轻松实现从 Claude 无缝切换至 LongCat-Flash-Chat 模型。LongCat-Flash-Chat 模型基于全自研 MoE 架构(Zero-Computation Experts+ Shortcut-connected MoE),为更多开发者朋友提供自主研发、极致高效、安全稳定的 AI 服务。 我们为开发者提供了每天10万 Tokens 的免费额度。此外,您还可以体验我们模型的强大能力——单次请求最多支持128K Token 的长上下文理解。 ·每个账号每天自动获得 100,000 tokens 免费额度
·免费额度于北京时间每天凌晨自动刷新
·未使用完的额度将于当日清零,不予累积 ·输入和输出 tokens 均计入消耗
·流式接口和段式接口消耗相同 「LongCat API开放平台」支持主流的 OpenAI API 和 Anthropic API 两种格式。只需三步,即可轻松实现从 Claude 无缝切换至 LongCat-Flash-Chat 模型。 OpenAI 格式:
https://api.longcat.chat/openai
Anthropic 格式:
https://api.longcat.chat/anthropic 将 API Key 替换为 LongCat API 开放平台的 API Key,获取和查阅方式如下:
a.访问 LongCat API 开放平台:https://longcat.chat/platform

b.填写必要信息完成账户注册
c.账户注册成功后,系统会自动为每个账号创建一个名为 "default"的 API Key,进入 API Keys 页面即可查看

import anthropicclient = anthropic.Anthropic( base_url="https://api.longcat.chat/anthropic/", api_key="Bearer your-api-key", # 重写 header default_headers={ "Content-Type": "application/json", "Authorization": "Bearer your-api-key", })message = client.messages.create( model="LongCat-Flash-Chat", max_tokens=1000, system="You are a helpful assistant.", messages=[ { "role": "user", "content": [ { "type": "text", "text": "Hello, LongCat!" } ] } ])print(message.content[0].text)
欢迎体验,获取 Claude 平滑迁移方案
尊享每日10万免费tokens~
|