chat_id. To put it into a person’s history, you materialize it.
Why API chats are hidden by default
When you callPOST /chat/completions, GC AI creates a chat to hold the exchange and returns its chat_id in the result envelope. Most API traffic is automated, though: batch contract reviews, a triage bot, a nightly job. If every one of those calls dropped a chat into someone’s sidebar, real users’ histories would fill up with machine-generated chats they never started.
So API chats start headless. The chat is saved and reachable by chat_id, but it stays out of every human-facing listing until a person explicitly claims it by materializing it.
What “hidden” means
An API chat that has not been materialized:- Does not appear in the web app. It never shows up in the chat sidebar or history.
- Does not appear in API chat search.
GET /chat/searchsearches the caller’s chat history, and the chat is not in it, so search will not return it. - Addressable only by
chat_id. Visibility is about listings, not access. The chat is still reachable directly by thechat_idfrom the completion response, but you have to hold that id yourself. Capture it (and the answer text) at the time of the call; an unmaterialized chat whosechat_idyou never kept is effectively lost.
Materialization is not a web-app-only flag. The same gate controls both the web sidebar and API chat search, so an unmaterialized chat is hidden in both. Materializing it makes the chat show up in both at once.
Materializing a chat
CallPOST /chat/{id}/materialize with the chat_id from a completed POST /chat/completions response:
- Adds it to chat history, so it shows up in the GC AI web app and becomes findable through
GET /chat/search. - Returns a shareable deep link (
chat_url) that opens the chat in the web app. - Is idempotent. Calling it again on an already-materialized chat returns the same link and changes nothing else.
Who can materialize what
Materialization claims a chat into a person’s or an organization’s history, so it is scoped to the key that created the chat:| Key type | Can materialize |
|---|---|
Personal (u:gcai_…) | Only chats it created. |
Organization (gcai_…) | Only chats created by other organization-scoped keys. |
Materialization and chat search
GET /chat/search runs hybrid search over the caller’s chat history. Two things follow from how visibility works:
- Search needs a personal key. Chat history is per-user, so chat search rejects organization keys with
400. Use a personal key. - Search only finds materialized chats. An API chat is not in anyone’s history until it is materialized, so it cannot show up in search before then. If you want an integration’s chats to be searchable later, materialize the ones worth keeping.
Related
- Create a Chat Completion: creates the chat and returns its
chat_id. - Multi-turn Conversations: continue a chat across turns by passing its
chat_id. - Materialize an API Chat: surface a chat by
chat_idand get a deep link. - Search Chats: hybrid search over a user’s chat history.
- API Keys: personal vs. organization keys and what each can reach.