Skip to content

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

ParameterTypeRequiredDescription
modelstringyesModel name or GPTs model name, e.g. gpt-4-gizmo-g-bo0FiWLY7
messagesarrayyesChat messages array, see chat API spec
temperaturenumbernoSampling temperature, 0-2
top_pnumbernoNucleus sampling parameter
max_tokensnumbernoMaximum tokens to generate
streambooleannoUse streaming responses
nintegernoNumber of candidate responses to return
presence_penaltynumbernoPresence penalty
frequency_penaltynumbernoFrequency penalty
logit_biasobjectnoLogit bias mapping
userstringnoIdentifier 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 }
}