List project API keys
List project API keys: listProjectApiKeys in the TypeScript, Python, Rust and Go clients.
GET /v1/projects/{projectId}/api-keys
Lists the API keys on the selected project, ordered newest first. Revoked keys are not listed; expired keys stay listed until they are revoked. Entries contain key metadata and permissions, never secret values. Use the returned identifiers to manage an existing key; lost secrets cannot be recovered through this operation.
photon.projects.listProjectApiKeys(input: ListProjectApiKeysInput, options?: RequestOptions): Promise<ListProjectApiKeysOutput>photon.projects.list_project_api_keys(input: ListProjectApiKeysInput, *, options: RequestOptions | None = None) -> models.ListProjectApiKeysResponseclient.list_project_api_keys(project_id: String).await -> Result<ResponseValue<types::ListProjectApiKeysResponse>, Error<ListProjectApiKeysError>>client.Projects.ListProjectApiKeys(ctx context.Context, params *ListProjectApiKeysParams, opts ...RequestOption) (*ListProjectApiKeysResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.listProjectApiKeys({
path: {
projectId: "projectId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import ListProjectApiKeysInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.list_project_api_keys(
ListProjectApiKeysInput.model_validate({
"path": {
"projectId": "projectId",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.list_project_api_keys("projectId".to_owned())
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Projects.ListProjectApiKeys(ctx, &photonapi.ListProjectApiKeysParams{
ProjectID: "projectId",
})
if err != nil {
return err
}
_ = result{
"apiKeys": [
{
"apiKeyId": "string",
"createdAt": "2026-01-01T00:00:00.000Z",
"createdByAccountId": "string",
"expiresAt": null,
"name": "string",
"permissions": [
"string"
],
"permissionsUpdatedAt": null,
"projectId": "string",
"revokedAt": null
}
]
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Returns
200 The project's keys that have not been revoked, newest first. Never includes secrets. ListProjectApiKeysResponse
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.
304 Not Modified. Sent only when If-None-Match matches the ETag of an earlier 200 response for the same representation; no body. No body.
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.