| Concept | Meaning |
|---|---|
| Thread | A conversation container within a project. |
| Interaction | A single exchange inside a thread. |
| Chat | A one‑shot request that does not create a thread. |
Basic request and response
Create a thread interaction withPOST /api/v1/app/thread/{threadId}/interaction.
Example response (InteractionDTO)
Example response (InteractionDTO)
Adding media to the chat
If the selected model supports multimodal input, you can send media inpgpt.messages[].content[] (the same request shape used by both thread interactions and one-shot chat).
You can mix multiple content blocks in one message. Supported block types in the schema:
| Type | Typical use | Required fields | Notes |
|---|---|---|---|
text | Plain text prompt/input | none | Uses text; supports optional citations metadata. |
image | Image attachment | data | data can be base64 or URL; optional mime_type. |
audio | Audio attachment | data | data can be base64 or URL; optional mime_type. |
binary | Generic binary payload | data, mime_type | Optional filename. |
file | File/document content block | content | Optional content_type, doc_metadata. |
tool_use | Tool call request | id, name, input | Internal/tool orchestration block. |
start_timestamp, stop_timestamp, and _meta are optional on all blocks.
Example content blocks
Example content blocks
system.citations.enabled: asks the model to include citation references when available.thinking.enabled: enables deep thinking mode; responses can take longer but are typically better reasoned.
Create or list threads
Create a new thread in a project:Example response (schema not defined in OpenAPI)
Example response (schema not defined in OpenAPI)
Update or delete a thread
List or fetch interactions
List interactions for a thread:Delete or stream an interaction
Delete an interaction:Example stream
Example stream
One‑shot chat
If you don’t need a thread, call the chat endpoint directly:Example response (schema not defined in OpenAPI)
Example response (schema not defined in OpenAPI)
Validate a chat request
Available tools
Pass tools inpgpt.tools as { "name": "...", "type": "..." }.
| Name | Type | What it does |
|---|---|---|
semantic_search | semantic_search_v1 | Searches indexed project/workspace knowledge by semantic similarity. |
file_sematic_search | file_semantic_search_v1 | Searches file-based content and attachments semantically. |
tabular_analysis | tabular_analysis_v1 | Analyzes tabular datasets and returns computed insights. |
database_query | database_query_v1 | Runs database lookups/queries through configured data sources. |
web_search | web_search_v1 | Performs web search for external/public information. |
web_extract | web_extract_v1 | Extracts structured text/content from URLs. |
list_project_files | list_project_files_v1 | Lists files in the current project for downstream tool usage. |
Errors and edge cases
- 400: invalid message schema (use
/chat/validate). - 404: thread or interaction not found.
- 409: interaction already completed when canceling.