List project API keys

GEThttps:/api.openai.com/v1/organization/projects/{project_id}/api_keys

Returns a list of API keys in the project.

Path parameters

  • project_id
    string
    Required
    The ID of the project.

Query parameters

  • limit
    integer
    Defaults: 20
    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
  • 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.

Response

A list of ProjectApiKey objects.

Example request
1
curl https://api.openai.com/v1/organization/projects/proj_abc/api_keys?after=key_abc&limit=20 \
2
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
3
-H "Content-Type: application/json"
Example response
1
{
2
"object": "list",
3
"data": [
4
{
5
"object": "organization.project.api_key",
6
"redacted_value": "sk-abc...def",
7
"name": "My API Key",
8
"created_at": 1711471533,
9
"last_used_at": 1711471534,
10
"id": "key_abc",
11
"owner": {
12
"type": "user",
13
"user": {
14
"object": "organization.project.user",
15
"id": "user_abc",
16
"name": "First Last",
17
"email": "user@example.com",
18
"role": "owner",
19
"added_at": 1711471533
20
}
21
}
22
}
23
],
24
"first_id": "key_abc",
25
"last_id": "key_xyz",
26
"has_more": false
27
}
Built with