Khi được nhắc, mô hình sẽ trả về một hoặc nhiều kết quả dự đoán hoàn thành và cũng có thể trả về xác suất của các mã thông báo thay thế cho mỗi vị trí. Tạo phần hoàn thành cho lời nhắc và tham số được cung cấp Tài liệu chính thức: https://platform.openai.com/docs/api-reference/chat/create
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Body Params application/json
Example
{"model":"gpt-4o","max_tokens":1000,"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello"}],"temperature":1.0,"stream":true,"stream_options":{"include_usage":true}}
{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"choices":[{"index":0,"message":{"role":"assistant","content":"\n\nHello there, how may I assist you today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21}}