Skip to content
Hayonix

API reference · Account

The credential making the request, with its org, project and permissions

GET/v1/caller
API keyProject
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

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.
X-Project-Idsession onlyThe project to act in, for console sessions. Requests with an API key leave it out.

Response

200 Caller — The caller

  • objectstringrequired

    Always `caller`: the type of this object

    One ofcaller

  • credentialstringrequired

    How the request authenticated: a project API key or a console session

    One ofapi_keysession

  • org_idstringrequired

    Organization it belongs to

    ID with prefix org_

  • project_idstringrequired

    Project it belongs to

    ID with prefix prj_

  • api_key_idstring | nullrequired

    The API key that made the request; null for a session

    ID with prefix key_

  • user_idstring | nullrequired

    The signed-in user; null for an API key

    ID with prefix usr_

  • permissionsarray of stringrequired

    Actions (`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
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:

Errors
StatusTypeWhen
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.