支持的模型
Claude AI API支持的模型和上下文长度:
Claude AI 模型
平台 | 模式标识符 | 备注 |
---|---|---|
claude-ai | claude/claude-2.1 | |
claude-ai | claude/claude-2.0 | |
claude-ai | claude/claude-instant-1.2 | |
claude-ai | claude/claude-3-opus-20240229 | |
claude-ai | claude/claude-3-sonnet-20240229 | |
claude-ai | claude/Coming soon | Placeholder for future models |
from openai import OpenAI
client = OpenAI(
api_key = "自己的API key",
base_url = "https://api.agicto.cn/v1"
)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "你是谁,用中文回答",
}
],
model="claude/claude-2.1",
)
print(chat_completion.choices[0].message.content)