GPTs
Brief: This endpoint can call OpenAI's official GPTs (custom GPTs). Embed a GPT's ID into the model name, for example
gpt-4-gizmo-g-bo0FiWLY7, to invoke that GPT.
Overview
- Method:
POST - Path:
/v1/chat/completions - Content-Type:
application/json
Use Cases
- If you have a public GPT (example page: https://chat.openai.com/g/g-bo0FiWLY7-researchgpt), include its ID as part of the model name to call it.
- Platform example: model name format
gpt-4-gizmo-<gizmo_id>(e.g.gpt-4-gizmo-g-bo0FiWLY7). Some plugins/tools automatically extract the GPT ID from the GPT URL and construct the model name.
Authentication
- Use header:
Authorization: Bearer sk-xxx.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model name or GPTs model name, e.g. gpt-4-gizmo-g-bo0FiWLY7 |
| messages | array | yes | Chat messages array, see chat API spec |
| temperature | number | no | Sampling temperature, 0-2 |
| top_p | number | no | Nucleus sampling parameter |
| max_tokens | number | no | Maximum tokens to generate |
| stream | boolean | no | Use streaming responses |
| n | integer | no | Number of candidate responses to return |
| presence_penalty | number | no | Presence penalty |
| frequency_penalty | number | no | Frequency penalty |
| logit_bias | object | no | Logit bias mapping |
| user | string | no | Identifier for end-user, used for abuse monitoring |
Examples
curl example
bash
curl -X POST "https://api.gpt.ge/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxx" \
-d '{
"model": "gpt-4-gizmo-g-bo0FiWLY7",
"messages": [{ "role": "user", "content": "What is the potential of quantum computing for solving complex computational problems?" }],
"max_tokens": 1688,
"temperature": 0.5,
"stream": false
}'Response example (200, summary)
json
{
"id": "chatcmpl-89DbGj4xWTyI7ddcPHTqDolMi0MGn",
"object": "chat.completion",
"created": 1724999207,
"model": "gpt-4-gizmo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing has shown significant potential for solving complex computational problems... (long text omitted)"
},
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 30, "completion_tokens": 835, "total_tokens": 865 }
}