Skip to main content

tokens

Creates, updates, deletes, gets or lists a tokens resource.

Overview

Nametokens
TypeResource
Idnetlify.ai_gateway.tokens

Fields

The following fields are returned by SELECT queries:

AI Gateway token for the site

NameDatatypeDescription
expires_atinteger (int64)Unix timestamp when the token expires
tokenstringThe AI Gateway authentication token
urlstringAI gateway base url

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_for_siteselectsite_idReturns an AI Gateway token for a specific site
get_for_accountselectaccount_idReturns an AI Gateway token scoped to an account

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe account ID
site_idstringThe site ID

SELECT examples

Returns an AI Gateway token for a specific site

SELECT
expires_at,
token,
url
FROM netlify.ai_gateway.tokens
WHERE site_id = '{{ site_id }}' -- required
;