Swagger Petstore - OpenAPI 3.0
GET/chat/completions

List stored chat completions

Lists stored chat completions that were created with the store parameter set to true. Returns paginated results with optional filtering by model and metadata. Results are sorted by creation timestamp in the order specified.

5 parameters
modelstringoptional
Filter results to chat completions generated by this specific model.
metadataobjectoptional
Filter by metadata key-value pairs. Pass as `metadata[key1]=value1&metadata[key2]=value2`.
afterstringoptional
Pagination cursor. Pass the ID of the last chat completion from the previous response to fetch the next page.
limitintegeroptional
Number of chat completions to retrieve per page. Defaults to 20 when omitted.
Default:20
orderstringoptional
Sort order by creation timestamp: `asc` for ascending or `desc` for descending. Defaults to `asc` when omitted.
Allowed:ascdescDefault:asc

1 status code
200Returns a paginated list of chat completion objects with metadata, along with pagination cursors and a flag indicating whether more results exist.
objectstringrequired
The type of this object. It is always set to "list".
Allowed:listDefault:list
dataarray<object>required
An array of chat completion objects.
first_idstringrequired
The identifier of the first chat completion in the data array.
last_idstringrequired
The identifier of the last chat completion in the data array.
has_morebooleanrequired
Indicates whether there are more Chat Completions available.

Error handling

limit must be a positive integer — zero or negative values are rejected. order must be asc or desc if provided. after must be a valid chat completion ID from a previous response if provided.