Skip to content
dhanu docs
Browse pages

API reference

List projects

GET /api/pub/v1/projects, the projects this key can act in.

GEThttps://api.dhanu.ai/api/pub/v1/projects

The projects this key is scoped to, the same list GET /me returns, on its own for clients that only need it. Pass a project’s id as projectId on generation calls when the key spans more than one.

curl https://api.dhanu.ai/api/pub/v1/projects \
  -H "Authorization: Bearer $DHANU_API_KEY"
const projects = await dhanu.projects.list();
projects = dhanu.projects.list()

Errors

CodeStatusMeaning
invalid_api_key401The bearer key is missing or unknown.
api_key_revoked401The key was revoked.
api_key_expired401The key passed its expiry date.
api_key_ip_not_allowed403The caller's IP is outside the key's allowlist.
developer_access_revoked403The key's creator lost developer access in the workspace.
api_key_project_scope403The key covers no active projects, or projectId is outside its scope.