1. anthropic端点
聊天(chat)
  • 聊天(chat)
  • claude
    • anthropic端点
      • 生文
        POST
    • openai端点
      • 生文
  1. anthropic端点

生文

POST
/v1/messages
支持模型:
claude-haiku-4-5-20251001
claude-haiku-3-5-20241022
claude-opus-4-6
claude-opus-4-5-20251101
claude-opus-4-1-20250805
claude-opus-4-20250514
claude-sonnet-4-6
claude-sonnet-4-5-20250929
claude-sonnet-4-20250514

请求参数

Header 参数

Body 参数application/json

示例

返回响应

🟢200
application/json
Body

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/messages' \
--header 'Authorization;' \
--header 'anthropic-version;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "max_tokens": 0,
    "messages": [
        {
            "role": "string",
            "content": [
                [
                    [
                        {}
                    ]
                ]
            ]
        }
    ],
    "model": "string",
    "cache_control": {
        "type": "string",
        "ttl": "string"
    },
    "container": "string",
    "inference_geo": "string",
    "metadata": {
        "user_id": "string"
    },
    "output_config": {
        "effort": "string",
        "format": {
            "schema": {
                "key": {}
            },
            "type": "string"
        }
    },
    "service_tier": "string",
    "stop_sequences": [
        "string"
    ],
    "stream": true,
    "system": [
        [
            [
                {}
            ]
        ]
    ],
    "temperature": 0,
    "thinking": {
        "type": "string",
        "budget_tokens": 0,
        "display": "string"
    },
    "tool_choice": {
        "type": "string",
        "disable_parallel_tool_use": true
    },
    "tools": [
        {
            "name": "string",
            "type": "string",
            "description": "string",
            "input_schema": {
                "type": "string",
                "properties": {
                    "key": {}
                },
                "required": [
                    "string"
                ]
            },
            "allowed_callers": [
                "string"
            ],
            "cache_control": {
                "type": "string",
                "ttl": "string"
            },
            "defer_loading": true,
            "eager_input_streaming": true,
            "input_examples": [
                {
                    "key": {}
                }
            ],
            "strict": true,
            "allowed_domains": [
                "string"
            ],
            "blocked_domains": [
                "string"
            ],
            "max_uses": 0,
            "user_location": {
                "type": "string",
                "city": "string",
                "country": "string",
                "region": "string",
                "timezone": "string"
            },
            "citations": {
                "enabled": true
            },
            "max_content_tokens": 0,
            "use_cache": true,
            "max_characters": 0
        }
    ],
    "top_k": 0,
    "top_p": 0
}'
响应示例响应示例
{}
修改于 2026-04-02 17:10:28
下一页
生文
Built with