Get an API key
Read an inference key’s settings, spending and remaining allowance by its hash.
Last updated on
GET /v1/keys/{hash}
Read one inference key by its hash, including current limits and spending.
Authentication
Authorization: Bearer <MANAGEMENT_API_KEY>: a management key bound to the workspace. The key owner must retain the live permission apiKeys.read.
The credential determines the workspace. X-Org-Id is unsupported.
Path parameters
| Field | Type | Description |
|---|---|---|
hash | string · required | SHA-256 digest from data.hash on creation or listing. Not the secret or internal key ID. |
Response · 200
| Field | Type | Description |
|---|---|---|
data | object | Key object. |
Each key includes the current-key fields plus:
| Field | Type | Description |
|---|---|---|
hash | string | SHA-256 locator used in the path. |
name | string | Key name. |
disabled | boolean | Whether new inference requests are blocked. |
created_at | string (date-time) | Creation timestamp. |
updated_at, last_used_at | string | null | ISO timestamps or null when unavailable. |
With multiple limits, limit, limit_reset and limit_remaining are null; read spend_limits. is_management_key is always false.
Response example
Identifiers and amounts in these examples are illustrative.
Request example
Load the key into a server environment variable. TypeScript uses Node.js fetch; Python uses only the standard library.
Replace the example hash with your key’s data.hash.
const response = await fetch("https://api.provod.ai/v1/keys/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.MANAGEMENT_API_KEY}`,
},
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
console.log(await response.json());Errors
| HTTP | Error | Cause |
|---|---|---|
401 | Unauthorized | Missing, invalid, disabled, revoked or expired key. The X-Org-Id header is also rejected. |
403 | Forbidden | Wrong key kind or insufficient workspace access. |
404 | Not Found | Key not found, revoked or outside the workspace. |
Authentication error example:
{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key",
"metadata": {}
}
}Operation error example:
{
"message": "API key not found",
"error": "Not Found",
"statusCode": 404
}