API reference · Account
The credential making the request, with its org, project and permissions
/v1/caller- TypeScript
client.account.getCaller()- Python
client.account.get_caller()- CLI
hayonix login
Answers for any project credential. Clients use it to learn the org an API key belongs to, which org-level routes take in their path.
Project API key (Authorization: Bearer sk_…), or a console session.
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS "$API_BASE_URL/caller" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Response
200 Caller — The caller
objectstringrequiredAlways `caller`: the type of this object
One of
callercredentialstringrequiredHow the request authenticated: a project API key or a console session
One of
api_keysessionorg_idstringrequiredOrganization it belongs to
ID with prefix org_
project_idstringrequiredProject it belongs to
ID with prefix prj_
api_key_idstring | nullrequiredThe API key that made the request; null for a session
ID with prefix key_
user_idstring | nullrequiredThe signed-in user; null for an API key
ID with prefix usr_
permissionsarray of stringrequiredActions (`resource:verb`) the credential may perform in this project: the key’s scopes, or the role’s permissions for a session. The server authorises every request regardless.
Example response
{
"object": "caller",
"credential": "api_key",
"org_id": "org_01jc5zq4m8k3v6x9t2w7r0b1e4",
"project_id": "prj_01jc5zq4m8k3v6x9t2w7r0b1e4",
"api_key_id": "key_01jc5zq4m8k3v6x9t2w7r0b1e4",
"user_id": "usr_01jc5zq4m8k3v6x9t2w7r0b1e4",
"permissions": [
"pod:read",
"inference:invoke"
]
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |