Chat

Update chat completion

Modify a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be modified. Currently, the only supported modification is to update the metadata field.

post/chat/completions/{completion_id}

Path parameters

completion_idstring required

The ID of the chat completion to update.

Request body

metadataMetadata nullable required

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Response

A chat completion

idstring required

A unique identifier for the chat completion.

createdinteger required

The Unix timestamp (in seconds) of when the chat completion was created.

modelstring required

The model used for the chat completion.

metadataMetadata nullable

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

service_tier'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' nullable

Specifies the processing type used for serving the request.

  • 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'.
  • If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
  • If set to 'flex', then the request will be processed with the Flex Processing service tier.
  • To opt-in to 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.
  • When not set, the default behavior is 'auto'.

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.

system_fingerprintstring

This fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.

object'chat.completion' required

The object type, which is always chat.completion.

Changes

Changed in 9 of the 163 revisions of this API.17423

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ●

      removed the optional property / from the response with the status

      response-optional-property-removed

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ●

      added the new fast enum value to the / response property for the response status

      response-property-enum-value-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 74cbcf73838f179See the full diff
    • ▲

      the request property became not nullable

      request-property-became-not-nullable

    • ▲

      response property choices/items/message/content list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property choices/items/message/refusal list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      response property service_tier list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • ▲

      added to the //// response property oneOf list for the response status

      response-property-one-of-added

    • ▲

      the // response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      the /// response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      the //// response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      removed the required property /// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property /// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property //// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property //// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property //// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property //// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ///// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ///// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ///// from the response with the status

      response-required-property-removed

    • ○

      request property list-of-types was widened by adding types null to media type application/json

      request-property-list-of-types-widened

    • ○

      added subschema #1 subschema #2 to the // response property anyOf list for the response status

      response-property-any-of-added

    • ○

      added subschema #1 subschema #2 to the /// response property anyOf list for the response status

      response-property-any-of-added

    • ○

      the response's property default value auto was removed for the status

      response-property-default-value-removed

    • ○

      response property system_fingerprint deprecated

      response-property-deprecated

    • ○

      added discriminator to //// response property for the response status

      response-property-discriminator-added

    • ○

      removed the auto enum value from the response property for the response status

      response-property-enum-value-removed

    • ○

      removed the default enum value from the response property for the response status

      response-property-enum-value-removed

    • ○

      removed the flex enum value from the response property for the response status

      response-property-enum-value-removed

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 6a6c681b182022See the full diff
    • ●

      added the new auto enum value to the response property for the response status

      response-property-enum-value-added

    • ●

      added the new flex enum value to the response property for the response status

      response-property-enum-value-added

    • ○

      the response's property default value auto was added for the status

      response-property-default-value-added

    • ○

      removed the scale enum value from the response property for the response status

      response-property-enum-value-removed

    This revision also has 18 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      endpoint added

      endpoint-added