Assistants
- GETList assistants
- POSTCreate assistant
- GETRetrieve assistant
- POSTModify assistant
- DELDelete assistant
- POSTCreate thread
- POSTCreate thread and run
- GETRetrieve thread.
- POSTModify thread
- DELDelete thread
- GETList messages
- POSTCreate message
- GETRetrieve message
- POSTModify message
- DELDelete message
- GETList runs
- POSTCreate run
- GETRetrieve run
- POSTModify run
- POSTCancel run
- GETList run steps
- GETRetrieve run step
- POSTThe run step object
Chat
Completions
Embeddings
Evals
Files
Fine-tuning
- GETList checkpoint permissions
- POSTCreate checkpoint permissions
- DELDelete checkpoint permission
- GETList your organization's fine-tuning jobs
- POSTCreate a fine-tuning job
- GETRetrieve fine-tuning job
- POSTImmediately cancel a fine-tune job.
- GETList checkpoints for a fine-tuning job.
- GETGet status updates for a fine-tuning job.
Moderations
API Reference
Audit Logs
Certificates
Usage
Projects
- GETReturns a list of projects.
- POSTCreate project
- GETRetrieves a project.
- POSTModify project
- GETList project API keys
- GETRetrieve project API key
- DELDelete project API key
- POSTArchive project
- GETList project rate limits
- POSTUpdate project rate limit
- GETList project service accounts
- POSTCreate project service account
- GETRetrieve project service account
- DELDelete project service account
- GETReturn project users
- POSTCreate project user
- GETRetrieve project user
- POSTModify project user
- DELDelete project user
Responses
Vector stores
- GETReturns a list of vector stores.
- POSTCreate a vector store.
- GETRetrieves a vector store.
- POSTModifies a vector store.
- DELDelete a vector store.
- POSTCreate a vector store file batch.
- GETRetrieves a vector store file batch.
- POSTCancel vector store file batch
- GETReturns a list of vector store files in a batch.
- GETReturns a list of vector store files.
- POSTCreate vector store file
- GETRetrieves a vector store file.
- POSTUpdate attributes on a vector store file.
- DELDelete vector store file
- GETRetrieve vector store
- POSTSearch vector store
Chat
List Chat Completions
List stored Chat Completions. Only Chat Completions that have been stored
with the store
parameter set to true
will be returned.
GET
/
chat
/
completions
Copy
Ask AI
curl --request GET \
--url https://api.openai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>'
Copy
Ask AI
{
"object": "list",
"data": [
{
"id": "<string>",
"choices": [
{
"finish_reason": "stop",
"index": 123,
"message": {
"content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"annotations": [
{
"type": "url_citation",
"url_citation": {
"end_index": 123,
"start_index": 123,
"url": "<string>",
"title": "<string>"
}
}
],
"role": "assistant",
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"audio": {
"id": "<string>",
"expires_at": 123,
"data": "<string>",
"transcript": "<string>"
}
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
}
],
"created": 123,
"model": "<string>",
"service_tier": "auto",
"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
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
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.
Sort order for Chat Completions by timestamp. Use asc
for ascending order or desc
for descending order. Defaults to asc
.
Available options:
asc
, desc
Response
200 - application/json
A list of Chat Completions
An object representing a list of Chat Completions.
Was this page helpful?
Copy
Ask AI
curl --request GET \
--url https://api.openai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>'
Copy
Ask AI
{
"object": "list",
"data": [
{
"id": "<string>",
"choices": [
{
"finish_reason": "stop",
"index": 123,
"message": {
"content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"annotations": [
{
"type": "url_citation",
"url_citation": {
"end_index": 123,
"start_index": 123,
"url": "<string>",
"title": "<string>"
}
}
],
"role": "assistant",
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"audio": {
"id": "<string>",
"expires_at": 123,
"data": "<string>",
"transcript": "<string>"
}
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
]
}
]
}
}
],
"created": 123,
"model": "<string>",
"service_tier": "auto",
"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
}
Assistant
Responses are generated using AI and may contain mistakes.