tokens
Creates, updates, deletes, gets or lists a tokens resource.
Overview
| Name | tokens |
| Type | Resource |
| Id | netlify.ai_gateway.tokens |
Fields
The following fields are returned by SELECT queries:
- get_for_site
- get_for_account
AI Gateway token for the site
| Name | Datatype | Description |
|---|---|---|
expires_at | integer (int64) | Unix timestamp when the token expires |
token | string | The AI Gateway authentication token |
url | string | AI gateway base url |
AI Gateway token for the account
| Name | Datatype | Description |
|---|---|---|
expires_at | integer (int64) | Unix timestamp when the token expires |
token | string | The AI Gateway authentication token |
url | string | AI gateway base url |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_for_site | select | site_id | Returns an AI Gateway token for a specific site | |
get_for_account | select | account_id | Returns 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The account ID |
site_id | string | The site ID |
SELECT examples
- get_for_site
- get_for_account
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
;
Returns an AI Gateway token scoped to an account
SELECT
expires_at,
token,
url
FROM netlify.ai_gateway.tokens
WHERE account_id = '{{ account_id }}' -- required
;