> For the complete documentation index, see [llms.txt](https://docs.planetcrust.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.planetcrust.com/human-connections/chatgpt/chatgpt.md).

# ChatGPT

<p align="center"><a class="button primary" data-icon="circle-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscription</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>

<figure><img src="/files/WGWIgassTpoesmt8hzZy" alt="" width="188"><figcaption></figcaption></figure>

<h3 align="center">Put ChatGPT to Work with @Human Automations and @Human Agents</h3>

<p align="center">The ChatGPT Connection documents all Triggers, Actions and Query Operations available for creating automations via the ChatGPT API.</p>

{% embed url="<https://www.youtube.com/watch?v=CyuUuaBSZzA>" %}

#### What can you do with the ChatGPT Connection?

* Connect to the ChatGPT API in a few clicks
* Use the related ChatGPT Operations (see below) in @Human Automations or @Human Agents

### Related Operations

#### Trigger Operations

**Chat Completion Created**

Triggers on: chat\_completions/chat.completion.created

Triggered when a new chat completion is created.

**Response Completed**

Triggers on: responses/response.completed

Triggered when a response is successfully completed.

**Response Failed**

Triggers on: responses/response.failed

Triggered when a response execution fails.

**Embedding Created**

Triggers on: embeddings/embedding.created

Triggered when a new text embedding is generated.

**Image Generated**

Triggers on: images/image.generated

Triggered when a new image is successfully generated.

**Image Failed**

Triggers on: images/image.failed

Triggered when image generation fails.

**Audio Transcription Completed**

Triggers on: audio\_transcriptions/audio.transcription.completed

Triggered when an audio file transcription is finished.

**Audio Speech Generated**

Triggers on: audio\_speech/audio.speech.generated

Triggered when text-to-speech audio is generated.

**Model Created**

Triggers on: models/model.created

Triggered when a new model becomes available.

**Model Deleted**

Triggers on: models/model.deleted

Triggered when a fine-tuned model is deleted.

**Moderation Completed**

Triggers on: moderations/moderation.completed

Triggered when a content moderation check is finished.

**File Created**

Triggers on: files/file.created

Triggered when a new file is uploaded or created.

**File Deleted**

Triggers on: files/file.deleted

Triggered when a file is permanently removed.

**Fine-Tuning Job Created**

Triggers on: fine\_tuning\_jobs/fine\_tuning.job.created

Triggered when a new fine-tuning job is initiated.

**Fine-Tuning Job Succeeded**

Triggers on: fine\_tuning\_jobs/fine\_tuning.job.succeeded

Triggered when a fine-tuning job completes successfully.

**Fine-Tuning Job Failed**

Triggers on: fine\_tuning\_jobs/fine\_tuning.job.failed

Triggered when a fine-tuning job fails to complete.

**Fine-Tuning Job Cancelled**

Triggers on: fine\_tuning\_jobs/fine\_tuning.job.cancelled

Triggered when a fine-tuning job is manually cancelled.

**Batch Created**

Triggers on: batches/batch.created

Triggered when a new processing batch is created.

**Batch Completed**

Triggers on: batches/batch.completed

Triggered when a batch processing job is finished.

**Batch Failed**

Triggers on: batches/batch.failed

Triggered when a batch processing job fails.

**Batch Cancelled**

Triggers on: batches/batch.cancelled

Triggered when a batch job is cancelled.

**Batch Expired**

Triggers on: batches/batch.expired

Triggered when a batch job expires before completion.

**Assistant Created**

Triggers on: assistants/assistant.created

Triggered when a new AI assistant is created.

**Assistant Updated**

Triggers on: assistants/assistant.updated

Triggered when an assistant's configuration is modified.

**Assistant Deleted**

Triggers on: assistants/assistant.deleted

Triggered when an assistant is deleted.

**Thread Created**

Triggers on: threads/thread.created

Triggered when a new conversation thread is created.

**Thread Deleted**

Triggers on: threads/thread.deleted

Triggered when a conversation thread is deleted.

**Thread Message Created**

Triggers on: thread\_messages/thread.message.created

Triggered when a new message is added to a thread.

**Thread Message Completed**

Triggers on: thread\_messages/thread.message.completed

Triggered when a thread message is fully generated.

**Thread Message Deleted**

Triggers on: thread\_messages/thread.message.deleted

Triggered when a message is removed from a thread.

**Thread Run Created**

Triggers on: runs/thread.run.created

Triggered when a new run is started on a thread.

**Thread Run Completed**

Triggers on: runs/thread.run.completed

Triggered when a thread run finishes successfully.

**Thread Run Failed**

Triggers on: runs/thread.run.failed

Triggered when a thread run encounters an error.

**Thread Run Requires Action**

Triggers on: runs/thread.run.requires\_action

Triggered when a thread run is waiting for user action or tool output.

**Thread Run Cancelled**

Triggers on: runs/thread.run.cancelled

Triggered when a thread run is cancelled.

**Thread Run Expired**

Triggers on: runs/thread.run.expired

Triggered when a thread run times out.

**Vector Store Created**

Triggers on: vector\_stores/vector\_store.created

Triggered when a new vector store is created.

**Vector Store Completed**

Triggers on: vector\_stores/vector\_store.completed

Triggered when a vector store is fully processed and ready.

**Vector Store Deleted**

Triggers on: vector\_stores/vector\_store.deleted

Triggered when a vector store is deleted.

#### Action Operations

[Action: Analyze Text](/human-connections/chatgpt/chatgpt/action-analyze-text.md)

[Action: Analyze Images](/human-connections/chatgpt/chatgpt/action-analyze-images.md)

[Action: Create Embedding](/human-connections/chatgpt/chatgpt/action-create-embedding.md)

[Action: Create Transcription](/human-connections/chatgpt/chatgpt/action-create-transcription.md)

#### Query Operations

Example link

### Related Automations

Example link

### Obtaining Access Credentials

To obtain a **Personal Access Token (PAT)** for **OpenAI** (system-to-system access via UI), follow these steps:

#### **Prerequisites**

* An **OpenAI account** (sign up at <https://platform.openai.com>)
* Access to the **OpenAI API dashboard** (requires an active subscription if using paid APIs)

#### **Steps to Generate a PAT**

1. **Log in** to your OpenAI account at <https://platform.openai.com>.
2. Navigate to the **API keys** section:
   * Click on the **"API keys"** button, under the Manage section.
3. **Create a new secret key**:
   * Click **"Create new secret key"**.
   * Provide a name (optional but recommended for tracking).
   * Select the required permissions - All.
4. **Copy the generated key**:
   * The PAT will be displayed **once**—store it securely.

### Configuring Webhooks

1. **Log in** to your OpenAI account at <https://platform.openai.com>.
2. Navigate to the **Webhooks** section:
   * Click on **"Settings"** or select your **Project** from the left sidebar.
   * Click on the **"Webhooks"** tab.
3. **Create a new webhook endpoint**:
   * Click the **"Create"** button.
   * Provide your **Endpoint URL** (must be a public HTTPS URL).
   * Select the **Events** you want to subscribe to (e.g., `batch.completed`, `response.completed`).
4. **Copy the signing secret**:
   * Once the webhook is created, copy the **Signing Secret**.
   * Use this secret to verify that incoming requests are sent from OpenAI.

### Code (Apache v2.0): Service Connectivity and Metadata

```
{
  "handle": "chatgpt-v1",
  "status": "active",
  "meta": {
    "short": "ChatGPT",
    "description": "Connect to OpenAI's ChatGPT API for natural language processing and text generation.",
    "icon": "chatgpt",
    "tags": ["ai", "nlp", "chatbot", "text-generation"]
  },
  "service": {
    "baseURL": {
      "value": "https://api.openai.com/v1"
    },
    "protocol": "https",
    "contentType": "application/json",
    "headers": {
      "Content-Type": "application/json",
      "Authorization": {
        "value": "Bearer {{apiKey}}"
      }
    },
    "auth": {
      "method": "api_token",
      "params": {
        "apiToken": {
          "token": {
            "value": "{{apiKey}}",
            "placeholders": [
              {
                "name": "apiKey",
                "type": "String",
                "description": "OpenAI API key for authentication",
                "required": true
              }
            ]
          },
          "headerName": {
            "value": "Authorization"
          }
        }
      }
    }
  }
}

```

### Code (Apache v2.0): List of External Resources and Internal Mapping

```
[
  {
    "handle": "chat_completions",
    "meta": {
      "short": "Chat Completions",
      "description": "Generate model responses for chat messages. The core endpoint for conversational AI and text generation."
    },
    "endpoint": {
      "value": "/chat/completions"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the completion." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'chat.completion'." } },
      { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of when the completion was created." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used to generate the completion." } },
      { "name": "content", "type": "String", "selector": ["choices", "0", "message", "content"], "meta": { "description": "The generated message content." } },
      { "name": "finish_reason", "type": "String", "selector": ["choices", "0", "finish_reason"], "meta": { "description": "Reason the model stopped generating (e.g., stop, length, tool_calls)." } },
      { "name": "prompt_tokens", "type": "Integer", "selector": ["usage", "prompt_tokens"], "meta": { "description": "Number of tokens in the prompt." } },
      { "name": "completion_tokens", "type": "Integer", "selector": ["usage", "completion_tokens"], "meta": { "description": "Number of tokens in the completion." } },
      { "name": "total_tokens", "type": "Integer", "selector": ["usage", "total_tokens"], "meta": { "description": "Total tokens used." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"messages\": {{messages}}}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "ID of the model to use (e.g., gpt-4o, gpt-4-turbo).", "required": true },
            { "name": "messages", "type": "String", "description": "JSON array of message objects with role and content.", "required": true }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "chat.completion.created", "path": "/webhooks/chatgpt/chat-completion-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the completion." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'chat.completion'." } },
          { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of creation." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used to generate the completion." } },
          { "name": "content", "type": "String", "selector": ["choices", "0", "message", "content"], "meta": { "description": "The generated message content." } },
          { "name": "finish_reason", "type": "String", "selector": ["choices", "0", "finish_reason"], "meta": { "description": "Reason the model stopped generating." } },
          { "name": "prompt_tokens", "type": "Integer", "selector": ["usage", "prompt_tokens"], "meta": { "description": "Number of tokens in the prompt." } },
          { "name": "completion_tokens", "type": "Integer", "selector": ["usage", "completion_tokens"], "meta": { "description": "Number of tokens in the completion." } },
          { "name": "total_tokens", "type": "Integer", "selector": ["usage", "total_tokens"], "meta": { "description": "Total tokens used." } }
        ]
      }
    ]
  },
  {
    "handle": "responses",
    "meta": {
      "short": "Responses",
      "description": "Create model responses using the Responses API (newer stateful API supporting tools, file search, and web search)."
    },
    "endpoint": {
      "value": "/responses"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the response." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'response'." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the response was created." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used." } },
      { "name": "output_text", "type": "String", "selector": ["output", "0", "content", "0", "text"], "meta": { "description": "The generated text output." } },
      { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Response status (e.g., completed, in_progress, failed)." } },
      { "name": "input_tokens", "type": "Integer", "selector": ["usage", "input_tokens"], "meta": { "description": "Number of input tokens used." } },
      { "name": "output_tokens", "type": "Integer", "selector": ["usage", "output_tokens"], "meta": { "description": "Number of output tokens generated." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"input\": \"{{input}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "ID of the model to use (e.g., gpt-4o).", "required": true },
            { "name": "input", "type": "String", "description": "The input text or messages for the model.", "required": true }
          ]
        }
      },
      "read": {
        "method": "GET",
        "path": { "value": "/{{response_id}}", "placeholders": [{ "name": "response_id", "type": "String", "description": "ID of the response to retrieve.", "required": true }] }
      },
      "delete": {
        "method": "DELETE",
        "path": { "value": "/{{response_id}}", "placeholders": [{ "name": "response_id", "type": "String", "description": "ID of the response to delete.", "required": true }] }
      }
    },
    "webhooks": [
      {
        "event": "response.completed", "path": "/webhooks/chatgpt/response-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the response." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'response'." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Response status (e.g., completed)." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used." } },
          { "name": "output_text", "type": "String", "selector": ["output", "0", "content", "0", "text"], "meta": { "description": "The generated text output." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } },
          { "name": "input_tokens", "type": "Integer", "selector": ["usage", "input_tokens"], "meta": { "description": "Input tokens used." } },
          { "name": "output_tokens", "type": "Integer", "selector": ["usage", "output_tokens"], "meta": { "description": "Output tokens generated." } }
        ]
      },
      {
        "event": "response.failed", "path": "/webhooks/chatgpt/response-failed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the response." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Response status (e.g., failed)." } },
          { "name": "error", "type": "Object", "selector": ["error"], "meta": { "description": "Error details explaining the failure." } }
        ]
      }
    ]
  },
  {
    "handle": "embeddings",
    "meta": {
      "short": "Embeddings",
      "description": "Generate vector representations of text for semantic search, clustering, and similarity tasks."
    },
    "endpoint": {
      "value": "/embeddings"
    },
    "fields": [
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'list'." } },
      { "name": "embedding", "type": "String", "selector": ["data", "0", "embedding"], "multivalue": true, "meta": { "description": "The embedding vector as an array of floats." } },
      { "name": "index", "type": "Integer", "selector": ["data", "0", "index"], "meta": { "description": "Index of the embedding in the list." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used to generate the embeddings." } },
      { "name": "prompt_tokens", "type": "Integer", "selector": ["usage", "prompt_tokens"], "meta": { "description": "Number of tokens in the input." } },
      { "name": "total_tokens", "type": "Integer", "selector": ["usage", "total_tokens"], "meta": { "description": "Total tokens used." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"input\": \"{{input}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "ID of the embedding model (e.g., text-embedding-3-small).", "required": true },
            { "name": "input", "type": "String", "description": "Text string or array of strings to embed.", "required": true }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "embedding.created", "path": "/webhooks/chatgpt/embedding-created",
        "payload": [
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'list'." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The model used for embeddings." } },
          { "name": "total_tokens", "type": "Integer", "selector": ["usage", "total_tokens"], "meta": { "description": "Total tokens used for the generation." } },
          { "name": "prompt_tokens", "type": "Integer", "selector": ["usage", "prompt_tokens"], "meta": { "description": "Input tokens used." } }
        ]
      }
    ]
  },
  {
    "handle": "images",
    "meta": {
      "short": "Images",
      "description": "Generate, edit, and create variations of images using DALL·E models."
    },
    "endpoint": {
      "value": "/images/generations"
    },
    "fields": [
      { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of when the image was created." } },
      { "name": "url", "type": "String", "selector": ["data", "0", "url"], "meta": { "description": "URL of the generated image." } },
      { "name": "revised_prompt", "type": "String", "selector": ["data", "0", "revised_prompt"], "meta": { "description": "The revised prompt used for generation (if applicable)." } },
      { "name": "b64_json", "type": "String", "selector": ["data", "0", "b64_json"], "meta": { "description": "Base64-encoded image data (when response_format is b64_json)." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"prompt\": \"{{prompt}}\", \"n\": {{n}}, \"size\": \"{{size}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Model to use (e.g., dall-e-3, dall-e-2).", "required": true },
            { "name": "prompt", "type": "String", "description": "Text description of the desired image.", "required": true },
            { "name": "n", "type": "Integer", "description": "Number of images to generate (1–10).", "required": false },
            { "name": "size", "type": "String", "description": "Image size (e.g., 1024x1024, 1792x1024).", "required": false, "options": ["256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"] }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "image.generated", "path": "/webhooks/chatgpt/image-generated",
        "payload": [
          { "name": "url", "type": "String", "selector": ["data", "0", "url"], "meta": { "description": "URL of the generated image." } },
          { "name": "revised_prompt", "type": "String", "selector": ["data", "0", "revised_prompt"], "meta": { "description": "The revised prompt used for generation." } },
          { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "image.failed", "path": "/webhooks/chatgpt/image-failed",
        "payload": [
          { "name": "error", "type": "Object", "selector": ["error"], "meta": { "description": "Error details if image generation failed." } }
        ]
      }
    ]
  },
  {
    "handle": "audio_transcriptions",
    "meta": {
      "short": "Audio Transcriptions",
      "description": "Transcribe audio into text using the Whisper model."
    },
    "endpoint": {
      "value": "/audio/transcriptions"
    },
    "fields": [
      { "name": "text", "type": "String", "selector": ["text"], "meta": { "description": "The transcribed text." } },
      { "name": "language", "type": "String", "selector": ["language"], "meta": { "description": "The language of the transcribed text." } },
      { "name": "duration", "type": "String", "selector": ["duration"], "meta": { "description": "Duration of the audio in seconds." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"file\": \"{{file}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Model to use (e.g., whisper-1).", "required": true },
            { "name": "file", "type": "String", "description": "Audio file to transcribe (multipart/form-data).", "required": true },
            { "name": "language", "type": "String", "description": "Language of the audio in ISO-639-1 format.", "required": false },
            { "name": "prompt", "type": "String", "description": "Optional context or spelling hints.", "required": false }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "audio.transcription.completed", "path": "/webhooks/chatgpt/audio-transcription-completed",
        "payload": [
          { "name": "text", "type": "String", "selector": ["text"], "meta": { "description": "The transcribed text." } },
          { "name": "language", "type": "String", "selector": ["language"], "meta": { "description": "The language detected." } },
          { "name": "duration", "type": "String", "selector": ["duration"], "meta": { "description": "Duration of the audio in seconds." } }
        ]
      }
    ]
  },
  {
    "handle": "audio_speech",
    "meta": {
      "short": "Audio Speech",
      "description": "Generate spoken audio from text using TTS models."
    },
    "endpoint": {
      "value": "/audio/speech"
    },
    "fields": [
      { "name": "audio_data", "type": "String", "selector": [], "meta": { "description": "Raw binary audio content returned in the response body." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"input\": \"{{input}}\", \"voice\": \"{{voice}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "TTS model to use (e.g., tts-1, tts-1-hd).", "required": true },
            { "name": "input", "type": "String", "description": "The text to synthesize (max 4096 characters).", "required": true },
            { "name": "voice", "type": "String", "description": "Voice to use.", "required": true, "options": ["alloy", "echo", "fable", "onyx", "nova", "shimmer"] },
            { "name": "response_format", "type": "String", "description": "Output audio format.", "required": false, "options": ["mp3", "opus", "aac", "flac", "wav", "pcm"] }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "audio.speech.generated", "path": "/webhooks/chatgpt/audio-speech-generated",
        "payload": [
          { "name": "audio_data", "type": "String", "selector": [], "meta": { "description": "Binary audio content." } }
        ]
      }
    ]
  },
  {
    "handle": "models",
    "meta": {
      "short": "Models",
      "description": "List and retrieve available OpenAI models."
    },
    "endpoint": {
      "value": "/models"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Model identifier (e.g., gpt-4o)." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'model'." } },
      { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of when the model was created." } },
      { "name": "owned_by", "type": "String", "selector": ["owned_by"], "meta": { "description": "Organization that owns the model." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" } },
      "read": { "method": "GET", "path": { "value": "/{{model_id}}", "placeholders": [{ "name": "model_id", "type": "String", "description": "The ID of the model.", "required": true }] } },
      "delete": { "method": "DELETE", "path": { "value": "/{{model_id}}", "placeholders": [{ "name": "model_id", "type": "String", "description": "The ID of the fine-tuned model to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "model.created", "path": "/webhooks/chatgpt/model-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Model identifier (e.g., gpt-4o)." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'model'." } },
          { "name": "created", "type": "Integer", "selector": ["created"], "meta": { "description": "Unix timestamp of creation." } },
          { "name": "owned_by", "type": "String", "selector": ["owned_by"], "meta": { "description": "Organization that owns the model." } }
        ]
      },
      {
        "event": "model.deleted", "path": "/webhooks/chatgpt/model-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Model identifier." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether the model was successfully deleted." } }
        ]
      }
    ]
  },
  {
    "handle": "moderations",
    "meta": {
      "short": "Moderations",
      "description": "Classify text for policy violations using OpenAI's moderation model."
    },
    "endpoint": {
      "value": "/moderations"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the moderation result." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The moderation model used." } },
      { "name": "flagged", "type": "Boolean", "selector": ["results", "0", "flagged"], "meta": { "description": "Whether the input was flagged as violating policy." } },
      { "name": "hate", "type": "Boolean", "selector": ["results", "0", "categories", "hate"], "meta": { "description": "Whether hate content was detected." } },
      { "name": "harassment", "type": "Boolean", "selector": ["results", "0", "categories", "harassment"], "meta": { "description": "Whether harassment content was detected." } },
      { "name": "self_harm", "type": "Boolean", "selector": ["results", "0", "categories", "self-harm"], "meta": { "description": "Whether self-harm content was detected." } },
      { "name": "sexual", "type": "Boolean", "selector": ["results", "0", "categories", "sexual"], "meta": { "description": "Whether sexual content was detected." } },
      { "name": "violence", "type": "Boolean", "selector": ["results", "0", "categories", "violence"], "meta": { "description": "Whether violent content was detected." } }
    ],
    "operations": {
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"input\": \"{{input}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Moderation model (e.g., omni-moderation-latest).", "required": false },
            { "name": "input", "type": "String", "description": "Text to classify.", "required": true }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "moderation.completed", "path": "/webhooks/chatgpt/moderation-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the moderation result." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "The moderation model used." } },
          { "name": "flagged", "type": "Boolean", "selector": ["results", "0", "flagged"], "meta": { "description": "Whether content was flagged." } },
          { "name": "categories", "type": "Object", "selector": ["results", "0", "categories"], "meta": { "description": "Detailed violation categories." } }
        ]
      }
    ]
  },
  {
    "handle": "files",
    "meta": {
      "short": "Files",
      "description": "Upload and manage files used for fine-tuning, batch processing, and assistants."
    },
    "endpoint": {
      "value": "/files"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the file." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'file'." } },
      { "name": "bytes", "type": "Integer", "selector": ["bytes"], "meta": { "description": "File size in bytes." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the file was uploaded." } },
      { "name": "filename", "type": "String", "selector": ["filename"], "meta": { "description": "Name of the file." } },
      { "name": "purpose", "type": "String", "selector": ["purpose"], "meta": { "description": "Intended purpose of the file (e.g., fine-tune, assistants, batch)." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "purpose": { "value": "{{purpose}}", "placeholders": [{ "name": "purpose", "type": "String", "description": "Filter by purpose.", "required": false }] } } },
      "read": { "method": "GET", "path": { "value": "/{{file_id}}", "placeholders": [{ "name": "file_id", "type": "String", "description": "ID of the file.", "required": true }] } },
      "delete": { "method": "DELETE", "path": { "value": "/{{file_id}}", "placeholders": [{ "name": "file_id", "type": "String", "description": "ID of the file to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "file.created", "path": "/webhooks/chatgpt/file-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "File identifier." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'file'." } },
          { "name": "filename", "type": "String", "selector": ["filename"], "meta": { "description": "Name of the file." } },
          { "name": "purpose", "type": "String", "selector": ["purpose"], "meta": { "description": "Intended purpose of the file." } },
          { "name": "bytes", "type": "Integer", "selector": ["bytes"], "meta": { "description": "File size in bytes." } }
        ]
      },
      {
        "event": "file.deleted", "path": "/webhooks/chatgpt/file-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "File identifier." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether the file was successfully deleted." } }
        ]
      }
    ]
  },
  {
    "handle": "fine_tuning_jobs",
    "meta": {
      "short": "Fine-Tuning Jobs",
      "description": "Create and manage fine-tuning jobs to customize OpenAI models on your data."
    },
    "endpoint": {
      "value": "/fine_tuning/jobs"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the fine-tuning job." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Base model being fine-tuned." } },
      { "name": "fine_tuned_model", "type": "String", "selector": ["fine_tuned_model"], "meta": { "description": "Name of the resulting fine-tuned model." } },
      { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Job status (e.g., validating_files, queued, running, succeeded, failed, cancelled)." } },
      { "name": "training_file", "type": "String", "selector": ["training_file"], "meta": { "description": "ID of the training file." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the job was created." } },
      { "name": "finished_at", "type": "Integer", "selector": ["finished_at"], "meta": { "description": "Unix timestamp of when the job finished." } },
      { "name": "trained_tokens", "type": "Integer", "selector": ["trained_tokens"], "meta": { "description": "Total number of tokens trained." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" } } },
      "read": { "method": "GET", "path": { "value": "/{{fine_tuning_job_id}}", "placeholders": [{ "name": "fine_tuning_job_id", "type": "String", "description": "ID of the fine-tuning job.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"training_file\": \"{{training_file}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Base model to fine-tune (e.g., gpt-4o-mini).", "required": true },
            { "name": "training_file", "type": "String", "description": "ID of the uploaded training file.", "required": true }
          ]
        }
      },
      "delete": { "method": "DELETE", "path": { "value": "/{{fine_tuning_job_id}}", "placeholders": [{ "name": "fine_tuning_job_id", "type": "String", "description": "ID of the fine-tuning job.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "fine_tuning.job.created", "path": "/webhooks/chatgpt/fine-tuning-job-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Job identifier." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Base model being fine-tuned." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Job status." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } },
          { "name": "training_file", "type": "String", "selector": ["training_file"], "meta": { "description": "ID of the training file used." } }
        ]
      },
      {
        "event": "fine_tuning.job.succeeded", "path": "/webhooks/chatgpt/fine-tuning-job-succeeded",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Job identifier." } },
          { "name": "fine_tuned_model", "type": "String", "selector": ["fine_tuned_model"], "meta": { "description": "Resulting model name." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Job status, always 'succeeded'." } },
          { "name": "trained_tokens", "type": "Integer", "selector": ["trained_tokens"], "meta": { "description": "Total number of tokens trained." } },
          { "name": "finished_at", "type": "Integer", "selector": ["finished_at"], "meta": { "description": "Unix timestamp of completion." } }
        ]
      },
      {
        "event": "fine_tuning.job.failed", "path": "/webhooks/chatgpt/fine-tuning-job-failed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Job identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Job status, always 'failed'." } },
          { "name": "error", "type": "Object", "selector": ["error"], "meta": { "description": "Error details explaining the failure." } }
        ]
      },
      {
        "event": "fine_tuning.job.cancelled", "path": "/webhooks/chatgpt/fine-tuning-job-cancelled",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Job identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Job status, always 'cancelled'." } }
        ]
      }
    ]
  },
  {
    "handle": "batches",
    "meta": {
      "short": "Batches",
      "description": "Submit large sets of API requests for asynchronous processing at lower cost."
    },
    "endpoint": {
      "value": "/batches"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the batch." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'batch'." } },
      { "name": "endpoint", "type": "String", "selector": ["endpoint"], "meta": { "description": "API endpoint the batch targets." } },
      { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status (e.g., validating, in_progress, completed, failed, cancelled)." } },
      { "name": "input_file_id", "type": "String", "selector": ["input_file_id"], "meta": { "description": "ID of the uploaded input file." } },
      { "name": "output_file_id", "type": "String", "selector": ["output_file_id"], "meta": { "description": "ID of the output file with results." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the batch was created." } },
      { "name": "completed_at", "type": "Integer", "selector": ["completed_at"], "meta": { "description": "Unix timestamp of when the batch completed." } },
      { "name": "request_counts_total", "type": "Integer", "selector": ["request_counts", "total"], "meta": { "description": "Total number of requests in the batch." } },
      { "name": "request_counts_completed", "type": "Integer", "selector": ["request_counts", "completed"], "meta": { "description": "Number of completed requests." } },
      { "name": "request_counts_failed", "type": "Integer", "selector": ["request_counts", "failed"], "meta": { "description": "Number of failed requests." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" } } },
      "read": { "method": "GET", "path": { "value": "/{{batch_id}}", "placeholders": [{ "name": "batch_id", "type": "String", "description": "ID of the batch.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"input_file_id\": \"{{input_file_id}}\", \"endpoint\": \"{{endpoint}}\", \"completion_window\": \"{{completion_window}}\"}",
          "placeholders": [
            { "name": "input_file_id", "type": "String", "description": "ID of the uploaded JSONL input file.", "required": true },
            { "name": "endpoint", "type": "String", "description": "API endpoint for the batch (e.g., /v1/chat/completions).", "required": true },
            { "name": "completion_window", "type": "String", "description": "Time window to complete the batch (e.g., 24h).", "required": true }
          ]
        }
      },
      "delete": { "method": "DELETE", "path": { "value": "/{{batch_id}}/cancel", "placeholders": [{ "name": "batch_id", "type": "String", "description": "ID of the batch to cancel.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "batch.created", "path": "/webhooks/chatgpt/batch-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Batch identifier." } },
          { "name": "endpoint", "type": "String", "selector": ["endpoint"], "meta": { "description": "API endpoint the batch targets." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "batch.completed", "path": "/webhooks/chatgpt/batch-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Batch identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status, always 'completed'." } },
          { "name": "output_file_id", "type": "String", "selector": ["output_file_id"], "meta": { "description": "Results file ID." } },
          { "name": "request_counts_total", "type": "Integer", "selector": ["request_counts", "total"], "meta": { "description": "Total number of requests in the batch." } },
          { "name": "request_counts_completed", "type": "Integer", "selector": ["request_counts", "completed"], "meta": { "description": "Number of completed requests." } },
          { "name": "completed_at", "type": "Integer", "selector": ["completed_at"], "meta": { "description": "Unix timestamp of completion." } }
        ]
      },
      {
        "event": "batch.failed", "path": "/webhooks/chatgpt/batch-failed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Batch identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status, always 'failed'." } },
          { "name": "errors", "type": "Object", "selector": ["errors"], "meta": { "description": "Error details for the batch." } }
        ]
      },
      {
        "event": "batch.cancelled", "path": "/webhooks/chatgpt/batch-cancelled",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Batch identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status, always 'cancelled'." } }
        ]
      },
      {
        "event": "batch.expired", "path": "/webhooks/chatgpt/batch-expired",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Batch identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Batch status, always 'expired'." } }
        ]
      }
    ]
  },
  {
    "handle": "assistants",
    "meta": {
      "short": "Assistants",
      "description": "Create and manage AI assistants with custom instructions, tools, and knowledge."
    },
    "endpoint": {
      "value": "/assistants"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the assistant." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'assistant'." } },
      { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Name of the assistant." } },
      { "name": "description", "type": "String", "selector": ["description"], "meta": { "description": "Description of the assistant." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used by the assistant." } },
      { "name": "instructions", "type": "String", "selector": ["instructions"], "meta": { "description": "System instructions for the assistant." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the assistant was created." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" }, "order": { "value": "desc" } } },
      "read": { "method": "GET", "path": { "value": "/{{assistant_id}}", "placeholders": [{ "name": "assistant_id", "type": "String", "description": "ID of the assistant.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"name\": \"{{name}}\", \"instructions\": \"{{instructions}}\"}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Model to use (e.g., gpt-4o).", "required": true },
            { "name": "name", "type": "String", "description": "Name of the assistant.", "required": false },
            { "name": "instructions", "type": "String", "description": "System instructions for the assistant.", "required": false }
          ]
        }
      },
      "update": {
        "method": "POST",
        "path": { "value": "/{{assistant_id}}", "placeholders": [{ "name": "assistant_id", "type": "String", "description": "ID of the assistant.", "required": true }] },
        "bodyTemplate": {
          "value": "{\"name\": \"{{name}}\", \"instructions\": \"{{instructions}}\"}",
          "placeholders": [
            { "name": "name", "type": "String", "description": "Updated name.", "required": false },
            { "name": "instructions", "type": "String", "description": "Updated instructions.", "required": false }
          ]
        }
      },
      "delete": { "method": "DELETE", "path": { "value": "/{{assistant_id}}", "placeholders": [{ "name": "assistant_id", "type": "String", "description": "ID of the assistant to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "assistant.created", "path": "/webhooks/chatgpt/assistant-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Assistant identifier." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'assistant'." } },
          { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Assistant name." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used by the assistant." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "assistant.updated", "path": "/webhooks/chatgpt/assistant-updated",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Assistant identifier." } },
          { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Updated assistant name." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used." } }
        ]
      },
      {
        "event": "assistant.deleted", "path": "/webhooks/chatgpt/assistant-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Assistant identifier." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether the assistant was successfully deleted." } }
        ]
      }
    ]
  },
  {
    "handle": "threads",
    "meta": {
      "short": "Threads",
      "description": "Create and manage conversation threads for use with Assistants."
    },
    "endpoint": {
      "value": "/threads"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the thread." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'thread'." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the thread was created." } }
    ],
    "operations": {
      "read": { "method": "GET", "path": { "value": "/{{thread_id}}", "placeholders": [{ "name": "thread_id", "type": "String", "description": "ID of the thread.", "required": true }] } },
      "create": { "method": "POST", "path": { "value": "" }, "bodyTemplate": { "value": "{}", "placeholders": [] } },
      "delete": { "method": "DELETE", "path": { "value": "/{{thread_id}}", "placeholders": [{ "name": "thread_id", "type": "String", "description": "ID of the thread to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "thread.created", "path": "/webhooks/chatgpt/thread-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Thread identifier." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'thread'." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "thread.deleted", "path": "/webhooks/chatgpt/thread-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Thread identifier." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether the thread was successfully deleted." } }
        ]
      }
    ]
  },
  {
    "handle": "thread_messages",
    "meta": {
      "short": "Thread Messages",
      "description": "Add and retrieve messages within an Assistant thread."
    },
    "endpoint": {
      "value": "/threads/{{thread_id}}/messages",
      "placeholders": [{ "name": "thread_id", "type": "String", "description": "ID of the thread.", "required": true }]
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the message." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'thread.message'." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the message was created." } },
      { "name": "role", "type": "String", "selector": ["role"], "meta": { "description": "Role of the message author (user or assistant)." } },
      { "name": "content", "type": "String", "selector": ["content", "0", "text", "value"], "meta": { "description": "Text content of the message." } },
      { "name": "assistant_id", "type": "String", "selector": ["assistant_id"], "meta": { "description": "ID of the assistant that created the message (if applicable)." } },
      { "name": "run_id", "type": "String", "selector": ["run_id"], "meta": { "description": "ID of the run that created the message (if applicable)." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" }, "order": { "value": "desc" } } },
      "read": { "method": "GET", "path": { "value": "/{{message_id}}", "placeholders": [{ "name": "message_id", "type": "String", "description": "ID of the message.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"role\": \"{{role}}\", \"content\": \"{{content}}\"}",
          "placeholders": [
            { "name": "role", "type": "String", "description": "Role of the message author.", "required": true, "options": ["user", "assistant"] },
            { "name": "content", "type": "String", "description": "Content of the message.", "required": true }
          ]
        }
      },
      "delete": { "method": "DELETE", "path": { "value": "/{{message_id}}", "placeholders": [{ "name": "message_id", "type": "String", "description": "ID of the message to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "thread.message.created", "path": "/webhooks/chatgpt/thread-message-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Message identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "role", "type": "String", "selector": ["role"], "meta": { "description": "Author role (user or assistant)." } },
          { "name": "content", "type": "String", "selector": ["content", "0", "text", "value"], "meta": { "description": "Message content." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "thread.message.completed", "path": "/webhooks/chatgpt/thread-message-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Message identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "content", "type": "String", "selector": ["content", "0", "text", "value"], "meta": { "description": "Final message content." } }
        ]
      },
      {
        "event": "thread.message.deleted", "path": "/webhooks/chatgpt/thread-message-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Message identifier." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether deletion was successful." } }
        ]
      }
    ]
  },
  {
    "handle": "runs",
    "meta": {
      "short": "Runs",
      "description": "Execute an assistant on a thread to produce responses and tool calls."
    },
    "endpoint": {
      "value": "/threads/{{thread_id}}/runs",
      "placeholders": [{ "name": "thread_id", "type": "String", "description": "ID of the thread.", "required": true }]
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the run." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'thread.run'." } },
      { "name": "assistant_id", "type": "String", "selector": ["assistant_id"], "meta": { "description": "ID of the assistant used for the run." } },
      { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
      { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status (e.g., queued, in_progress, completed, failed, cancelled, requires_action)." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used for the run." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the run was created." } },
      { "name": "completed_at", "type": "Integer", "selector": ["completed_at"], "meta": { "description": "Unix timestamp of when the run completed." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" }, "order": { "value": "desc" } } },
      "read": { "method": "GET", "path": { "value": "/{{run_id}}", "placeholders": [{ "name": "run_id", "type": "String", "description": "ID of the run.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"assistant_id\": \"{{assistant_id}}\"}",
          "placeholders": [
            { "name": "assistant_id", "type": "String", "description": "ID of the assistant to run.", "required": true }
          ]
        }
      },
      "delete": { "method": "POST", "path": { "value": "/{{run_id}}/cancel", "placeholders": [{ "name": "run_id", "type": "String", "description": "ID of the run to cancel.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "thread.run.created", "path": "/webhooks/chatgpt/thread-run-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "assistant_id", "type": "String", "selector": ["assistant_id"], "meta": { "description": "ID of the assistant used." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "thread.run.completed", "path": "/webhooks/chatgpt/thread-run-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status, always 'completed'." } },
          { "name": "usage", "type": "Object", "selector": ["usage"], "meta": { "description": "Token usage for the run." } },
          { "name": "completed_at", "type": "Integer", "selector": ["completed_at"], "meta": { "description": "Unix timestamp of completion." } }
        ]
      },
      {
        "event": "thread.run.failed", "path": "/webhooks/chatgpt/thread-run-failed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status, always 'failed'." } },
          { "name": "last_error", "type": "Object", "selector": ["last_error"], "meta": { "description": "Error details." } }
        ]
      },
      {
        "event": "thread.run.requires_action", "path": "/webhooks/chatgpt/thread-run-requires-action",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "thread_id", "type": "String", "selector": ["thread_id"], "meta": { "description": "ID of the thread." } },
          { "name": "required_action", "type": "Object", "selector": ["required_action"], "meta": { "description": "Action details required from the user." } }
        ]
      },
      {
        "event": "thread.run.cancelled", "path": "/webhooks/chatgpt/thread-run-cancelled",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status, always 'cancelled'." } }
        ]
      },
      {
        "event": "thread.run.expired", "path": "/webhooks/chatgpt/thread-run-expired",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Run identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Run status, always 'expired'." } }
        ]
      }
    ]
  },
  {
    "handle": "vector_stores",
    "meta": {
      "short": "Vector Stores",
      "description": "Create and manage vector stores for file search with Assistants."
    },
    "endpoint": {
      "value": "/vector_stores"
    },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the vector store." } },
      { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'vector_store'." } },
      { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Name of the vector store." } },
      { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Status (e.g., expired, in_progress, completed)." } },
      { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of when the vector store was created." } },
      { "name": "file_counts_total", "type": "Integer", "selector": ["file_counts", "total"], "meta": { "description": "Total number of files in the store." } },
      { "name": "usage_bytes", "type": "Integer", "selector": ["usage_bytes"], "meta": { "description": "Storage used in bytes." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" }, "queryParams": { "limit": { "value": "20" }, "order": { "value": "desc" } } },
      "read": { "method": "GET", "path": { "value": "/{{vector_store_id}}", "placeholders": [{ "name": "vector_store_id", "type": "String", "description": "ID of the vector store.", "required": true }] } },
      "create": {
        "method": "POST",
        "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"name\": \"{{name}}\"}",
          "placeholders": [
            { "name": "name", "type": "String", "description": "Name of the vector store.", "required": false }
          ]
        }
      },
      "update": {
        "method": "POST",
        "path": { "value": "/{{vector_store_id}}", "placeholders": [{ "name": "vector_store_id", "type": "String", "description": "ID of the vector store.", "required": true }] },
        "bodyTemplate": {
          "value": "{\"name\": \"{{name}}\"}",
          "placeholders": [{ "name": "name", "type": "String", "description": "New name for the vector store.", "required": false }]
        }
      },
      "delete": { "method": "DELETE", "path": { "value": "/{{vector_store_id}}", "placeholders": [{ "name": "vector_store_id", "type": "String", "description": "ID of the vector store to delete.", "required": true }] } }
    },
    "webhooks": [
      {
        "event": "vector_store.created", "path": "/webhooks/chatgpt/vector-store-created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Vector store identifier." } },
          { "name": "object", "type": "String", "selector": ["object"], "meta": { "description": "Object type, always 'vector_store'." } },
          { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Vector store name." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Initial status." } },
          { "name": "created_at", "type": "Integer", "selector": ["created_at"], "meta": { "description": "Unix timestamp of creation." } }
        ]
      },
      {
        "event": "vector_store.completed", "path": "/webhooks/chatgpt/vector-store-completed",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Vector store identifier." } },
          { "name": "status", "type": "String", "selector": ["status"], "meta": { "description": "Status, always 'completed'." } },
          { "name": "file_counts_total", "type": "Integer", "selector": ["file_counts", "total"], "meta": { "description": "Total files included." } },
          { "name": "usage_bytes", "type": "Integer", "selector": ["usage_bytes"], "meta": { "description": "Storage used in bytes." } }
        ]
      },
      {
        "event": "vector_store.deleted", "path": "/webhooks/chatgpt/vector-store-deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Vector store identifier." } },
          { "name": "deleted", "type": "Boolean", "selector": ["deleted"], "meta": { "description": "Whether the store was successfully deleted." } }
        ]
      }
    ]
  }
]

```

<p align="center"><a class="button primary" data-icon="square-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscription</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.planetcrust.com/human-connections/chatgpt/chatgpt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
