11 11
12### Returns12### Returns
13 13
1414- `ChatCompletion object { id, choices, created, 5 more }`- `ChatCompletion object { id, choices, created, 6 more }`
15 15
16 Represents a chat completion response returned by model, based on the provided input.16 Represents a chat completion response returned by model, based on the provided input.
17 17
29 `length` if the maximum number of tokens specified in the request was reached,29 `length` if the maximum number of tokens specified in the request was reached,
30 `content_filter` if content was omitted due to a flag from our content filters,30 `content_filter` if content was omitted due to a flag from our content filters,
31 `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.31 `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
32 Read the [Model Spec](https://model-spec.openai.com/2025-12-18.html) for more.
32 33
33 - `"stop"`34 - `"stop"`
34 35
255 256
256 - `"chat.completion"`257 - `"chat.completion"`
257 258
259 - `moderation: optional object { input, output }`
260
261 Moderation results for the request input and generated output, if moderated
262 completions were requested.
263
264 - `input: object { model, results, type } or object { code, message, type }`
265
266 Moderation for the request input.
267
268 - `ModerationResults object { model, results, type }`
269
270 Successful moderation results for the request input or generated output.
271
272 - `model: string`
273
274 The moderation model used to generate the results.
275
276 - `results: array of object { categories, category_applied_input_types, category_scores, 3 more }`
277
278 A list of moderation results.
279
280 - `categories: map[boolean]`
281
282 A dictionary of moderation categories to booleans, True if the input is flagged under this category.
283
284 - `category_applied_input_types: map[array of "text" or "image"]`
285
286 Which modalities of input are reflected by the score for each category.
287
288 - `"text"`
289
290 - `"image"`
291
292 - `category_scores: map[number]`
293
294 A dictionary of moderation categories to scores.
295
296 - `flagged: boolean`
297
298 A boolean indicating whether the content was flagged by any category.
299
300 - `model: string`
301
302 The moderation model that produced this result.
303
304 - `type: "moderation_result"`
305
306 The object type, which was always `moderation_result` for successful moderation results.
307
308 - `"moderation_result"`
309
310 - `type: "moderation_results"`
311
312 The object type, which is always `moderation_results`.
313
314 - `"moderation_results"`
315
316 - `Error object { code, message, type }`
317
318 An error produced while attempting moderation.
319
320 - `code: string`
321
322 The error code.
323
324 - `message: string`
325
326 The error message.
327
328 - `type: "error"`
329
330 The object type, which is always `error`.
331
332 - `"error"`
333
334 - `output: object { model, results, type } or object { code, message, type }`
335
336 Moderation for the generated output.
337
338 - `ModerationResults object { model, results, type }`
339
340 Successful moderation results for the request input or generated output.
341
342 - `model: string`
343
344 The moderation model used to generate the results.
345
346 - `results: array of object { categories, category_applied_input_types, category_scores, 3 more }`
347
348 A list of moderation results.
349
350 - `categories: map[boolean]`
351
352 A dictionary of moderation categories to booleans, True if the input is flagged under this category.
353
354 - `category_applied_input_types: map[array of "text" or "image"]`
355
356 Which modalities of input are reflected by the score for each category.
357
358 - `"text"`
359
360 - `"image"`
361
362 - `category_scores: map[number]`
363
364 A dictionary of moderation categories to scores.
365
366 - `flagged: boolean`
367
368 A boolean indicating whether the content was flagged by any category.
369
370 - `model: string`
371
372 The moderation model that produced this result.
373
374 - `type: "moderation_result"`
375
376 The object type, which was always `moderation_result` for successful moderation results.
377
378 - `"moderation_result"`
379
380 - `type: "moderation_results"`
381
382 The object type, which is always `moderation_results`.
383
384 - `"moderation_results"`
385
386 - `Error object { code, message, type }`
387
388 An error produced while attempting moderation.
389
390 - `code: string`
391
392 The error code.
393
394 - `message: string`
395
396 The error message.
397
398 - `type: "error"`
399
400 The object type, which is always `error`.
401
402 - `"error"`
403
258 - `service_tier: optional "auto" or "default" or "flex" or 2 more`404 - `service_tier: optional "auto" or "default" or "flex" or 2 more`
259 405
260 Specifies the processing type used for serving the request.406 Specifies the processing type used for serving the request.
430 "created": 0,576 "created": 0,
431 "model": "model",577 "model": "model",
432 "object": "chat.completion",578 "object": "chat.completion",
579 "moderation": {
580 "input": {
581 "model": "model",
582 "results": [
583 {
584 "categories": {
585 "foo": true
586 },
587 "category_applied_input_types": {
588 "foo": [
589 "text"
590 ]
591 },
592 "category_scores": {
593 "foo": 0
594 },
595 "flagged": true,
596 "model": "model",
597 "type": "moderation_result"
598 }
599 ],
600 "type": "moderation_results"
601 },
602 "output": {
603 "model": "model",
604 "results": [
605 {
606 "categories": {
607 "foo": true
608 },
609 "category_applied_input_types": {
610 "foo": [
611 "text"
612 ]
613 },
614 "category_scores": {
615 "foo": 0
616 },
617 "flagged": true,
618 "model": "model",
619 "type": "moderation_result"
620 }
621 ],
622 "type": "moderation_results"
623 }
624 },
433 "service_tier": "auto",625 "service_tier": "auto",
434 "system_fingerprint": "system_fingerprint",626 "system_fingerprint": "system_fingerprint",
435 "usage": {627 "usage": {