# Anthropic Claude 模型

<figure><img src="https://terobox.oss-cn-hongkong.aliyuncs.com/openkey/claude-poster.png" alt=""><figcaption><p>OpenKey.Cloud Claude Poster</p></figcaption></figure>

### 1. 公告

2024年5月9日，OpenKey.Cloud 试验性支持Anthropic旗下Claude 3系列模型，具体如下：

> **Claude 3 Opus : `claude-3-opus-20240229`**
>
> **Claude 3 Sonnet : `claude-3-sonnet-20240229`**
>
> **Claude 3 Haiku : `claude-3-haiku-20240307`**

### 2. 价格/速率

<figure><img src="https://terobox.oss-cn-hongkong.aliyuncs.com/openkey/claude-price.png" alt=""><figcaption><p>price</p></figcaption></figure>

### 3. 使用方法

#### 3.1 配合 OpenKey 内置对话工具使用

第一步，访问工具网址：<https://openkey.cloud/chat> 或者 [https://chat1201.openkey.cloud](https://chat1201.openkey.cloud/)

第二步，输入OpenKey的API令牌，如下图：

<figure><img src="/files/enCOb4P3Zc2yKl4WQH6w" alt=""><figcaption><p>输入令牌</p></figcaption></figure>

第三步，选择Claude模型，如下图：

<figure><img src="/files/Jdo424fuixRT27Oisi0a" alt=""><figcaption><p>选择模型</p></figcaption></figure>

第四步，开始对话，如下图：

<figure><img src="/files/y5CfXm11QDctbudMkwiO" alt=""><figcaption><p>开始对话</p></figcaption></figure>

#### 3.2 配合 Chatbox 使用图片分析功能

第一步，访问：[https://web.chatboxai.app](https://web.chatboxai.app/)

第二步，选择 OpenAI API 接口模式，填入OpenKey的接口地址，再输入OpenKey的API令牌。如下图：

<figure><img src="/files/xmF9CNol9pTr8OMGbUFI" alt=""><figcaption><p>Chatbox</p></figcaption></figure>

注意，OpenKey.Cloud Claude 模型采用 OpenAI 接口协议调用，而非 Anthropic Claude 原有接口协议，所以这里选择OpenAI API。

第三步，选择Custom Model 自定义模型名称，输入你需要调用的模型，点击Save保存。如下图：

<figure><img src="/files/wCs7ZgK1HZTBTFFLHhBU" alt=""><figcaption><p>自定义模型</p></figcaption></figure>

第四步，开始对话，这里上传一个BTC的价格图表让Claude来预测未来走势，如下图：

<figure><img src="/files/BXFvZERKhQFCY8rM49CU" alt=""><figcaption><p>Chatbox Claude对话</p></figcaption></figure>

#### 3.3 Python代码调用

请完全参考OpenAI接口协议进行调用，而非Claude官方。代码示例如下：

```python
import requests

url = "https://openkey.cloud/v1/chat/completions"

headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer sk-e9EBGCdh5r1bqFx20eB8Fb8e3e194fFaAdE16c5e83033612'
}

data = {
  "model": "claude-3-haiku-20240307",
  "messages": [{"role": "user", "content": "hi"}]
}

response = requests.post(url, headers=headers, json=data)

print("Status Code", response.status_code)
print("JSON Response ", response.json())
```

<figure><img src="/files/nvGoHg45gA69XDJ5h6Ks" alt=""><figcaption><p>输出</p></figcaption></figure>

### 4. 注意

当前 Claude 系列模型仍处于试验阶段，无法保证稳定供应。如有特别稳定性/速率需求，请联系客服定制方案。

联系我们：<https://openkey.cloud/> 或者 <support@gptocean.com>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openkey.cloud/api/claude.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
