api_keys
Creates, updates, deletes, gets or lists an api_keys resource.
Overview
| Name | api_keys |
| Type | Resource |
| Id | openai_admin.projects.api_keys |
Fields
The following fields are returned by SELECT queries:
- get
- list
Project API key retrieved successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the API key |
created_at | integer (unixtime) | The Unix timestamp (in seconds) of when the API key was created |
last_used_at | integer (unixtime) | The Unix timestamp (in seconds) of when the API key was last used. |
object | string | The object type, which is always organization.project.api_key (organization.project.api_key) |
owner | object | |
redacted_value | string | The redacted value of the API key |
Project API keys listed successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the API key |
created_at | integer (unixtime) | The Unix timestamp (in seconds) of when the API key was created |
last_used_at | integer (unixtime) | The Unix timestamp (in seconds) of when the API key was last used. |
object | string | The object type, which is always organization.project.api_key (organization.project.api_key) |
owner | object | |
redacted_value | string | The redacted value of the API key |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project_id, api_key_id | ||
list | select | project_id | limit, after | |
delete | delete | project_id, api_key_id |
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 |
|---|---|---|
api_key_id | string | The ID of the API key. |
project_id | string | The ID of the project. |
after | string | A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. |
limit | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. |
SELECT examples
- get
- list
Project API key retrieved successfully.
SELECT
id,
name,
created_at,
last_used_at,
object,
owner,
redacted_value
FROM openai_admin.projects.api_keys
WHERE project_id = '{{ project_id }}' -- required
AND api_key_id = '{{ api_key_id }}' -- required
;
Project API keys listed successfully.
SELECT
id,
name,
created_at,
last_used_at,
object,
owner,
redacted_value
FROM openai_admin.projects.api_keys
WHERE project_id = '{{ project_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
;
DELETE examples
- delete
No description available.
DELETE FROM openai_admin.projects.api_keys
WHERE project_id = '{{ project_id }}' --required
AND api_key_id = '{{ api_key_id }}' --required
;