Skip to content

Commit 0018d1c

Browse files
committed
Update qiskit-code-assistant-openai-api.mdx
Signed-off-by: va <va@us.ibm.com>
1 parent c24dd80 commit 0018d1c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/guides/qiskit-code-assistant-openai-api.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,34 @@ description: Learn how to integrate Qiskit Code Assistant with other application
1212

1313
# Qiskit Code Assistant - OpenAI API compatibility
1414

15-
Qiskit Code Assistant offers compatibility with a subset of the OpenAI API specification, specifically with the [completions API endpoints](https://platform.openai.com/docs/api-reference/completions). The goal of this compatibility is to allow third-party packages to connect to Qiskit Code Assistant seamlessly by using well-known AI-related libraries and methods such as [OpenAI](https://github.com/openai/openai-python), [LiteLLM](https://github.com/BerriAI/litellm), or others.
15+
Qiskit Code Assistant offers compatibility with a subset of the OpenAI API specification. The goal of this compatibility is to allow third-party packages to connect to Qiskit Code Assistant seamlessly by using well-known AI-related libraries and methods such as [OpenAI](https://github.com/openai/openai-python), [LiteLLM](https://github.com/BerriAI/litellm), or others.
1616

1717
## OpenAI API endpoints supported
1818

1919
| Method | Path | Comment |
2020
|--|--|---|
2121
| **GET** | `/v1/models` | List all models |
22-
| **GET** | `/v1/model/{model}` | Get model detail |
22+
| **GET** | `/v1/models/{model}` | Get model detail |
2323
| **POST** | `/v1/completions` | Send prompt to model for completion |
24+
| **POST** | `/v1/chat/completions` | Send messages to model for completion |
2425

2526
<Admonition type="note">
26-
The `/v1/completions` endpoint fails with a `403` error if the model disclaimer has been accepted. See the following for how to view and accept the model disclaimer.
27+
The `/v1/completions` and `/v1/chat/completions` endpoints fails with a `403` error if the model disclaimer has been accepted. See the following for how to view and accept the model disclaimer.
2728
</Admonition>
2829

2930
Additional endpoints (not part of OpenAI schema, provided for convenience) include:
3031

3132
| Method | Path | Comment |
3233
|--|--|---|
33-
| **GET** | `/v1/model/{model}/disclaimer` | Get model's disclaimer |
34-
| **POST** | `/v1/model/{model}/disclaimer` | Accept model's disclaimer |
34+
| **GET** | `/v1/models/{model}/disclaimer` | Get model's disclaimer |
35+
| **POST** | `/v1/models/{model}/disclaimer` | Accept model's disclaimer |
3536
| **POST** | `/v1/completions/accept` | Accept or reject completion |
3637

3738
To retrieve/view the model disclaimer, make a **GET** request to the disclaimer endpoint. For example:
3839

3940
```
4041
curl -X 'GET' \
41-
'https://qiskit-code-assistant.quantum.ibm.com/v1/model/mistral-small-3.2-24b-qiskit/disclaimer' \
42+
'https://qiskit-code-assistant.quantum.ibm.com/v1/models/mistral-small-3.2-24b-qiskit/disclaimer' \
4243
-H 'accept: application/json' \
4344
-H 'Authorization: Bearer <IBM Quantum Classic API key>'
4445
```
@@ -47,7 +48,7 @@ If you agree with the model disclaimer, to accept it, **POST** to the disclaimer
4748

4849
```
4950
curl -X 'POST' \
50-
'https://qiskit-code-assistant.quantum.ibm.com/v1/model/mistral-small-3.2-24b-qiskit/disclaimer' \
51+
'https://qiskit-code-assistant.quantum.ibm.com/v1/models/mistral-small-3.2-24b-qiskit/disclaimer' \
5152
-H 'accept: application/json' \
5253
-H 'Authorization: Bearer <IBM Quantum Classic API key>' \
5354
-H 'Content-Type: application/json' \

0 commit comments

Comments
 (0)