Skip to main content

Request

curl -X POST 'https://gptproto.com/v1/messages' \
-H 'Authorization: GPTPROTO_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Accept: text/event-stream' \
--data '{
    "stream": false,
    "model": "claude-haiku-4-5-20251001",
    "messages": [
        {
            "role":"user",
            "content": [{"type":"text","text": "你好,现在是几点"}]
        }
    ]
}'

Reponse

{
    "model": "claude-haiku-4-5-20251001",
    "id": "msg_bdrk_01LZo848oHddNScrKvWF5F2w",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "text",
            "text": "你好!😊\n\n我无法获取实时时间信息,所以不知道现在具体是几点。\n\n你可以通过以下方式查看:\n- 看手机或电脑上的时间显示\n- 问一下身边的人\n- 查看你的设备系统时间\n\n有什么我可以帮助你的吗?"
        }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
        "input_tokens": 16,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "cache_creation": {
            "ephemeral_5m_input_tokens": 0,
            "ephemeral_1h_input_tokens": 0
        },
        "output_tokens": 102
    }
}

Parameters

Core Parameters

ParameterTypeRequiredDefaultRangeDescription
streamboolfalse-
modelstring--Model ID used to generate the response
messagesarray[{'role': 'user', 'content': 'Who are you?'}]role list:
user
assistant
system
developer
Array of message objects for the conversation. Each message must have a role (user or assistant) and content.

Messages Array Structure

Each message object in the messages array should have the following structure:
FieldTypeRequiredDescription
rolestringThe role of the message. Can be: user, assistant, system, or developer
contentarrayThe content of the message

Content Array Structure

FieldTypeRequiredExampleDescription
typestringtextThe type of content
textstringHello, who are you!The text content when type is text