API reference
List the API catalogue
GET /api/pub/v1/reference, every package and API Dhanu exposes, with a flag for what the calling key is allowed to use.
https://api.dhanu.ai/api/pub/v1/referenceReturns the whole API catalogue, packages, the APIs inside each, and whether the key you called with is allowed to use them. It is how you discover the API straight over HTTP, without installing the Node or Python package first.
It is free: no model runs, no credits are spent, and it is not metered against a project.
Request
No body and no parameters, only the bearer key.
curl https://api.dhanu.ai/api/pub/v1/reference \
-H "Authorization: Bearer $DHANU_API_KEY"
Response
200 OK
{
"scope": {
"level": "package",
"packages": ["images"],
"operations": ["images.generate"]
},
"packages": [
{
"id": "text",
"title": "Text",
"description": "Language model completions.",
"operations": [
{
"id": "text.generate",
"method": "POST",
"path": "/text",
"title": "Generate text",
"description": "Generate a completion from a prompt.",
"billed": true,
"allowed": false
}
]
},
{
"id": "images",
"title": "Images",
"description": "Image generation.",
"operations": [
{
"id": "images.generate",
"method": "POST",
"path": "/images",
"title": "Generate an image",
"description": "Generate an image from a prompt and return it as base64.",
"billed": true,
"allowed": true
}
]
}
]
}
scope describes the key you called with. packages is the full catalogue
regardless of scope, so you can see what exists and what you would need to widen
the key to reach.
| Field | Meaning |
|---|---|
path | Append it to https://api.dhanu.ai/api/pub/v1 to get the full URL |
billed | Whether calling it spends workspace credits |
allowed | Whether this key’s scope covers it |
Calling an API where allowed is false fails with api_key_operation_scope
(403) before anything runs. Widen the key’s scope in Developers → API keys, or
use a broader key.
Errors
Any live key can call this endpoint at any scope level, so the only failures are authentication ones.
| Code | Status | Meaning |
|---|---|---|
invalid_api_key | 401 | The bearer key is missing or unknown. |
api_key_revoked | 401 | The key was revoked. |
api_key_expired | 401 | The key passed its expiry date. |
api_key_ip_not_allowed | 403 | The caller's IP is outside the key's allowlist. |
developer_access_revoked | 403 | The key's creator lost developer access in the workspace. |
api_key_project_scope | 403 | The key covers no active projects, or projectId is outside its scope. |
The full list is on Errors.