List stored Chat Completions. Only Chat Completions that have been stored with the `store` parameter set to `true` will be returned.
Query parameters
-
The model used to generate the Chat Completions.
-
A list of metadata keys to filter the Chat Completions by. Example:
metadata[key1]=value1&metadata[key2]=value2
-
Identifier for the last chat completion from the previous pagination request.
-
Number of Chat Completions to retrieve.
Default value is
20
. -
Sort order for Chat Completions by timestamp. Use
asc
for ascending order ordesc
for descending order. Defaults toasc
.Values are
asc
ordesc
. Default value isasc
.
GET
/chat/completions
curl \
--request GET 'https://api.openai.com/v1/chat/completions' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"object": "list",
"data": [
{
"id": "string",
"choices": [
{
"finish_reason": "stop",
"index": 42,
"message": {
"content": "string",
"refusal": "string",
"tool_calls": [
{
"id": "string",
"type": "function",
"function": {
"name": "string",
"arguments": "string"
}
}
],
"annotations": [
{
"type": "url_citation",
"url_citation": {
"end_index": 42,
"start_index": 42,
"url": "string",
"title": "string"
}
}
],
"role": "assistant",
"function_call": {
"arguments": "string",
"name": "string"
},
"audio": {
"id": "string",
"expires_at": 42,
"data": "string",
"transcript": "string"
}
},
"logprobs": {
"content": [
{
"token": "string",
"logprob": 42.0,
"bytes": [
42
],
"top_logprobs": [
{
"token": "string",
"logprob": 42.0,
"bytes": [
42
]
}
]
}
],
"refusal": [
{
"token": "string",
"logprob": 42.0,
"bytes": [
42
],
"top_logprobs": [
{
"token": "string",
"logprob": 42.0,
"bytes": [
42
]
}
]
}
]
}
}
],
"created": 42,
"model": "string",
"service_tier": "scale",
"system_fingerprint": "string",
"object": "chat.completion",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
}
}
],
"first_id": "string",
"last_id": "string",
"has_more": true
}