6returned from the model using server-sent events.6returned from the model using server-sent events.
7[Learn more](https://developers.openai.com/api/docs/guides/streaming-responses).7[Learn more](https://developers.openai.com/api/docs/guides/streaming-responses).
8 8
9<a id="chat.completion.chunk"></a>
10
9## chat.completion.chunk11## chat.completion.chunk
10 12
11Represents a streamed chunk of a chat completion response returned13Represents a streamed chunk of a chat completion response returned
16 18
17Schema name: `CreateChatCompletionStreamResponse`19Schema name: `CreateChatCompletionStreamResponse`
18 20
19```json21- `id: string`
20{22
21 "(resource) chat.completions > (model) chat_completion_chunk > (schema)": {23 A unique identifier for the chat completion. Each chunk has the same ID.
22 "kind": "HttpDeclTypeAlias",24
23 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse",25- `choices: array of object { delta, finish_reason, index, logprobs }`
24 "docstring": "Represents a streamed chunk of a chat completion response returned\nby the model, based on the provided input.\n[Learn more](/api/docs/guides/streaming-responses).\n",26
25 "ident": "ChatCompletionChunk",27 A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the
26 "type": {28 last chunk if you set `stream_options: {"include_usage": true}`.
27 "kind": "HttpTypeObject",29
28 "members": [30 - `delta: object { content, function_call, refusal, 2 more }`
29 {31
30 "ident": "id"32 A chat completion delta generated by streamed model responses.
31 },33
32 {34 - `content: optional string or null`
33 "ident": "choices"35
34 },36 The contents of the chunk message.
35 {37
36 "ident": "created"38 - `function_call: optional object { arguments, name }`
37 },39
38 {40 Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
39 "ident": "model"41
40 },42 - `arguments: optional string`
41 {43
42 "ident": "object"44 The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
43 },45
44 {46 - `name: optional string`
45 "ident": "moderation"47
46 },48 The name of the function to call.
47 {49
48 "ident": "obfuscation"50 - `refusal: optional string or null`
49 },51
50 {52 The refusal message generated by the model.
51 "ident": "service_tier"53
52 },54 - `role: optional "developer" or "system" or "user" or 2 more`
53 {55
54 "ident": "system_fingerprint"56 The role of the author of this message.
55 },57
56 {58 - `"developer"`
57 "ident": "usage"59
58 }60 - `"system"`
59 ]61
60 },62 - `"user"`
61 "childrenParentSchema": "object",63
62 "children": [64 - `"assistant"`
63 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) id",65
64 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices",66 - `"tool"`
65 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) created",67
66 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) model",68 - `tool_calls: optional array of object { index, id, function, type }`
67 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) object",69
68 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation",70 - `index: number`
69 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) obfuscation",71
70 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier",72 - `id: optional string`
71 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) system_fingerprint",73
72 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) usage"74 The ID of the tool call.
73 ]75
74 },76 - `function: optional object { arguments, name }`
75 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) id": {77
76 "kind": "HttpDeclProperty",78 - `arguments: optional string`
77 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/id",79
78 "deprecated": false,80 The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
79 "key": "id",81
80 "docstring": "A unique identifier for the chat completion. Each chunk has the same ID.",82 - `name: optional string`
81 "type": {83
82 "kind": "HttpTypeString"84 The name of the function to call.
83 },85
84 "optional": false,86 - `type: optional "function"`
85 "nullable": false,87
86 "schemaType": "string",88 The type of the tool. Currently, only `function` is supported.
87 "children": []89
88 },90 - `"function"`
89 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices": {91
90 "kind": "HttpDeclProperty",92 - `finish_reason: "stop" or "length" or "tool_calls" or 2 more or null`
91 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices",93
92 "deprecated": false,94 The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
93 "key": "choices",95 `length` if the maximum number of tokens specified in the request was reached,
94 "docstring": "A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the\nlast chunk if you set `stream_options: {\"include_usage\": true}`.\n",96 `content_filter` if content was omitted due to a flag from our content filters,
95 "type": {97 `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
96 "kind": "HttpTypeArray",98
97 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices",99 - `"stop"`
98 "elementType": {100
99 "kind": "HttpTypeObject",101 - `"length"`
100 "members": [102
101 {103 - `"tool_calls"`
102 "ident": "delta"104
103 },105 - `"content_filter"`
104 {106
105 "ident": "finish_reason"107 - `"function_call"`
106 },108
107 {109 - `index: number`
108 "ident": "index"110
109 },111 The index of the choice in the list of choices.
110 {112
111 "ident": "logprobs"113 - `logprobs: optional object { content, refusal } or null`
112 }114
113 ]115 Log probability information for the choice.
114 }116
115 },117 - `content: array of ChatCompletionTokenLogprob or null`
116 "optional": false,118
117 "nullable": false,119 A list of message content tokens with log probability information.
118 "schemaType": "array",120
119 "childrenParentSchema": "object",121 - `token: string`
120 "children": [122
121 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta",123 The token.
122 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason",124
123 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) index",125 - `bytes: array of number or null`
124 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs"126
125 ]127 A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
126 },128
127 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) created": {129 - `logprob: number`
128 "kind": "HttpDeclProperty",130
129 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/created",131 The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
130 "deprecated": false,132
131 "key": "created",133 - `top_logprobs: array of object { token, bytes, logprob }`
132 "docstring": "The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.",134
133 "type": {135 List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
134 "kind": "HttpTypeNumber"136
135 },137 - `token: string`
136 "constraints": {138
137 "format": "unixtime"139 The token.
138 },140
139 "optional": false,141 - `bytes: array of number or null`
140 "nullable": false,142
141 "schemaType": "integer",143 A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
142 "children": []144
143 },145 - `logprob: number`
144 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) model": {146
145 "kind": "HttpDeclProperty",147 The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
146 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/model",148
147 "deprecated": false,149 - `refusal: array of ChatCompletionTokenLogprob or null`
148 "key": "model",150
149 "docstring": "The model to generate the completion.",151 A list of message refusal tokens with log probability information.
150 "type": {152
151 "kind": "HttpTypeString"153 - `token: string`
152 },154
153 "optional": false,155 The token.
154 "nullable": false,156
155 "schemaType": "string",157 - `bytes: array of number or null`
156 "children": []158
157 },159 A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
158 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) object": {160
159 "kind": "HttpDeclProperty",161 - `logprob: number`
160 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/object",162
161 "deprecated": false,163 The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
162 "key": "object",164
163 "docstring": "The object type, which is always `chat.completion.chunk`.",165 - `top_logprobs: array of object { token, bytes, logprob }`
164 "type": {166
165 "kind": "HttpTypeUnion",167 List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
166 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/object",168
167 "types": [169- `created: number`
168 {170
169 "kind": "HttpTypeLiteral",171 The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
170 "literal": "chat.completion.chunk"172
171 }173- `model: string`
172 ]174
173 },175 The model to generate the completion.
174 "optional": false,176
175 "nullable": false,177- `object: "chat.completion.chunk"`
176 "schemaType": "enum",178
177 "childrenParentSchema": "enum",179 The object type, which is always `chat.completion.chunk`.
178 "children": [180
179 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) object > (member) 0"181 - `"chat.completion.chunk"`
180 ]182
181 },183- `moderation: optional object { input, output } or null`
182 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation": {184
183 "kind": "HttpDeclProperty",185 Moderation results for the request input and generated output. Present
184 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/moderation",186 on the moderation chunk when moderated completions are requested.
185 "deprecated": false,187
186 "key": "moderation",188 - `input: object { model, results, type } or object { code, message, type }`
187 "docstring": "Moderation results for the request input and generated output. Present\non the moderation chunk when moderated completions are requested.\n",189
188 "type": {190 Moderation for the request input.
189 "kind": "HttpTypeObject",191
190 "members": [192 - `ModerationResults object { model, results, type }`
191 {193
192 "ident": "input"194 Successful moderation results for the request input or generated output.
193 },195
194 {196 - `model: string`
195 "ident": "output"197
196 }198 The moderation model used to generate the results.
197 ]199
198 },200 - `results: array of object { categories, category_applied_input_types, category_scores, 3 more }`
199 "optional": true,201
200 "nullable": true,202 A list of moderation results.
201 "schemaType": "object",203
202 "childrenParentSchema": "object",204 - `categories: map[boolean]`
203 "children": [205
204 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input",206 A dictionary of moderation categories to booleans, True if the input is flagged under this category.
205 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output"207
206 ]208 - `category_applied_input_types: map[array of "text" or "image"]`
207 },209
208 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) obfuscation": {210 Which modalities of input are reflected by the score for each category.
209 "kind": "HttpDeclProperty",211
210 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/obfuscation",212 - `"text"`
211 "deprecated": false,213
212 "key": "obfuscation",214 - `"image"`
213 "docstring": "An obfuscation string added to normalize the size of streamed chunks as a\nmitigation to certain side-channel attacks. The field is included by\ndefault and omitted when `stream_options.include_obfuscation` is `false`.\n",215
214 "type": {216 - `category_scores: map[number]`
215 "kind": "HttpTypeString"217
216 },218 A dictionary of moderation categories to scores.
217 "optional": true,219
218 "nullable": false,220 - `flagged: boolean`
219 "schemaType": "string",221
220 "children": []222 A boolean indicating whether the content was flagged by any category.
221 },223
222 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier": {224 - `model: string`
223 "kind": "HttpDeclProperty",225
224 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/service_tier",226 The moderation model that produced this result.
225 "deprecated": false,227
226 "key": "service_tier",228 - `type: "moderation_result"`
227 "docstring": "Specifies the processing type used for serving the request.\n - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n - If set to '[flex](/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier.\n - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request.\n - When not set, the default behavior is 'auto'.\n\n When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.\n",229
228 "type": {230 The object type, which was always `moderation_result` for successful moderation results.
229 "kind": "HttpTypeUnion",231
230 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/service_tier",232 - `"moderation_result"`
231 "types": [233
232 {234 - `type: "moderation_results"`
233 "kind": "HttpTypeLiteral",235
234 "literal": "auto"236 The object type, which is always `moderation_results`.
235 },237
236 {238 - `"moderation_results"`
237 "kind": "HttpTypeLiteral",239
238 "literal": "default"240 - `Error object { code, message, type }`
239 },241
240 {242 An error produced while attempting moderation.
241 "kind": "HttpTypeLiteral",243
242 "literal": "flex"244 - `code: string`
243 },245
244 {246 The error code.
245 "kind": "HttpTypeLiteral",247
246 "literal": "scale"248 - `message: string`
247 },249
248 {250 The error message.
249 "kind": "HttpTypeLiteral",251
250 "literal": "priority"252 - `type: "error"`
251 },253
252 {254 The object type, which is always `error`.
253 "kind": "HttpTypeLiteral",255
254 "literal": "fast"256 - `"error"`
255 }257
256 ]258 - `output: object { model, results, type } or object { code, message, type }`
257 },259
258 "default": "auto",260 Moderation for the generated output.
259 "optional": true,261
260 "nullable": true,262 - `ModerationResults object { model, results, type }`
261 "schemaType": "enum",263
262 "childrenParentSchema": "enum",264 Successful moderation results for the request input or generated output.
263 "children": [265
264 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 0",266 - `model: string`
265 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 1",267
266 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 2",268 The moderation model used to generate the results.
267 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 3",269
268 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 4",270 - `results: array of object { categories, category_applied_input_types, category_scores, 3 more }`
269 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 5"271
270 ]272 A list of moderation results.
271 },273
272 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) system_fingerprint": {274 - `categories: map[boolean]`
273 "kind": "HttpDeclProperty",275
274 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/system_fingerprint",276 A dictionary of moderation categories to booleans, True if the input is flagged under this category.
275 "deprecated": true,277
276 "key": "system_fingerprint",278 - `category_applied_input_types: map[array of "text" or "image"]`
277 "docstring": "This fingerprint represents the backend configuration that the model runs with.\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",279
278 "type": {280 Which modalities of input are reflected by the score for each category.
279 "kind": "HttpTypeString"281
280 },282 - `"text"`
281 "optional": true,283
282 "nullable": false,284 - `"image"`
283 "schemaType": "string",285
284 "children": []286 - `category_scores: map[number]`
285 },287
286 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) usage": {288 A dictionary of moderation categories to scores.
287 "kind": "HttpDeclProperty",289
288 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/usage",290 - `flagged: boolean`
289 "deprecated": false,291
290 "key": "usage",292 A boolean indicating whether the content was flagged by any category.
291 "docstring": "An optional field that will only be present when you set\n`stream_options: {\"include_usage\": true}` in your request. When present, it\ncontains a null value **except for the last chunk** which contains the\ntoken usage statistics for the entire request.\n\n**NOTE:** If the stream is interrupted or cancelled, you may not\nreceive the final usage chunk which contains the total token usage for\nthe request.\n",293
292 "type": {294 - `model: string`
293 "kind": "HttpTypeReference",295
294 "ident": "CompletionUsage",296 The moderation model that produced this result.
295 "$ref": "(resource) completions > (model) completion_usage > (schema)"297
296 },298 - `type: "moderation_result"`
297 "optional": true,299
298 "nullable": true,300 The object type, which was always `moderation_result` for successful moderation results.
299 "modelImplicit": false,301
300 "schemaType": "object",302 - `"moderation_result"`
301 "modelPath": "(resource) completions > (model) completion_usage",303
302 "childrenParentSchema": "object",304 - `type: "moderation_results"`
303 "children": [305
304 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens",306 The object type, which is always `moderation_results`.
305 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens",307
306 "(resource) completions > (model) completion_usage > (schema) > (property) total_tokens",308 - `"moderation_results"`
307 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details",309
308 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details"310 - `Error object { code, message, type }`
309 ]311
310 },312 An error produced while attempting moderation.
311 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta": {313
312 "kind": "HttpDeclProperty",314 - `code: string`
313 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/delta",315
314 "deprecated": false,316 The error code.
315 "key": "delta",317
316 "docstring": "A chat completion delta generated by streamed model responses.",318 - `message: string`
317 "type": {319
318 "kind": "HttpTypeObject",320 The error message.
319 "members": [321
320 {322 - `type: "error"`
321 "ident": "content"323
322 },324 The object type, which is always `error`.
323 {325
324 "ident": "function_call"326 - `"error"`
325 },327
326 {328- `obfuscation: optional string`
327 "ident": "refusal"329
328 },330 An obfuscation string added to normalize the size of streamed chunks as a
329 {331 mitigation to certain side-channel attacks. The field is included by
330 "ident": "role"332 default and omitted when `stream_options.include_obfuscation` is `false`.
331 },333
332 {334- `service_tier: optional "auto" or "default" or "flex" or 3 more or null`
333 "ident": "tool_calls"335
334 }336 Specifies the processing type used for serving the request.
335 ]337
336 },338 - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
337 "optional": false,339 - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
338 "nullable": false,340 - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier.
339 "schemaType": "object",341 - To opt-in to [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request.
340 "childrenParentSchema": "object",342 - When not set, the default behavior is 'auto'.
341 "children": [343
342 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) content",344 When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
343 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call",345
344 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) refusal",346 - `"auto"`
345 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role",347
346 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls"348 - `"default"`
347 ]349
348 },350 - `"flex"`
349 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason": {351
350 "kind": "HttpDeclProperty",352 - `"scale"`
351 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/finish_reason",353
352 "deprecated": false,354 - `"priority"`
353 "key": "finish_reason",355
354 "docstring": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.\n",356 - `"fast"`
355 "type": {357
356 "kind": "HttpTypeUnion",358- `system_fingerprint: optional string`
357 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/finish_reason",359
358 "types": [360 This fingerprint represents the backend configuration that the model runs with.
359 {361 Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
360 "kind": "HttpTypeLiteral",362
361 "literal": "stop"363- `usage: optional CompletionUsage or null`
362 },364
363 {365 An optional field that will only be present when you set
364 "kind": "HttpTypeLiteral",366 `stream_options: {"include_usage": true}` in your request. When present, it
365 "literal": "length"367 contains a null value **except for the last chunk** which contains the
366 },368 token usage statistics for the entire request.
367 {369
368 "kind": "HttpTypeLiteral",370 **NOTE:** If the stream is interrupted or cancelled, you may not
369 "literal": "tool_calls"371 receive the final usage chunk which contains the total token usage for
370 },372 the request.
371 {373
372 "kind": "HttpTypeLiteral",374 - `completion_tokens: number`
373 "literal": "content_filter"375
374 },376 Number of tokens in the generated completion.
375 {377
376 "kind": "HttpTypeLiteral",378 - `prompt_tokens: number`
377 "literal": "function_call"379
378 }380 Number of tokens in the prompt.
379 ]381
380 },382 - `total_tokens: number`
381 "optional": false,383
382 "nullable": true,384 Total number of tokens used in the request (prompt + completion).
383 "schemaType": "enum",385
384 "childrenParentSchema": "enum",386 - `completion_tokens_details: optional object { accepted_prediction_tokens, audio_tokens, reasoning_tokens, 2 more }`
385 "children": [387
386 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 0",388 Breakdown of tokens used in a completion.
387 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 1",389
388 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 2",390 - `accepted_prediction_tokens: optional number`
389 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 3",391
390 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 4"392 When using Predicted Outputs, the number of tokens in the
391 ]393 prediction that appeared in the completion.
392 },394
393 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) index": {395 - `audio_tokens: optional number`
394 "kind": "HttpDeclProperty",396
395 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/index",397 Audio input tokens generated by the model.
396 "deprecated": false,398
397 "key": "index",399 - `reasoning_tokens: optional number`
398 "docstring": "The index of the choice in the list of choices.",400
399 "type": {401 Tokens generated by the model for reasoning.
400 "kind": "HttpTypeNumber"402
401 },403 - `rejected_prediction_tokens: optional number`
402 "optional": false,404
403 "nullable": false,405 When using Predicted Outputs, the number of tokens in the
404 "schemaType": "integer",406 prediction that did not appear in the completion. However, like
405 "children": []407 reasoning tokens, these tokens are still counted in the total
406 },408 completion tokens for purposes of billing, output, and context window
407 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs": {409 limits.
408 "kind": "HttpDeclProperty",410
409 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/logprobs",411 - `text_tokens: optional number`
410 "deprecated": false,412
411 "key": "logprobs",413 Text output tokens generated by the model.
412 "docstring": "Log probability information for the choice.",414
413 "type": {415 - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }`
414 "kind": "HttpTypeObject",416
415 "members": [417 Breakdown of tokens used in the prompt.
416 {418
417 "ident": "content"419 - `audio_tokens: optional number`
418 },420
419 {421 Audio input tokens present in the prompt.
420 "ident": "refusal"422
421 }423 - `cache_write_tokens: optional number`
422 ]424
423 },425 The unadjusted number of prompt tokens written to cache.
424 "optional": true,426
425 "nullable": true,427 - `cached_tokens: optional number`
426 "schemaType": "object",428
427 "childrenParentSchema": "object",429 Cached tokens present in the prompt.
428 "children": [430
429 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs > (property) content",431 - `image_tokens: optional number`
430 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs > (property) refusal"432
431 ]433 Image input tokens present in the prompt.
432 },434
433 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) object > (member) 0": {435 - `text_tokens: optional number`
434 "kind": "HttpDeclReference",436
435 "type": {437 Text input tokens present in the prompt.
436 "kind": "HttpTypeLiteral",
437 "literal": "chat.completion.chunk"
438 }
439 },
440 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input": {
441 "kind": "HttpDeclProperty",
442 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/input",
443 "deprecated": false,
444 "key": "input",
445 "docstring": "Moderation for the request input.",
446 "type": {
447 "kind": "HttpTypeUnion",
448 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/input",
449 "types": [
450 {
451 "kind": "HttpTypeObject",
452 "members": [
453 {
454 "ident": "model"
455 },
456 {
457 "ident": "results"
458 },
459 {
460 "ident": "type"
461 }
462 ]
463 },
464 {
465 "kind": "HttpTypeObject",
466 "members": [
467 {
468 "ident": "code"
469 },
470 {
471 "ident": "message"
472 },
473 {
474 "ident": "type"
475 }
476 ]
477 }
478 ]
479 },
480 "optional": false,
481 "nullable": false,
482 "schemaType": "union",
483 "childrenParentSchema": "union",
484 "children": [
485 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0",
486 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1"
487 ]
488 },
489 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output": {
490 "kind": "HttpDeclProperty",
491 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/output",
492 "deprecated": false,
493 "key": "output",
494 "docstring": "Moderation for the generated output.",
495 "type": {
496 "kind": "HttpTypeUnion",
497 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/output",
498 "types": [
499 {
500 "kind": "HttpTypeObject",
501 "members": [
502 {
503 "ident": "model"
504 },
505 {
506 "ident": "results"
507 },
508 {
509 "ident": "type"
510 }
511 ]
512 },
513 {
514 "kind": "HttpTypeObject",
515 "members": [
516 {
517 "ident": "code"
518 },
519 {
520 "ident": "message"
521 },
522 {
523 "ident": "type"
524 }
525 ]
526 }
527 ]
528 },
529 "optional": false,
530 "nullable": false,
531 "schemaType": "union",
532 "childrenParentSchema": "union",
533 "children": [
534 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0",
535 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1"
536 ]
537 },
538 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 0": {
539 "kind": "HttpDeclReference",
540 "type": {
541 "kind": "HttpTypeLiteral",
542 "literal": "auto"
543 }
544 },
545 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 1": {
546 "kind": "HttpDeclReference",
547 "type": {
548 "kind": "HttpTypeLiteral",
549 "literal": "default"
550 }
551 },
552 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 2": {
553 "kind": "HttpDeclReference",
554 "type": {
555 "kind": "HttpTypeLiteral",
556 "literal": "flex"
557 }
558 },
559 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 3": {
560 "kind": "HttpDeclReference",
561 "type": {
562 "kind": "HttpTypeLiteral",
563 "literal": "scale"
564 }
565 },
566 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 4": {
567 "kind": "HttpDeclReference",
568 "type": {
569 "kind": "HttpTypeLiteral",
570 "literal": "priority"
571 }
572 },
573 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) service_tier > (member) 5": {
574 "kind": "HttpDeclReference",
575 "type": {
576 "kind": "HttpTypeLiteral",
577 "literal": "fast"
578 }
579 },
580 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens": {
581 "kind": "HttpDeclProperty",
582 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens",
583 "deprecated": false,
584 "key": "completion_tokens",
585 "docstring": "Number of tokens in the generated completion.",
586 "type": {
587 "kind": "HttpTypeNumber"
588 },
589 "default": 0,
590 "optional": false,
591 "nullable": false,
592 "schemaType": "integer",
593 "children": []
594 },
595 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens": {
596 "kind": "HttpDeclProperty",
597 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens",
598 "deprecated": false,
599 "key": "prompt_tokens",
600 "docstring": "Number of tokens in the prompt.",
601 "type": {
602 "kind": "HttpTypeNumber"
603 },
604 "default": 0,
605 "optional": false,
606 "nullable": false,
607 "schemaType": "integer",
608 "children": []
609 },
610 "(resource) completions > (model) completion_usage > (schema) > (property) total_tokens": {
611 "kind": "HttpDeclProperty",
612 "oasRef": "#/components/schemas/CompletionUsage/properties/total_tokens",
613 "deprecated": false,
614 "key": "total_tokens",
615 "docstring": "Total number of tokens used in the request (prompt + completion).",
616 "type": {
617 "kind": "HttpTypeNumber"
618 },
619 "default": 0,
620 "optional": false,
621 "nullable": false,
622 "schemaType": "integer",
623 "children": []
624 },
625 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details": {
626 "kind": "HttpDeclProperty",
627 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details",
628 "deprecated": false,
629 "key": "completion_tokens_details",
630 "docstring": "Breakdown of tokens used in a completion.",
631 "type": {
632 "kind": "HttpTypeObject",
633 "members": [
634 {
635 "ident": "accepted_prediction_tokens"
636 },
637 {
638 "ident": "audio_tokens"
639 },
640 {
641 "ident": "reasoning_tokens"
642 },
643 {
644 "ident": "rejected_prediction_tokens"
645 },
646 {
647 "ident": "text_tokens"
648 }
649 ]
650 },
651 "optional": true,
652 "nullable": false,
653 "schemaType": "object",
654 "childrenParentSchema": "object",
655 "children": [
656 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) accepted_prediction_tokens",
657 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) audio_tokens",
658 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) reasoning_tokens",
659 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) rejected_prediction_tokens",
660 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) text_tokens"
661 ]
662 },
663 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details": {
664 "kind": "HttpDeclProperty",
665 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details",
666 "deprecated": false,
667 "key": "prompt_tokens_details",
668 "docstring": "Breakdown of tokens used in the prompt.",
669 "type": {
670 "kind": "HttpTypeObject",
671 "members": [
672 {
673 "ident": "audio_tokens"
674 },
675 {
676 "ident": "cache_write_tokens"
677 },
678 {
679 "ident": "cached_tokens"
680 },
681 {
682 "ident": "image_tokens"
683 },
684 {
685 "ident": "text_tokens"
686 }
687 ]
688 },
689 "optional": true,
690 "nullable": false,
691 "schemaType": "object",
692 "childrenParentSchema": "object",
693 "children": [
694 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) audio_tokens",
695 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) cache_write_tokens",
696 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) cached_tokens",
697 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) image_tokens",
698 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) text_tokens"
699 ]
700 },
701 "(resource) completions > (model) completion_usage > (schema)": {
702 "kind": "HttpDeclTypeAlias",
703 "oasRef": "#/components/schemas/CompletionUsage",
704 "docstring": "Usage statistics for the completion request.",
705 "ident": "CompletionUsage",
706 "type": {
707 "kind": "HttpTypeObject",
708 "members": [
709 {
710 "ident": "completion_tokens"
711 },
712 {
713 "ident": "prompt_tokens"
714 },
715 {
716 "ident": "total_tokens"
717 },
718 {
719 "ident": "completion_tokens_details"
720 },
721 {
722 "ident": "prompt_tokens_details"
723 }
724 ]
725 },
726 "childrenParentSchema": "object",
727 "children": [
728 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens",
729 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens",
730 "(resource) completions > (model) completion_usage > (schema) > (property) total_tokens",
731 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details",
732 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details"
733 ]
734 },
735 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) content": {
736 "kind": "HttpDeclProperty",
737 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/content",
738 "deprecated": false,
739 "key": "content",
740 "docstring": "The contents of the chunk message.",
741 "type": {
742 "kind": "HttpTypeString"
743 },
744 "optional": true,
745 "nullable": true,
746 "schemaType": "string",
747 "children": []
748 },
749 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call": {
750 "kind": "HttpDeclProperty",
751 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/function_call",
752 "deprecated": true,
753 "key": "function_call",
754 "docstring": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
755 "type": {
756 "kind": "HttpTypeObject",
757 "members": [
758 {
759 "ident": "arguments"
760 },
761 {
762 "ident": "name"
763 }
764 ]
765 },
766 "optional": true,
767 "nullable": false,
768 "schemaType": "object",
769 "childrenParentSchema": "object",
770 "children": [
771 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call > (property) arguments",
772 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call > (property) name"
773 ]
774 },
775 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) refusal": {
776 "kind": "HttpDeclProperty",
777 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/refusal",
778 "deprecated": false,
779 "key": "refusal",
780 "docstring": "The refusal message generated by the model.",
781 "type": {
782 "kind": "HttpTypeString"
783 },
784 "optional": true,
785 "nullable": true,
786 "schemaType": "string",
787 "children": []
788 },
789 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role": {
790 "kind": "HttpDeclProperty",
791 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/role",
792 "deprecated": false,
793 "key": "role",
794 "docstring": "The role of the author of this message.",
795 "type": {
796 "kind": "HttpTypeUnion",
797 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/role",
798 "types": [
799 {
800 "kind": "HttpTypeLiteral",
801 "literal": "developer"
802 },
803 {
804 "kind": "HttpTypeLiteral",
805 "literal": "system"
806 },
807 {
808 "kind": "HttpTypeLiteral",
809 "literal": "user"
810 },
811 {
812 "kind": "HttpTypeLiteral",
813 "literal": "assistant"
814 },
815 {
816 "kind": "HttpTypeLiteral",
817 "literal": "tool"
818 }
819 ]
820 },
821 "optional": true,
822 "nullable": false,
823 "schemaType": "enum",
824 "childrenParentSchema": "enum",
825 "children": [
826 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 0",
827 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 1",
828 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 2",
829 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 3",
830 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 4"
831 ]
832 },
833 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls": {
834 "kind": "HttpDeclProperty",
835 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/tool_calls",
836 "deprecated": false,
837 "key": "tool_calls",
838 "type": {
839 "kind": "HttpTypeArray",
840 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/tool_calls",
841 "elementType": {
842 "kind": "HttpTypeObject",
843 "members": [
844 {
845 "ident": "index"
846 },
847 {
848 "ident": "id"
849 },
850 {
851 "ident": "function"
852 },
853 {
854 "ident": "type"
855 }
856 ]
857 }
858 },
859 "optional": true,
860 "nullable": false,
861 "schemaType": "array",
862 "childrenParentSchema": "object",
863 "children": [
864 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) index",
865 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) id",
866 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function",
867 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) type"
868 ]
869 },
870 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 0": {
871 "kind": "HttpDeclReference",
872 "type": {
873 "kind": "HttpTypeLiteral",
874 "literal": "stop"
875 }
876 },
877 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 1": {
878 "kind": "HttpDeclReference",
879 "type": {
880 "kind": "HttpTypeLiteral",
881 "literal": "length"
882 }
883 },
884 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 2": {
885 "kind": "HttpDeclReference",
886 "type": {
887 "kind": "HttpTypeLiteral",
888 "literal": "tool_calls"
889 }
890 },
891 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 3": {
892 "kind": "HttpDeclReference",
893 "type": {
894 "kind": "HttpTypeLiteral",
895 "literal": "content_filter"
896 }
897 },
898 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) finish_reason > (member) 4": {
899 "kind": "HttpDeclReference",
900 "type": {
901 "kind": "HttpTypeLiteral",
902 "literal": "function_call"
903 }
904 },
905 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs > (property) content": {
906 "kind": "HttpDeclProperty",
907 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/logprobs/properties/content",
908 "deprecated": false,
909 "key": "content",
910 "docstring": "A list of message content tokens with log probability information.",
911 "type": {
912 "kind": "HttpTypeArray",
913 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/logprobs/properties/content",
914 "elementType": {
915 "kind": "HttpTypeReference",
916 "ident": "ChatCompletionTokenLogprob",
917 "$ref": "(resource) chat.completions > (model) chat_completion_token_logprob > (schema)"
918 }
919 },
920 "optional": false,
921 "nullable": true,
922 "schemaType": "array",
923 "childrenParentSchema": "object",
924 "children": [
925 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) token",
926 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) bytes",
927 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) logprob",
928 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs"
929 ]
930 },
931 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) logprobs > (property) refusal": {
932 "kind": "HttpDeclProperty",
933 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/logprobs/properties/refusal",
934 "deprecated": false,
935 "key": "refusal",
936 "docstring": "A list of message refusal tokens with log probability information.",
937 "type": {
938 "kind": "HttpTypeArray",
939 "oasRef": "#/components/schemas/CreateChatCompletionStreamResponse/properties/choices/items/properties/logprobs/properties/refusal",
940 "elementType": {
941 "kind": "HttpTypeReference",
942 "ident": "ChatCompletionTokenLogprob",
943 "$ref": "(resource) chat.completions > (model) chat_completion_token_logprob > (schema)"
944 }
945 },
946 "optional": false,
947 "nullable": true,
948 "schemaType": "array",
949 "childrenParentSchema": "object",
950 "children": [
951 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) token",
952 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) bytes",
953 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) logprob",
954 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs"
955 ]
956 },
957 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0": {
958 "kind": "HttpDeclTypeAlias",
959 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/input/oneOf/0",
960 "docstring": "Successful moderation results for the request input or generated output.",
961 "ident": "ModerationResults",
962 "type": {
963 "kind": "HttpTypeObject",
964 "members": [
965 {
966 "ident": "model"
967 },
968 {
969 "ident": "results"
970 },
971 {
972 "ident": "type"
973 }
974 ]
975 },
976 "childrenParentSchema": "object",
977 "children": [
978 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) model",
979 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results",
980 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) type"
981 ]
982 },
983 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1": {
984 "kind": "HttpDeclTypeAlias",
985 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/input/oneOf/1",
986 "docstring": "An error produced while attempting moderation.",
987 "ident": "Error",
988 "type": {
989 "kind": "HttpTypeObject",
990 "members": [
991 {
992 "ident": "code"
993 },
994 {
995 "ident": "message"
996 },
997 {
998 "ident": "type"
999 }
1000 ]
1001 },
1002 "childrenParentSchema": "object",
1003 "children": [
1004 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) code",
1005 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) message",
1006 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) type"
1007 ]
1008 },
1009 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0": {
1010 "kind": "HttpDeclTypeAlias",
1011 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/output/oneOf/0",
1012 "docstring": "Successful moderation results for the request input or generated output.",
1013 "ident": "ModerationResults",
1014 "type": {
1015 "kind": "HttpTypeObject",
1016 "members": [
1017 {
1018 "ident": "model"
1019 },
1020 {
1021 "ident": "results"
1022 },
1023 {
1024 "ident": "type"
1025 }
1026 ]
1027 },
1028 "childrenParentSchema": "object",
1029 "children": [
1030 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) model",
1031 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results",
1032 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) type"
1033 ]
1034 },
1035 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1": {
1036 "kind": "HttpDeclTypeAlias",
1037 "oasRef": "#/components/schemas/ChatCompletionModeration/properties/output/oneOf/1",
1038 "docstring": "An error produced while attempting moderation.",
1039 "ident": "Error",
1040 "type": {
1041 "kind": "HttpTypeObject",
1042 "members": [
1043 {
1044 "ident": "code"
1045 },
1046 {
1047 "ident": "message"
1048 },
1049 {
1050 "ident": "type"
1051 }
1052 ]
1053 },
1054 "childrenParentSchema": "object",
1055 "children": [
1056 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) code",
1057 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) message",
1058 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) type"
1059 ]
1060 },
1061 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) accepted_prediction_tokens": {
1062 "kind": "HttpDeclProperty",
1063 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details/properties/accepted_prediction_tokens",
1064 "deprecated": false,
1065 "key": "accepted_prediction_tokens",
1066 "docstring": "When using Predicted Outputs, the number of tokens in the\nprediction that appeared in the completion.\n",
1067 "type": {
1068 "kind": "HttpTypeNumber"
1069 },
1070 "default": 0,
1071 "optional": true,
1072 "nullable": false,
1073 "schemaType": "integer",
1074 "children": []
1075 },
1076 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) audio_tokens": {
1077 "kind": "HttpDeclProperty",
1078 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details/properties/audio_tokens",
1079 "deprecated": false,
1080 "key": "audio_tokens",
1081 "docstring": "Audio input tokens generated by the model.",
1082 "type": {
1083 "kind": "HttpTypeNumber"
1084 },
1085 "default": 0,
1086 "optional": true,
1087 "nullable": false,
1088 "schemaType": "integer",
1089 "children": []
1090 },
1091 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) reasoning_tokens": {
1092 "kind": "HttpDeclProperty",
1093 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details/properties/reasoning_tokens",
1094 "deprecated": false,
1095 "key": "reasoning_tokens",
1096 "docstring": "Tokens generated by the model for reasoning.",
1097 "type": {
1098 "kind": "HttpTypeNumber"
1099 },
1100 "default": 0,
1101 "optional": true,
1102 "nullable": false,
1103 "schemaType": "integer",
1104 "children": []
1105 },
1106 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) rejected_prediction_tokens": {
1107 "kind": "HttpDeclProperty",
1108 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details/properties/rejected_prediction_tokens",
1109 "deprecated": false,
1110 "key": "rejected_prediction_tokens",
1111 "docstring": "When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context window\nlimits.\n",
1112 "type": {
1113 "kind": "HttpTypeNumber"
1114 },
1115 "default": 0,
1116 "optional": true,
1117 "nullable": false,
1118 "schemaType": "integer",
1119 "children": []
1120 },
1121 "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) text_tokens": {
1122 "kind": "HttpDeclProperty",
1123 "oasRef": "#/components/schemas/CompletionUsage/properties/completion_tokens_details/properties/text_tokens",
1124 "deprecated": false,
1125 "key": "text_tokens",
1126 "docstring": "Text output tokens generated by the model.",
1127 "type": {
1128 "kind": "HttpTypeNumber"
1129 },
1130 "optional": true,
1131 "nullable": false,
1132 "schemaType": "integer",
1133 "children": []
1134 },
1135 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) audio_tokens": {
1136 "kind": "HttpDeclProperty",
1137 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details/properties/audio_tokens",
1138 "deprecated": false,
1139 "key": "audio_tokens",
1140 "docstring": "Audio input tokens present in the prompt.",
1141 "type": {
1142 "kind": "HttpTypeNumber"
1143 },
1144 "default": 0,
1145 "optional": true,
1146 "nullable": false,
1147 "schemaType": "integer",
1148 "children": []
1149 },
1150 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) cache_write_tokens": {
1151 "kind": "HttpDeclProperty",
1152 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details/properties/cache_write_tokens",
1153 "deprecated": false,
1154 "key": "cache_write_tokens",
1155 "docstring": "The unadjusted number of prompt tokens written to cache.",
1156 "type": {
1157 "kind": "HttpTypeNumber"
1158 },
1159 "default": 0,
1160 "optional": true,
1161 "nullable": false,
1162 "schemaType": "integer",
1163 "children": []
1164 },
1165 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) cached_tokens": {
1166 "kind": "HttpDeclProperty",
1167 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details/properties/cached_tokens",
1168 "deprecated": false,
1169 "key": "cached_tokens",
1170 "docstring": "Cached tokens present in the prompt.",
1171 "type": {
1172 "kind": "HttpTypeNumber"
1173 },
1174 "default": 0,
1175 "optional": true,
1176 "nullable": false,
1177 "schemaType": "integer",
1178 "children": []
1179 },
1180 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) image_tokens": {
1181 "kind": "HttpDeclProperty",
1182 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details/properties/image_tokens",
1183 "deprecated": false,
1184 "key": "image_tokens",
1185 "docstring": "Image input tokens present in the prompt.",
1186 "type": {
1187 "kind": "HttpTypeNumber"
1188 },
1189 "optional": true,
1190 "nullable": false,
1191 "schemaType": "integer",
1192 "children": []
1193 },
1194 "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details > (property) text_tokens": {
1195 "kind": "HttpDeclProperty",
1196 "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details/properties/text_tokens",
1197 "deprecated": false,
1198 "key": "text_tokens",
1199 "docstring": "Text input tokens present in the prompt.",
1200 "type": {
1201 "kind": "HttpTypeNumber"
1202 },
1203 "optional": true,
1204 "nullable": false,
1205 "schemaType": "integer",
1206 "children": []
1207 },
1208 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call > (property) arguments": {
1209 "kind": "HttpDeclProperty",
1210 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/function_call/properties/arguments",
1211 "deprecated": false,
1212 "key": "arguments",
1213 "docstring": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
1214 "type": {
1215 "kind": "HttpTypeString"
1216 },
1217 "optional": true,
1218 "nullable": false,
1219 "schemaType": "string",
1220 "children": []
1221 },
1222 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) function_call > (property) name": {
1223 "kind": "HttpDeclProperty",
1224 "oasRef": "#/components/schemas/ChatCompletionStreamResponseDelta/properties/function_call/properties/name",
1225 "deprecated": false,
1226 "key": "name",
1227 "docstring": "The name of the function to call.",
1228 "type": {
1229 "kind": "HttpTypeString"
1230 },
1231 "optional": true,
1232 "nullable": false,
1233 "schemaType": "string",
1234 "children": []
1235 },
1236 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 0": {
1237 "kind": "HttpDeclReference",
1238 "type": {
1239 "kind": "HttpTypeLiteral",
1240 "literal": "developer"
1241 }
1242 },
1243 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 1": {
1244 "kind": "HttpDeclReference",
1245 "type": {
1246 "kind": "HttpTypeLiteral",
1247 "literal": "system"
1248 }
1249 },
1250 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 2": {
1251 "kind": "HttpDeclReference",
1252 "type": {
1253 "kind": "HttpTypeLiteral",
1254 "literal": "user"
1255 }
1256 },
1257 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 3": {
1258 "kind": "HttpDeclReference",
1259 "type": {
1260 "kind": "HttpTypeLiteral",
1261 "literal": "assistant"
1262 }
1263 },
1264 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) role > (member) 4": {
1265 "kind": "HttpDeclReference",
1266 "type": {
1267 "kind": "HttpTypeLiteral",
1268 "literal": "tool"
1269 }
1270 },
1271 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) index": {
1272 "kind": "HttpDeclProperty",
1273 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/index",
1274 "deprecated": false,
1275 "key": "index",
1276 "type": {
1277 "kind": "HttpTypeNumber"
1278 },
1279 "optional": false,
1280 "nullable": false,
1281 "schemaType": "integer",
1282 "children": []
1283 },
1284 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) id": {
1285 "kind": "HttpDeclProperty",
1286 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/id",
1287 "deprecated": false,
1288 "key": "id",
1289 "docstring": "The ID of the tool call.",
1290 "type": {
1291 "kind": "HttpTypeString"
1292 },
1293 "optional": true,
1294 "nullable": false,
1295 "schemaType": "string",
1296 "children": []
1297 },
1298 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function": {
1299 "kind": "HttpDeclProperty",
1300 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/function",
1301 "deprecated": false,
1302 "key": "function",
1303 "type": {
1304 "kind": "HttpTypeObject",
1305 "members": [
1306 {
1307 "ident": "arguments"
1308 },
1309 {
1310 "ident": "name"
1311 }
1312 ]
1313 },
1314 "optional": true,
1315 "nullable": false,
1316 "schemaType": "object",
1317 "childrenParentSchema": "object",
1318 "children": [
1319 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function > (property) arguments",
1320 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function > (property) name"
1321 ]
1322 },
1323 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) type": {
1324 "kind": "HttpDeclProperty",
1325 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/type",
1326 "deprecated": false,
1327 "key": "type",
1328 "docstring": "The type of the tool. Currently, only `function` is supported.",
1329 "type": {
1330 "kind": "HttpTypeUnion",
1331 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/type",
1332 "types": [
1333 {
1334 "kind": "HttpTypeLiteral",
1335 "literal": "function"
1336 }
1337 ]
1338 },
1339 "optional": true,
1340 "nullable": false,
1341 "schemaType": "enum",
1342 "childrenParentSchema": "enum",
1343 "children": [
1344 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) type > (member) 0"
1345 ]
1346 },
1347 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) token": {
1348 "kind": "HttpDeclProperty",
1349 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/token",
1350 "deprecated": false,
1351 "key": "token",
1352 "docstring": "The token.",
1353 "type": {
1354 "kind": "HttpTypeString"
1355 },
1356 "optional": false,
1357 "nullable": false,
1358 "schemaType": "string",
1359 "children": []
1360 },
1361 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) bytes": {
1362 "kind": "HttpDeclProperty",
1363 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/bytes",
1364 "deprecated": false,
1365 "key": "bytes",
1366 "docstring": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
1367 "type": {
1368 "kind": "HttpTypeArray",
1369 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/bytes",
1370 "elementType": {
1371 "kind": "HttpTypeNumber"
1372 }
1373 },
1374 "optional": false,
1375 "nullable": true,
1376 "schemaType": "array",
1377 "children": []
1378 },
1379 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) logprob": {
1380 "kind": "HttpDeclProperty",
1381 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/logprob",
1382 "deprecated": false,
1383 "key": "logprob",
1384 "docstring": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.",
1385 "type": {
1386 "kind": "HttpTypeNumber"
1387 },
1388 "optional": false,
1389 "nullable": false,
1390 "schemaType": "number",
1391 "children": []
1392 },
1393 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs": {
1394 "kind": "HttpDeclProperty",
1395 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs",
1396 "deprecated": false,
1397 "key": "top_logprobs",
1398 "docstring": "List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.",
1399 "type": {
1400 "kind": "HttpTypeArray",
1401 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs",
1402 "elementType": {
1403 "kind": "HttpTypeObject",
1404 "members": [
1405 {
1406 "ident": "token"
1407 },
1408 {
1409 "ident": "bytes"
1410 },
1411 {
1412 "ident": "logprob"
1413 }
1414 ]
1415 }
1416 },
1417 "optional": false,
1418 "nullable": false,
1419 "schemaType": "array",
1420 "childrenParentSchema": "object",
1421 "children": [
1422 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) token",
1423 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) bytes",
1424 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) logprob"
1425 ]
1426 },
1427 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema)": {
1428 "kind": "HttpDeclTypeAlias",
1429 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob",
1430 "ident": "ChatCompletionTokenLogprob",
1431 "type": {
1432 "kind": "HttpTypeObject",
1433 "members": [
1434 {
1435 "ident": "token"
1436 },
1437 {
1438 "ident": "bytes"
1439 },
1440 {
1441 "ident": "logprob"
1442 },
1443 {
1444 "ident": "top_logprobs"
1445 }
1446 ]
1447 },
1448 "childrenParentSchema": "object",
1449 "children": [
1450 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) token",
1451 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) bytes",
1452 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) logprob",
1453 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs"
1454 ]
1455 },
1456 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) model": {
1457 "kind": "HttpDeclProperty",
1458 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/model",
1459 "deprecated": false,
1460 "key": "model",
1461 "docstring": "The moderation model used to generate the results.",
1462 "type": {
1463 "kind": "HttpTypeString"
1464 },
1465 "optional": false,
1466 "nullable": false,
1467 "schemaType": "string",
1468 "children": []
1469 },
1470 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results": {
1471 "kind": "HttpDeclProperty",
1472 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/results",
1473 "deprecated": false,
1474 "key": "results",
1475 "docstring": "A list of moderation results.",
1476 "type": {
1477 "kind": "HttpTypeArray",
1478 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/results",
1479 "elementType": {
1480 "kind": "HttpTypeObject",
1481 "members": [
1482 {
1483 "ident": "categories"
1484 },
1485 {
1486 "ident": "category_applied_input_types"
1487 },
1488 {
1489 "ident": "category_scores"
1490 },
1491 {
1492 "ident": "flagged"
1493 },
1494 {
1495 "ident": "model"
1496 },
1497 {
1498 "ident": "type"
1499 }
1500 ]
1501 }
1502 },
1503 "optional": false,
1504 "nullable": false,
1505 "schemaType": "array",
1506 "childrenParentSchema": "object",
1507 "children": [
1508 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) categories",
1509 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types",
1510 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_scores",
1511 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) flagged",
1512 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) model",
1513 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) type"
1514 ]
1515 },
1516 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) type": {
1517 "kind": "HttpDeclProperty",
1518 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/type",
1519 "deprecated": false,
1520 "key": "type",
1521 "docstring": "The object type, which is always `moderation_results`.",
1522 "type": {
1523 "kind": "HttpTypeUnion",
1524 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/type",
1525 "types": [
1526 {
1527 "kind": "HttpTypeLiteral",
1528 "literal": "moderation_results"
1529 }
1530 ]
1531 },
1532 "optional": false,
1533 "nullable": false,
1534 "schemaType": "enum",
1535 "childrenParentSchema": "enum",
1536 "children": [
1537 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) type > (member) 0"
1538 ]
1539 },
1540 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) code": {
1541 "kind": "HttpDeclProperty",
1542 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/code",
1543 "deprecated": false,
1544 "key": "code",
1545 "docstring": "The error code.",
1546 "type": {
1547 "kind": "HttpTypeString"
1548 },
1549 "optional": false,
1550 "nullable": false,
1551 "schemaType": "string",
1552 "children": []
1553 },
1554 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) message": {
1555 "kind": "HttpDeclProperty",
1556 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/message",
1557 "deprecated": false,
1558 "key": "message",
1559 "docstring": "The error message.",
1560 "type": {
1561 "kind": "HttpTypeString"
1562 },
1563 "optional": false,
1564 "nullable": false,
1565 "schemaType": "string",
1566 "children": []
1567 },
1568 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) type": {
1569 "kind": "HttpDeclProperty",
1570 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/type",
1571 "deprecated": false,
1572 "key": "type",
1573 "docstring": "The object type, which is always `error`.",
1574 "type": {
1575 "kind": "HttpTypeUnion",
1576 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/type",
1577 "types": [
1578 {
1579 "kind": "HttpTypeLiteral",
1580 "literal": "error"
1581 }
1582 ]
1583 },
1584 "optional": false,
1585 "nullable": false,
1586 "schemaType": "enum",
1587 "childrenParentSchema": "enum",
1588 "children": [
1589 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) type > (member) 0"
1590 ]
1591 },
1592 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) model": {
1593 "kind": "HttpDeclProperty",
1594 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/model",
1595 "deprecated": false,
1596 "key": "model",
1597 "docstring": "The moderation model used to generate the results.",
1598 "type": {
1599 "kind": "HttpTypeString"
1600 },
1601 "optional": false,
1602 "nullable": false,
1603 "schemaType": "string",
1604 "children": []
1605 },
1606 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results": {
1607 "kind": "HttpDeclProperty",
1608 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/results",
1609 "deprecated": false,
1610 "key": "results",
1611 "docstring": "A list of moderation results.",
1612 "type": {
1613 "kind": "HttpTypeArray",
1614 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/results",
1615 "elementType": {
1616 "kind": "HttpTypeObject",
1617 "members": [
1618 {
1619 "ident": "categories"
1620 },
1621 {
1622 "ident": "category_applied_input_types"
1623 },
1624 {
1625 "ident": "category_scores"
1626 },
1627 {
1628 "ident": "flagged"
1629 },
1630 {
1631 "ident": "model"
1632 },
1633 {
1634 "ident": "type"
1635 }
1636 ]
1637 }
1638 },
1639 "optional": false,
1640 "nullable": false,
1641 "schemaType": "array",
1642 "childrenParentSchema": "object",
1643 "children": [
1644 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) categories",
1645 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types",
1646 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_scores",
1647 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) flagged",
1648 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) model",
1649 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) type"
1650 ]
1651 },
1652 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) type": {
1653 "kind": "HttpDeclProperty",
1654 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/type",
1655 "deprecated": false,
1656 "key": "type",
1657 "docstring": "The object type, which is always `moderation_results`.",
1658 "type": {
1659 "kind": "HttpTypeUnion",
1660 "oasRef": "#/components/schemas/ChatCompletionModerationResults/properties/type",
1661 "types": [
1662 {
1663 "kind": "HttpTypeLiteral",
1664 "literal": "moderation_results"
1665 }
1666 ]
1667 },
1668 "optional": false,
1669 "nullable": false,
1670 "schemaType": "enum",
1671 "childrenParentSchema": "enum",
1672 "children": [
1673 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) type > (member) 0"
1674 ]
1675 },
1676 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) code": {
1677 "kind": "HttpDeclProperty",
1678 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/code",
1679 "deprecated": false,
1680 "key": "code",
1681 "docstring": "The error code.",
1682 "type": {
1683 "kind": "HttpTypeString"
1684 },
1685 "optional": false,
1686 "nullable": false,
1687 "schemaType": "string",
1688 "children": []
1689 },
1690 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) message": {
1691 "kind": "HttpDeclProperty",
1692 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/message",
1693 "deprecated": false,
1694 "key": "message",
1695 "docstring": "The error message.",
1696 "type": {
1697 "kind": "HttpTypeString"
1698 },
1699 "optional": false,
1700 "nullable": false,
1701 "schemaType": "string",
1702 "children": []
1703 },
1704 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) type": {
1705 "kind": "HttpDeclProperty",
1706 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/type",
1707 "deprecated": false,
1708 "key": "type",
1709 "docstring": "The object type, which is always `error`.",
1710 "type": {
1711 "kind": "HttpTypeUnion",
1712 "oasRef": "#/components/schemas/ChatCompletionModerationError/properties/type",
1713 "types": [
1714 {
1715 "kind": "HttpTypeLiteral",
1716 "literal": "error"
1717 }
1718 ]
1719 },
1720 "optional": false,
1721 "nullable": false,
1722 "schemaType": "enum",
1723 "childrenParentSchema": "enum",
1724 "children": [
1725 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) type > (member) 0"
1726 ]
1727 },
1728 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function > (property) arguments": {
1729 "kind": "HttpDeclProperty",
1730 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/function/properties/arguments",
1731 "deprecated": false,
1732 "key": "arguments",
1733 "docstring": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
1734 "type": {
1735 "kind": "HttpTypeString"
1736 },
1737 "optional": true,
1738 "nullable": false,
1739 "schemaType": "string",
1740 "children": []
1741 },
1742 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) function > (property) name": {
1743 "kind": "HttpDeclProperty",
1744 "oasRef": "#/components/schemas/ChatCompletionMessageToolCallChunk/properties/function/properties/name",
1745 "deprecated": false,
1746 "key": "name",
1747 "docstring": "The name of the function to call.",
1748 "type": {
1749 "kind": "HttpTypeString"
1750 },
1751 "optional": true,
1752 "nullable": false,
1753 "schemaType": "string",
1754 "children": []
1755 },
1756 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) choices > (items) > (property) delta > (property) tool_calls > (items) > (property) type > (member) 0": {
1757 "kind": "HttpDeclReference",
1758 "type": {
1759 "kind": "HttpTypeLiteral",
1760 "literal": "function"
1761 }
1762 },
1763 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) token": {
1764 "kind": "HttpDeclProperty",
1765 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs/items/properties/token",
1766 "deprecated": false,
1767 "key": "token",
1768 "docstring": "The token.",
1769 "type": {
1770 "kind": "HttpTypeString"
1771 },
1772 "optional": false,
1773 "nullable": false,
1774 "schemaType": "string",
1775 "children": []
1776 },
1777 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) bytes": {
1778 "kind": "HttpDeclProperty",
1779 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs/items/properties/bytes",
1780 "deprecated": false,
1781 "key": "bytes",
1782 "docstring": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
1783 "type": {
1784 "kind": "HttpTypeArray",
1785 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs/items/properties/bytes",
1786 "elementType": {
1787 "kind": "HttpTypeNumber"
1788 }
1789 },
1790 "optional": false,
1791 "nullable": true,
1792 "schemaType": "array",
1793 "children": []
1794 },
1795 "(resource) chat.completions > (model) chat_completion_token_logprob > (schema) > (property) top_logprobs > (items) > (property) logprob": {
1796 "kind": "HttpDeclProperty",
1797 "oasRef": "#/components/schemas/ChatCompletionTokenLogprob/properties/top_logprobs/items/properties/logprob",
1798 "deprecated": false,
1799 "key": "logprob",
1800 "docstring": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.",
1801 "type": {
1802 "kind": "HttpTypeNumber"
1803 },
1804 "optional": false,
1805 "nullable": false,
1806 "schemaType": "number",
1807 "children": []
1808 },
1809 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) categories": {
1810 "kind": "HttpDeclProperty",
1811 "oasRef": "#/components/schemas/ModerationResultBody/properties/categories",
1812 "deprecated": false,
1813 "key": "categories",
1814 "docstring": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
1815 "type": {
1816 "kind": "HttpTypeReference",
1817 "oasRef": "#/components/schemas/ModerationResultBody/properties/categories",
1818 "ident": "Record",
1819 "typeParameters": [
1820 {
1821 "kind": "HttpTypeString"
1822 },
1823 {
1824 "kind": "HttpTypeBoolean"
1825 }
1826 ]
1827 },
1828 "optional": false,
1829 "nullable": false,
1830 "schemaType": "map",
1831 "children": []
1832 },
1833 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types": {
1834 "kind": "HttpDeclProperty",
1835 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types",
1836 "deprecated": false,
1837 "key": "category_applied_input_types",
1838 "docstring": "Which modalities of input are reflected by the score for each category.",
1839 "type": {
1840 "kind": "HttpTypeReference",
1841 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types",
1842 "ident": "Record",
1843 "typeParameters": [
1844 {
1845 "kind": "HttpTypeString"
1846 },
1847 {
1848 "kind": "HttpTypeArray",
1849 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types/additionalProperties",
1850 "elementType": {
1851 "kind": "HttpTypeUnion",
1852 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types/additionalProperties/items",
1853 "types": [
1854 {
1855 "kind": "HttpTypeLiteral",
1856 "literal": "text"
1857 },
1858 {
1859 "kind": "HttpTypeLiteral",
1860 "literal": "image"
1861 }
1862 ]
1863 }
1864 }
1865 ]
1866 },
1867 "optional": false,
1868 "nullable": false,
1869 "schemaType": "map",
1870 "childrenParentSchema": "enum",
1871 "children": [
1872 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 0",
1873 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 1"
1874 ]
1875 },
1876 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_scores": {
1877 "kind": "HttpDeclProperty",
1878 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_scores",
1879 "deprecated": false,
1880 "key": "category_scores",
1881 "docstring": "A dictionary of moderation categories to scores.",
1882 "type": {
1883 "kind": "HttpTypeReference",
1884 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_scores",
1885 "ident": "Record",
1886 "typeParameters": [
1887 {
1888 "kind": "HttpTypeString"
1889 },
1890 {
1891 "kind": "HttpTypeNumber"
1892 }
1893 ]
1894 },
1895 "optional": false,
1896 "nullable": false,
1897 "schemaType": "map",
1898 "children": []
1899 },
1900 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) flagged": {
1901 "kind": "HttpDeclProperty",
1902 "oasRef": "#/components/schemas/ModerationResultBody/properties/flagged",
1903 "deprecated": false,
1904 "key": "flagged",
1905 "docstring": "A boolean indicating whether the content was flagged by any category.",
1906 "type": {
1907 "kind": "HttpTypeBoolean"
1908 },
1909 "optional": false,
1910 "nullable": false,
1911 "schemaType": "boolean",
1912 "children": []
1913 },
1914 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) model": {
1915 "kind": "HttpDeclProperty",
1916 "oasRef": "#/components/schemas/ModerationResultBody/properties/model",
1917 "deprecated": false,
1918 "key": "model",
1919 "docstring": "The moderation model that produced this result.",
1920 "type": {
1921 "kind": "HttpTypeString"
1922 },
1923 "optional": false,
1924 "nullable": false,
1925 "schemaType": "string",
1926 "children": []
1927 },
1928 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) type": {
1929 "kind": "HttpDeclProperty",
1930 "oasRef": "#/components/schemas/ModerationResultBody/properties/type",
1931 "deprecated": false,
1932 "key": "type",
1933 "docstring": "The object type, which was always `moderation_result` for successful moderation results.",
1934 "type": {
1935 "kind": "HttpTypeUnion",
1936 "oasRef": "#/components/schemas/ModerationResultBody/properties/type",
1937 "types": [
1938 {
1939 "kind": "HttpTypeLiteral",
1940 "literal": "moderation_result"
1941 }
1942 ]
1943 },
1944 "default": "moderation_result",
1945 "optional": false,
1946 "nullable": false,
1947 "schemaType": "enum",
1948 "childrenParentSchema": "enum",
1949 "children": [
1950 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) type > (member) 0"
1951 ]
1952 },
1953 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) type > (member) 0": {
1954 "kind": "HttpDeclReference",
1955 "type": {
1956 "kind": "HttpTypeLiteral",
1957 "literal": "moderation_results"
1958 }
1959 },
1960 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 1 > (property) type > (member) 0": {
1961 "kind": "HttpDeclReference",
1962 "type": {
1963 "kind": "HttpTypeLiteral",
1964 "literal": "error"
1965 }
1966 },
1967 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) categories": {
1968 "kind": "HttpDeclProperty",
1969 "oasRef": "#/components/schemas/ModerationResultBody/properties/categories",
1970 "deprecated": false,
1971 "key": "categories",
1972 "docstring": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
1973 "type": {
1974 "kind": "HttpTypeReference",
1975 "oasRef": "#/components/schemas/ModerationResultBody/properties/categories",
1976 "ident": "Record",
1977 "typeParameters": [
1978 {
1979 "kind": "HttpTypeString"
1980 },
1981 {
1982 "kind": "HttpTypeBoolean"
1983 }
1984 ]
1985 },
1986 "optional": false,
1987 "nullable": false,
1988 "schemaType": "map",
1989 "children": []
1990 },
1991 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types": {
1992 "kind": "HttpDeclProperty",
1993 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types",
1994 "deprecated": false,
1995 "key": "category_applied_input_types",
1996 "docstring": "Which modalities of input are reflected by the score for each category.",
1997 "type": {
1998 "kind": "HttpTypeReference",
1999 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types",
2000 "ident": "Record",
2001 "typeParameters": [
2002 {
2003 "kind": "HttpTypeString"
2004 },
2005 {
2006 "kind": "HttpTypeArray",
2007 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types/additionalProperties",
2008 "elementType": {
2009 "kind": "HttpTypeUnion",
2010 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_applied_input_types/additionalProperties/items",
2011 "types": [
2012 {
2013 "kind": "HttpTypeLiteral",
2014 "literal": "text"
2015 },
2016 {
2017 "kind": "HttpTypeLiteral",
2018 "literal": "image"
2019 }
2020 ]
2021 }
2022 }
2023 ]
2024 },
2025 "optional": false,
2026 "nullable": false,
2027 "schemaType": "map",
2028 "childrenParentSchema": "enum",
2029 "children": [
2030 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 0",
2031 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 1"
2032 ]
2033 },
2034 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_scores": {
2035 "kind": "HttpDeclProperty",
2036 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_scores",
2037 "deprecated": false,
2038 "key": "category_scores",
2039 "docstring": "A dictionary of moderation categories to scores.",
2040 "type": {
2041 "kind": "HttpTypeReference",
2042 "oasRef": "#/components/schemas/ModerationResultBody/properties/category_scores",
2043 "ident": "Record",
2044 "typeParameters": [
2045 {
2046 "kind": "HttpTypeString"
2047 },
2048 {
2049 "kind": "HttpTypeNumber"
2050 }
2051 ]
2052 },
2053 "optional": false,
2054 "nullable": false,
2055 "schemaType": "map",
2056 "children": []
2057 },
2058 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) flagged": {
2059 "kind": "HttpDeclProperty",
2060 "oasRef": "#/components/schemas/ModerationResultBody/properties/flagged",
2061 "deprecated": false,
2062 "key": "flagged",
2063 "docstring": "A boolean indicating whether the content was flagged by any category.",
2064 "type": {
2065 "kind": "HttpTypeBoolean"
2066 },
2067 "optional": false,
2068 "nullable": false,
2069 "schemaType": "boolean",
2070 "children": []
2071 },
2072 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) model": {
2073 "kind": "HttpDeclProperty",
2074 "oasRef": "#/components/schemas/ModerationResultBody/properties/model",
2075 "deprecated": false,
2076 "key": "model",
2077 "docstring": "The moderation model that produced this result.",
2078 "type": {
2079 "kind": "HttpTypeString"
2080 },
2081 "optional": false,
2082 "nullable": false,
2083 "schemaType": "string",
2084 "children": []
2085 },
2086 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) type": {
2087 "kind": "HttpDeclProperty",
2088 "oasRef": "#/components/schemas/ModerationResultBody/properties/type",
2089 "deprecated": false,
2090 "key": "type",
2091 "docstring": "The object type, which was always `moderation_result` for successful moderation results.",
2092 "type": {
2093 "kind": "HttpTypeUnion",
2094 "oasRef": "#/components/schemas/ModerationResultBody/properties/type",
2095 "types": [
2096 {
2097 "kind": "HttpTypeLiteral",
2098 "literal": "moderation_result"
2099 }
2100 ]
2101 },
2102 "default": "moderation_result",
2103 "optional": false,
2104 "nullable": false,
2105 "schemaType": "enum",
2106 "childrenParentSchema": "enum",
2107 "children": [
2108 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) type > (member) 0"
2109 ]
2110 },
2111 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) type > (member) 0": {
2112 "kind": "HttpDeclReference",
2113 "type": {
2114 "kind": "HttpTypeLiteral",
2115 "literal": "moderation_results"
2116 }
2117 },
2118 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 1 > (property) type > (member) 0": {
2119 "kind": "HttpDeclReference",
2120 "type": {
2121 "kind": "HttpTypeLiteral",
2122 "literal": "error"
2123 }
2124 },
2125 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 0": {
2126 "kind": "HttpDeclReference",
2127 "type": {
2128 "kind": "HttpTypeLiteral",
2129 "literal": "text"
2130 }
2131 },
2132 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 1": {
2133 "kind": "HttpDeclReference",
2134 "type": {
2135 "kind": "HttpTypeLiteral",
2136 "literal": "image"
2137 }
2138 },
2139 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) input > (variant) 0 > (property) results > (items) > (property) type > (member) 0": {
2140 "kind": "HttpDeclReference",
2141 "type": {
2142 "kind": "HttpTypeLiteral",
2143 "literal": "moderation_result"
2144 }
2145 },
2146 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 0": {
2147 "kind": "HttpDeclReference",
2148 "type": {
2149 "kind": "HttpTypeLiteral",
2150 "literal": "text"
2151 }
2152 },
2153 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) category_applied_input_types > (items) > (items) > (member) 1": {
2154 "kind": "HttpDeclReference",
2155 "type": {
2156 "kind": "HttpTypeLiteral",
2157 "literal": "image"
2158 }
2159 },
2160 "(resource) chat.completions > (model) chat_completion_chunk > (schema) > (property) moderation > (property) output > (variant) 0 > (property) results > (items) > (property) type > (member) 0": {
2161 "kind": "HttpDeclReference",
2162 "type": {
2163 "kind": "HttpTypeLiteral",
2164 "literal": "moderation_result"
2165 }
2166 }
2167}
2168```
2169 438
2170### Example439### Example
2171 440