English
  • English
  • 简体中文
  1. OpenAI
English
  • English
  • 简体中文
  • Introduction (Must Read)
  • OpenAI official library usage tutorial
  • Obtain Base URL and API Key
  • OpenAI
    • Chat
      POST
    • Chat (o1,o3,o4 series model)
      POST
    • dall--e-3
      POST
    • gpt-image-1
      POST
    • Image edit
      POST
    • Analyze image
      POST
    • Analyze PDF
      POST
    • o3-pro
      POST
  • Gemini
    • gemini
      POST
  1. OpenAI

Chat (o1,o3,o4 series model)

Developing
POST
{{base_url}}/v1/chat/completions
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{base_url}}/v1/chat/completions' \
--header 'Authorization: sk-shdahd【You ApiKey】' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "o1-mini",
    "messages": [
        {
            "role": "user",
            "content": "晚上好"
        }
    ],
    "max_tokens": 1688,
    "temperature": 0.5,
    "stream": false
}'
Response Response Example
{
    "id": "chatcmpl-A1iMgDLzZtUJ9QDpfqDLxKH0zfUnp",
    "object": "chat.completion",
    "created": 1724972230,
    "model": "o1-mini",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "晚上好!有什么我可以帮你的吗?",
                "refusal": null
            },
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 10,
        "total_tokens": 19
    },
    "system_fingerprint": "fp_157b3831f5"
}

Request

Header Params

Body Params application/json

Examples

Responses

🟢200成功
application/json
Body

Modified at 2025-06-04 09:33:00
Previous
Chat
Next
dall--e-3
Built with