NAME

OpenAPI::Client::OpenAI::Path::chat-completions-completion_id - Documentation for the /chat/completions/{completion_id} path.

DESCRIPTION

This document describes the API endpoint at /chat/completions/{completion_id}.

See the examples/ directory in the distribution for examples of how to use this.

DELETE /chat/completions/{completion_id}

Delete a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` can be deleted.

Operation ID

deleteChatCompletion

$client->deleteChatCompletion( ... );

Parameters

  • completion_id (in path) (Required) - The ID of the chat completion to delete. Type: string

Responses

Status Code: 200

The chat completion was deleted successfully.

Content Types:

  • application/json

GET /chat/completions/{completion_id}

Get a stored chat completion. Only Chat Completions that have been created with the `store` parameter set to `true` will be returned.

Operation ID

getChatCompletion

$client->getChatCompletion( ... );

Parameters

  • completion_id (in path) (Required) - The ID of the chat completion to retrieve. Type: string

Responses

Status Code: 200

A chat completion

Content Types:

  • application/json

    Example:

    {
       "usage" : {
          "completion_tokens_details" : null,
          "prompt_tokens_details" : null
       },
       "choices" : [
          {
             "logprobs" : {
                "refusal" : [
                   {
                      "top_logprobs" : [
                         {
                            "bytes" : [
                               null
                            ]
                         }
                      ],
                      "bytes" : [
                         null
                      ]
                   }
                ],
                "content" : [
                   {
                      "top_logprobs" : [
                         {
                            "bytes" : [
                               null
                            ]
                         }
                      ],
                      "bytes" : [
                         null
                      ]
                   }
                ]
             },
             "message" : {
                "function_call" : null,
                "tool_calls" : [
                   {
                      "function" : null
                   }
                ],
                "audio" : null,
                "annotations" : [
                   {
                      "url_citation" : null
                   }
                ]
             }
          }
       ],
       "service_tier" : "scale"
    }

POST /chat/completions/{completion_id}

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.

Operation ID

updateChatCompletion

$client->updateChatCompletion( ... );

Parameters

  • completion_id (in path) (Required) - The ID of the chat completion to update. Type: string

Request Body

Content Type: application/json

Responses

Status Code: 200

A chat completion

Content Types:

  • application/json

    Example:

    {
       "choices" : [
          {
             "message" : {
                "function_call" : null,
                "tool_calls" : [
                   {
                      "function" : null
                   }
                ],
                "audio" : null,
                "annotations" : [
                   {
                      "url_citation" : null
                   }
                ]
             },
             "logprobs" : {
                "refusal" : [
                   {
                      "top_logprobs" : [
                         {
                            "bytes" : [
                               null
                            ]
                         }
                      ],
                      "bytes" : [
                         null
                      ]
                   }
                ],
                "content" : [
                   {
                      "top_logprobs" : [
                         {
                            "bytes" : [
                               null
                            ]
                         }
                      ],
                      "bytes" : [
                         null
                      ]
                   }
                ]
             }
          }
       ],
       "usage" : {
          "prompt_tokens_details" : null,
          "completion_tokens_details" : null
       },
       "service_tier" : "scale"
    }

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2025 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.