AI connections
The connection that pays for an account’s AI work: its own provider key, or the platform’s, paid from the AI balance. Every account has the platform’s from the start, and :verify asks the provider whether a key still works.
List AI connections
How an account's AI runs are authorized with a provider: its own API key (BYOK), or permission to use the platform's key and pay from the AI balance (MANAGED). Every account has one MANAGED connection per provider from the moment it exists; add BYOK connections for keys of your own.
path Parameters
account_idId of the parent account.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: create_time, display_name, last_verify_time.
filterAIP-160 subset (§8). Filterable: create_time, display_name, is_enabled, mode, provider, status. A field outside the list is INVALID_ARGUMENT.
List AI connections › Responses
One page of ai_connections.
This page of ai_connections, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create AI connection
Adds a way for the account's AI runs to be authorized. For your own provider key, send mode: BYOK with the api_key: it is encrypted before it is stored, only its last four characters come back as key_hint, and the connection starts UNVERIFIED — call :verify to have the provider confirm it.
The account's MANAGED connection for each provider already exists, so a MANAGED create answers ALREADY_EXISTS; api_key on a MANAGED connection is refused, because the platform's key is not the account's to set.
path Parameters
account_idId of the parent account.
Create AI connection › Request Body
display_nameThe label that tells this connection apart in a list, such as Production key. Free text.
providerThe AI provider this connection reaches, by the platform's name for it. Set on create and fixed afterwards: a stored key belongs to exactly one provider.
modeBYOK — your own provider API key, used without touching your AI balance — or MANAGED, the platform's key, charged to the balance. Fixed after create.
api_keyThe provider API key. Required when creating a BYOK connection and refused on MANAGED; send it on Update to replace the stored key. It is encrypted before it is stored and no call ever returns it — key_hint is all that comes back.
is_enabledWhether runs may use this connection. Switch it off to stop a key being used without deleting it — and to turn managed access off for the account, since a MANAGED connection cannot be deleted.
priorityThe order connections are tried in when an agent may use more than one: lower goes first. Your keys start at 0 and the managed connection at 100, so a key you add is used before your balance is.
Create AI connection › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
providerThe AI provider this connection reaches, by the platform's name for it. Set on create and fixed afterwards: a stored key belongs to exactly one provider.
modeBYOK — your own provider API key, used without touching your AI balance — or MANAGED, the platform's key, charged to the balance. Fixed after create.
display_nameThe label that tells this connection apart in a list, such as Production key. Free text.
key_hintThe last four characters of the stored key — the only part of it any response carries, so that two keys can be told apart. Absent on a MANAGED connection, which has no key of its own.
is_enabledWhether runs may use this connection. Switch it off to stop a key being used without deleting it — and to turn managed access off for the account, since a MANAGED connection cannot be deleted.
priorityThe order connections are tried in when an agent may use more than one: lower goes first. Your keys start at 0 and the managed connection at 100, so a key you add is used before your balance is.
statusWhat the platform last learned about the key: UNVERIFIED until it is checked, then VALID or INVALID — moved by :verify, and by a run the provider refused for the key's sake. EXPIRED is reserved for providers that report it. Always UNVERIFIED on a MANAGED connection, which has no key of its own to learn anything about.
last_verify_timeWhen status was last decided by asking the provider (RFC 3339, UTC); cleared when the key is replaced, and absent on a MANAGED connection. Sort by it together with a provider filter — that is the pair an index backs.
Get AI connection
How an account's AI runs are authorized with a provider: its own API key (BYOK), or permission to use the platform's key and pay from the AI balance (MANAGED). Every account has one MANAGED connection per provider from the moment it exists; add BYOK connections for keys of your own.
path Parameters
account_idId of the parent account.
ai_connection_idId of the parent ai_connection.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get AI connection › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
providerThe AI provider this connection reaches, by the platform's name for it. Set on create and fixed afterwards: a stored key belongs to exactly one provider.
modeBYOK — your own provider API key, used without touching your AI balance — or MANAGED, the platform's key, charged to the balance. Fixed after create.
display_nameThe label that tells this connection apart in a list, such as Production key. Free text.
key_hintThe last four characters of the stored key — the only part of it any response carries, so that two keys can be told apart. Absent on a MANAGED connection, which has no key of its own.
is_enabledWhether runs may use this connection. Switch it off to stop a key being used without deleting it — and to turn managed access off for the account, since a MANAGED connection cannot be deleted.
priorityThe order connections are tried in when an agent may use more than one: lower goes first. Your keys start at 0 and the managed connection at 100, so a key you add is used before your balance is.
statusWhat the platform last learned about the key: UNVERIFIED until it is checked, then VALID or INVALID — moved by :verify, and by a run the provider refused for the key's sake. EXPIRED is reserved for providers that report it. Always UNVERIFIED on a MANAGED connection, which has no key of its own to learn anything about.
last_verify_timeWhen status was last decided by asking the provider (RFC 3339, UTC); cleared when the key is replaced, and absent on a MANAGED connection. Sort by it together with a provider filter — that is the pair an index backs.
Delete AI connection
Removes a BYOK connection and the key stored with it, for good. Runs stop using it at once. The account's MANAGED connection cannot be deleted — switch it off with is_enabled: false, which is how an account turns managed access off.
path Parameters
account_idId of the parent account.
ai_connection_idId of the parent ai_connection.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete AI connection › Responses
Deleted. No body (§7).
Update AI connection
Renames a connection, switches it on or off, or changes the order it is tried in. Sending a new api_key replaces the stored key: the old one is gone, key_hint changes, and the connection is UNVERIFIED again until it is checked — a verdict about the previous key says nothing about this one. provider and mode cannot be changed; create another connection.
path Parameters
account_idId of the parent account.
ai_connection_idId of the parent ai_connection.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update AI connection › Request Body
display_nameThe label that tells this connection apart in a list, such as Production key. Free text.
api_keyThe provider API key. Required when creating a BYOK connection and refused on MANAGED; send it on Update to replace the stored key. It is encrypted before it is stored and no call ever returns it — key_hint is all that comes back.
is_enabledWhether runs may use this connection. Switch it off to stop a key being used without deleting it — and to turn managed access off for the account, since a MANAGED connection cannot be deleted.
priorityThe order connections are tried in when an agent may use more than one: lower goes first. Your keys start at 0 and the managed connection at 100, so a key you add is used before your balance is.
Update AI connection › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
providerThe AI provider this connection reaches, by the platform's name for it. Set on create and fixed afterwards: a stored key belongs to exactly one provider.
modeBYOK — your own provider API key, used without touching your AI balance — or MANAGED, the platform's key, charged to the balance. Fixed after create.
display_nameThe label that tells this connection apart in a list, such as Production key. Free text.
key_hintThe last four characters of the stored key — the only part of it any response carries, so that two keys can be told apart. Absent on a MANAGED connection, which has no key of its own.
is_enabledWhether runs may use this connection. Switch it off to stop a key being used without deleting it — and to turn managed access off for the account, since a MANAGED connection cannot be deleted.
priorityThe order connections are tried in when an agent may use more than one: lower goes first. Your keys start at 0 and the managed connection at 100, so a key you add is used before your balance is.
statusWhat the platform last learned about the key: UNVERIFIED until it is checked, then VALID or INVALID — moved by :verify, and by a run the provider refused for the key's sake. EXPIRED is reserved for providers that report it. Always UNVERIFIED on a MANAGED connection, which has no key of its own to learn anything about.
last_verify_timeWhen status was last decided by asking the provider (RFC 3339, UTC); cleared when the key is replaced, and absent on a MANAGED connection. Sort by it together with a provider filter — that is the pair an index backs.
Verify (AI connection)
Asks the provider whether this connection's key still works, and records the answer: status becomes VALID or INVALID and last_verify_time is set. It uses the cheapest request that can tell, and costs no tokens. Answers with the connection either way — an INVALID key is the answer this call exists to give, not an error.
For a BYOK connection only. A MANAGED connection has no key of its own, so this call answers FAILED_PRECONDITION on one: the platform's key is checked by the platform.
When the provider cannot be reached the call fails with UNAVAILABLE and nothing is changed: not being able to ask says nothing about the key. Safe to repeat.
path Parameters
account_idId of the parent account.
ai_connection_idId of the parent ai_connection.
Verify (AI connection) › Request Body optional
Verify (AI connection) › Responses
The affected resource, or the method’s own response object (§10).