xfusionai
  1. Anthropic Claude
xfusionai
  • 产品介绍
  • 模型价格
  • 快速开始
  • Azure语音服务
  • Azure翻译服务
  • Azure open AI
  • 常见问题
  • OpenAI API
    • About OpenAI Compatible API
    • Chat
      • Chat Completion
    • Images
      • Create Image
    • Audio
      • Text To Speech API
  • Midjourney Open API
    • About Midjourney and Prices
    • Submit Imagine Task
      POST
    • Specify ID Query Task (fetch)
      GET
    • Specify the ID List Query Task
      GET
    • Obtain the seed of the Task Image
      GET
    • Specify ID Query Task
      GET
    • Submit Blend Task
      POST
    • Submit Modal Task
      POST
    • Submit Describe Task
      POST
    • Submit Shorten Task
      POST
    • Submit FaceSwap Task
      POST
    • Upload Files to Discord
      POST
    • Submit Action Task(All associated button actions UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      POST
  • Luma video
    • Luma Task Creation
      POST
    • Luma Expand Video
      POST
    • Luma Query Task
      GET
    • Luma Download video
      GET
  • Suno Music
    • Generate music
    • Query task
  • Anthropic Claude
    • Claude Chat Completion
      POST
  • Flux API
    • Create Image
  1. Anthropic Claude

Claude Chat Completion

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v1/chat/completions
Tip: The model documentation is exactly the same as the OpenAI chat documentation.
supported models:
claude-2
claude-2.0
claude-2.1
claude-3-haiku-20240229
claude-3-haiku-20240307
claude-3-opus-20240229
claude-3-sonnet-20240229
claude-instant-1
claude-instant-1.2
https://doublegpt.io/v1/chat/completions
...

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Body 参数application/json
model
string 
必需
messages
string 
必需
max_tokens
integer 
必需
stream
boolean 
必需
示例
{
    "model": "claude-2",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Say test"
        }
    ],
    "stream": false
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-2",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Say test"
        }
    ],
    "stream": false
}'

返回响应

🟢200OK
application/json
Body
object {0}
示例
{
    "completion": " I do not actually speak, I am an AI assistant created by Anthropic to be helpful, harmless, and honest.",
    "stop_reason": "stop_sequence",
    "model": "claude-2.0",
    "stop": "\n\nHuman:",
    "log_id": "5f0e0b3b63866c8c307085b87e2540d8f991ed7a7532621e312c575e5a9f0d07"
}
修改于 2024-11-09 17:14:40
上一页
Query task
下一页
Create Image
Built with