Skip to content

Commit 8da0213

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-551: docs: add "chat completions vs responses" hint
1 parent d2ee08c commit 8da0213

25 files changed

Lines changed: 432 additions & 121 deletions

docs/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@
423423
* [Completion and Chat Completion](capabilities/completion-or-chat-models.md)
424424
* [Streaming Mode](capabilities/streaming-mode.md)
425425
* [Code Generation](capabilities/code-generation.md)
426-
* [Thinking / Reasoning](capabilities/thinking-reasoning.md)
427426
* [Function Calling](capabilities/function-calling.md)
427+
* [Thinking / Reasoning](capabilities/thinking-reasoning.md)
428428
* [Vision in Text Models (Image-To-Text)](capabilities/image-to-text-vision.md)
429429
* [Web Search](capabilities/web-search.md)
430430
* [Batch Processing](capabilities/batch-processing.md)

docs/api-references/text-models-llm/OpenAI/gpt-3.5-turbo.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ You can also view [a detailed comparison of this model](https://aimlapi.com/comp
1414

1515
<summary>Step-by-Step Instructions</summary>
1616

17-
#### :digit\_one: Setup You Can’t Skip
17+
:digit\_one: **Setup You Can’t Skip**
1818

1919
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
2020
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
2121

22-
#### :digit\_two: Copy the code example
22+
:digit\_two: **Copy the code example**
2323

2424
At the bottom of this page, you'll find [a code example](gpt-3.5-turbo.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
2525

26-
#### :digit\_three: Modify the code example
26+
:digit\_three: **Modify the code example**
2727

2828
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
2929
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
3030

31-
#### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed
31+
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
3232

33-
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-3.5-turbo.md#api-schema), which lists all available parameters along with notes on how to use them.
33+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-3.5-turbo.md#api-schemas), which lists all available parameters along with notes on how to use them.
3434

35-
#### :digit\_five: Run your modified code
35+
:digit\_five: **Run your modified code**
3636

3737
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
3838

@@ -42,15 +42,29 @@ If you need a more detailed walkthrough for setting up your development environm
4242

4343
</details>
4444

45-
## API Schema
45+
## API Schemas
46+
47+
<details>
48+
49+
<summary>Chat Completions vs. Responses API</summary>
50+
51+
**Chat Completions**\
52+
The _chat completions_ API is the older, chat-oriented interface where you send a list of messages (`role: user`, `role: assistant`, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.
53+
54+
**Responses**\
55+
The _Responses_ API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.
56+
57+
</details>
58+
59+
### Chat Completions Endpoint
4660

4761
{% openapi-operation spec="gpt-3-5-turbo" path="/v1/chat/completions" method="post" %}
4862
[OpenAPI gpt-3-5-turbo](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-3.5-turbo.json)
4963
{% endopenapi-operation %}
5064

5165
### Responses Endpoint
5266

53-
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them. OpenAI has announced plans to expand the capabilities of the `/responses` endpoint in the future.
67+
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them.
5468

5569
{% openapi-operation spec="responses-all-models" path="/v1/responses" method="post" %}
5670
[OpenAPI responses-all-models](https://api.aimlapi.com/docs-public-yaml)

docs/api-references/text-models-llm/OpenAI/gpt-4-preview.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ At the bottom of this page, you'll find [a code example](gpt-4-preview.md#code-e
2828

2929
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
3030

31-
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4-preview.md#api-schema), which lists all available parameters along with notes on how to use them.
31+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4-preview.md#api-schemas), which lists all available parameters along with notes on how to use them.
3232

3333
:digit\_five: **Run your modified code**
3434

@@ -40,17 +40,29 @@ If you need a more detailed walkthrough for setting up your development environm
4040

4141
</details>
4242

43-
## API Schema
43+
## API Schemas
4444

45-
### Chat Completion
45+
<details>
46+
47+
<summary>Chat Completions vs. Responses API</summary>
48+
49+
**Chat Completions**\
50+
The _chat completions_ API is the older, chat-oriented interface where you send a list of messages (`role: user`, `role: assistant`, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.
51+
52+
**Responses**\
53+
The _Responses_ API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.
54+
55+
</details>
56+
57+
### Chat Completions Endpoint
4658

4759
{% openapi-operation spec="gpt-4-preview" path="/v1/chat/completions" method="post" %}
4860
[OpenAPI gpt-4-preview](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4-preview.json)
4961
{% endopenapi-operation %}
5062

5163
### Responses Endpoint
5264

53-
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them. OpenAI has announced plans to expand the capabilities of the `/responses` endpoint in the future.
65+
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them.
5466

5567
{% openapi-operation spec="gpt-4-preview-RESPONSES" path="/v1/responses" method="post" %}
5668
[OpenAPI gpt-4-preview-RESPONSES](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4-preview-RESPONSES.json)

docs/api-references/text-models-llm/OpenAI/gpt-4-turbo.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ The model enhances the already impressive capabilities of [gpt-4](gpt-4.md) by s
1212

1313
<summary>Step-by-Step Instructions</summary>
1414

15-
#### :digit\_one: Setup You Can’t Skip
15+
:digit\_one: **Setup You Can’t Skip**
1616

1717
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
1818
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
1919

20-
#### :digit\_two: Copy the code example
20+
:digit\_two: **Copy the code example**
2121

2222
At the bottom of this page, you'll find [a code example](gpt-4-turbo.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
2323

24-
#### :digit\_three: Modify the code example
24+
:digit\_three: **Modify the code example**
2525

2626
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
2727
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
2828

29-
#### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed
29+
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
3030

31-
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4-turbo.md#api-schema), which lists all available parameters along with notes on how to use them.
31+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4-turbo.md#api-schemas), which lists all available parameters along with notes on how to use them.
3232

33-
#### :digit\_five: Run your modified code
33+
:digit\_five: **Run your modified code**
3434

3535
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
3636

@@ -40,15 +40,29 @@ If you need a more detailed walkthrough for setting up your development environm
4040

4141
</details>
4242

43-
## API Schema
43+
## API Schemas
44+
45+
<details>
46+
47+
<summary>Chat Completions vs. Responses API</summary>
48+
49+
**Chat Completions**\
50+
The _chat completions_ API is the older, chat-oriented interface where you send a list of messages (`role: user`, `role: assistant`, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.
51+
52+
**Responses**\
53+
The _Responses_ API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.
54+
55+
</details>
56+
57+
### Chat Completions Endpoint
4458

4559
{% openapi-operation spec="gpt-4-turbo" path="/v1/chat/completions" method="post" %}
4660
[OpenAPI gpt-4-turbo](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4-turbo.json)
4761
{% endopenapi-operation %}
4862

4963
### Responses Endpoint
5064

51-
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them. OpenAI has announced plans to expand the capabilities of the `/responses` endpoint in the future.
65+
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them.
5266

5367
{% openapi-operation spec="responses-all-models" path="/v1/responses" method="post" %}
5468
[OpenAPI responses-all-models](https://api.aimlapi.com/docs-public-yaml)

docs/api-references/text-models-llm/OpenAI/gpt-4.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ At the bottom of this page, you'll find [a code example](gpt-4.md#code-example)
2828

2929
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
3030

31-
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4.md#api-schema), which lists all available parameters along with notes on how to use them.
31+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4.md#api-schemas), which lists all available parameters along with notes on how to use them.
3232

3333
:digit\_five: **Run your modified code**
3434

@@ -40,17 +40,29 @@ If you need a more detailed walkthrough for setting up your development environm
4040

4141
</details>
4242

43-
## API Schema
43+
## API Schemas
4444

45-
### Chat Completion
45+
<details>
46+
47+
<summary>Chat Completions vs. Responses API</summary>
48+
49+
**Chat Completions**\
50+
The _chat completions_ API is the older, chat-oriented interface where you send a list of messages (`role: user`, `role: assistant`, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.
51+
52+
**Responses**\
53+
The _Responses_ API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.
54+
55+
</details>
56+
57+
### Chat Completions Endpoint
4658

4759
{% openapi-operation spec="gpt-4" path="/v1/chat/completions" method="post" %}
4860
[OpenAPI gpt-4](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4.json)
4961
{% endopenapi-operation %}
5062

5163
### Responses Endpoint
5264

53-
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them. OpenAI has announced plans to expand the capabilities of the `/responses` endpoint in the future.
65+
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them.
5466

5567
{% openapi-operation spec="gpt-4-RESPONSES" path="/v1/responses" method="post" %}
5668
[OpenAPI gpt-4-RESPONSES](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4-RESPONSES.json)

docs/api-references/text-models-llm/OpenAI/gpt-4o-mini.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ OpenAI's latest cost-efficient model designed to deliver advanced natural langua
1212

1313
<summary>Step-by-Step Instructions</summary>
1414

15-
#### :digit\_one: Setup You Can’t Skip
15+
:digit\_one: **Setup You Can’t Skip**
1616

1717
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
1818
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
1919

20-
#### :digit\_two: Copy the code example
20+
:digit\_two: **Copy the code example**
2121

2222
At the bottom of this page, you'll find [a code example](gpt-4o-mini.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
2323

24-
#### :digit\_three: Modify the code example
24+
:digit\_three: **Modify the code example**
2525

2626
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
2727
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
2828

29-
#### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed
29+
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
3030

31-
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4o-mini.md#api-schema), which lists all available parameters along with notes on how to use them.
31+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](gpt-4o-mini.md#api-schemas), which lists all available parameters along with notes on how to use them.
3232

33-
#### :digit\_five: Run your modified code
33+
:digit\_five: **Run your modified code**
3434

3535
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
3636

@@ -40,15 +40,29 @@ If you need a more detailed walkthrough for setting up your development environm
4040

4141
</details>
4242

43-
## API Schema
43+
## API Schemas
44+
45+
<details>
46+
47+
<summary>Chat Completions vs. Responses API</summary>
48+
49+
**Chat Completions**\
50+
The _chat completions_ API is the older, chat-oriented interface where you send a list of messages (`role: user`, `role: assistant`, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.
51+
52+
**Responses**\
53+
The _Responses_ API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.
54+
55+
</details>
56+
57+
### Chat Completions Endpoint
4458

4559
{% openapi-operation spec="gpt-4o-mini" path="/v1/chat/completions" method="post" %}
4660
[OpenAPI gpt-4o-mini](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-4o-mini.json)
4761
{% endopenapi-operation %}
4862

4963
### Responses Endpoint
5064

51-
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them. OpenAI has announced plans to expand the capabilities of the `/responses` endpoint in the future.
65+
This endpoint is currently used _only_ with OpenAI models. Some models support both the `/chat/completions` and `/responses` endpoints, while others support only one of them.
5266

5367
{% openapi-operation spec="responses-all-models" path="/v1/responses" method="post" %}
5468
[OpenAPI responses-all-models](https://api.aimlapi.com/docs-public-yaml)

0 commit comments

Comments
 (0)