Create Chat Completion
Send a message to GC AI and receive an AI-generated response.
This endpoint is asynchronous: it returns a job envelope, and the result is filled in once the job completes. See Asynchronous Requests for how waiting, polling, and the envelope work.
Multi-turn conversations
Every response includes a chat_id. Pass it back as chat_id on a later request to continue that conversation. Conversation state — prior messages, tool calls, and any returned documents, emails, or diagrams — is held server-side, so each turn sends only the new message (plus any new file_ids); never re-send prior turns or previously returned outputs.
Only one turn may be in flight per chat at a time: a request whose chat_id already has a turn running is rejected with 409. Wait for the prior turn to reach a terminal state before sending the next.
Continuing a chat is scoped like materialization: personal keys continue chats they created; organization keys continue organization chats. See Multi-turn Conversations.
Server-side tools
The model can invoke tools automatically while generating a response. Tool calls happen server-side. Only the final assistant text is returned in result.result.
| Tool | Description | Key type |
|---|---|---|
| Document reading | Read, query, and search within attached files | All |
| Web search | Search the web for current information | All |
| Research agent | Multi-step web research with synthesis | All |
| Case-law lookup | Search case law databases | User-scoped only |
| Playbook review | Run playbook checks against attached files (requires playbook_ids) | All |
| Document editing | Apply redline edits to an attached DOCX. All proposed revisions are auto-accepted; the edited file is returned via result.documents. The original file is preserved. | User-scoped only |
| Document generation | Generate a new DOCX from a prompt. The generated file is returned via result.documents. | User-scoped only |
| Slide generation | Generate a new PowerPoint deck (PPTX) from a prompt. The generated file is returned via result.documents. | User-scoped only |
| Email drafting | Draft a structured email from a prompt. The draft is returned via result.emails (to, subject, body, …). | All |
| Diagrams | Generate a diagram from a prompt. The diagram is returned via result.diagrams as validated Mermaid source (mermaid) you can render with any Mermaid-compatible renderer. | All |
The following tools are not available via API in beta (the response is plain text with no channel for rich outputs):
| Tool | Reason unavailable |
|---|---|
| Interactive clarification | Requires a back-and-forth channel with the caller |
This is an inference endpoint and is rate limited: during the free beta, roughly 1 request/minute per organization (burst of 3). Exceeding the limit returns 429 with a Retry-After header.
Authorizations
API key for authentication. Format: gcai_xxxxxxxxx
Create API keys in the GC AI app under Settings → API.
Headers
Optional RFC 7240 wait preference, for example wait=0. If both this header and the wait query parameter are supplied, they must match.
"wait=0"
Query Parameters
Optional long-poll wait time in seconds. Use 0 for fire-and-forget behavior. If both wait and Prefer: wait=... are supplied, they must match. Values above 90 are clamped.
x >= 00
Body
The user's message or prompt
1"What are the key terms to look for in a software license agreement?"
Optional uploaded file IDs to attach as context for this completion. Upload files first via POST /files.
Optional playbook IDs to ground the completion in (up to 20). The model uses each playbook's checks and guidance to structure its review of the attached files. Discover playbooks via GET /playbooks.
Org-scoped keys can use org-visible and official playbooks.
20Deprecated and no longer accepted. Use playbook_ids (an array) instead. Requests that include this field are rejected with a 400 so the playbook is never silently dropped.
Optional skill IDs to run on the first turn. Each skill's instructions are injected as context for this completion. Discover skills via GET /skills.
Only valid when starting a new chat — omit them when continuing with chat_id.
Optional chat ID to continue an existing conversation, from the chat_id of a prior completion. Omit to start a new chat.
Conversation state is held server-side, so send only your new message (plus any new file_ids) — do not re-send prior turns or previously returned documents/emails/diagrams. Only one turn may be in flight per chat at a time. See Multi-turn Conversations.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Response
Job completed within the effective wait window
Async job identifier
Stable job kind for this endpoint
chat/completions Current job status
pending, running, succeeded, failed, canceled Completion payload when the job has succeeded
Failure payload when the job has failed
ISO 8601 creation timestamp
ISO 8601 completion timestamp, or null when not terminal