-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeepseek-chat-completion-api-openapi.yml
More file actions
173 lines (173 loc) · 6.01 KB
/
deepseek-chat-completion-api-openapi.yml
File metadata and controls
173 lines (173 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
openapi: 3.1.0
info:
title: DeepSeek Chat Completion API
description: Creates a model response for the given chat conversation.
version: 1.0.0
servers:
- url: https://api.deepseek.com
paths:
/chat/completions:
post:
summary: DeepSeek Create Chat Completion
description: Creates a model response for the given chat conversation.
operationId: createChatCompletion
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- messages
- model
properties:
messages:
type: array
items:
type: object
required:
- content
- role
properties:
content:
type: string
description: The content of the message.
role:
type: string
enum:
- system
- user
- assistant
description: The role of the message sender.
model:
type: string
enum:
- deepseek-chat
- deepseek-reasoner
description: ID of the model to use.
frequency_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
default: 0
description: >
Positive values penalize new tokens based on their
frequency in the text, reducing repetition.
max_tokens:
type: integer
nullable: true
minimum: 1
maximum: 8192
default: 4096
description: The maximum number of tokens to generate.
presence_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
default: 0
description: >
Positive values penalize new tokens that appear in the text,
encouraging discussion of new topics.
response_format:
type: object
nullable: true
description: Format of the response.
properties:
type:
type: string
description: The format of the response, e.g., text.
stop:
type: object
nullable: true
description: Sequence where the model stops generating tokens.
stream:
type: boolean
nullable: true
description: Whether to stream responses as they are generated.
stream_options:
type: object
nullable: true
description: Options for streaming responses.
temperature:
type: number
nullable: true
maximum: 2
default: 1
description: >-
Controls randomness in generation (higher values = more
random).
top_p:
type: number
nullable: true
maximum: 1
default: 1
description: >
Nucleus sampling parameter. Tokens are selected from the top_p probability mass.
tools:
type: array
nullable: true
items:
type: object
description: Tools available for the model to use.
tool_choice:
type: object
nullable: true
description: Configuration for tool selection.
logprobs:
type: boolean
nullable: true
description: Whether to return log probabilities of output tokens.
top_logprobs:
type: integer
nullable: true
maximum: 20
description: >
Number of most likely tokens to return with log
probabilities. Requires logprobs to be true.
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
required:
- id
- choices
- created
- model
- system_fingerprint
- object
properties:
id:
type: string
description: Unique identifier for the chat completion.
choices:
type: array
items:
type: object
description: Array of generated responses.
created:
type: integer
format: int64
description: Unix timestamp when the response was created.
model:
type: string
description: Model used for the response.
system_fingerprint:
type: string
description: Backend configuration fingerprint.
object:
type: string
enum:
- chat.completion
description: Object type.
usage:
type: object
description: Token usage details.
tags:
- Chat
tags:
- name: Chat