Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

List tokens (Cloud-only)

access_tokens.list(AccessTokenListParams**kwargs) -> AccessTokenListResponse
get/v1/client-side-access-tokens

List all client side access tokens for the current account. This is only available for cloud users.

ParametersExpand Collapse
agent_id: Optional[str]

The agent ID to filter tokens by. If provided, only tokens for this agent will be returned.

limit: Optional[float]

The number of tokens to return per page. Defaults to 10.

offset: Optional[float]

The offset for pagination. Defaults to 0.

ReturnsExpand Collapse
class AccessTokenListResponse:
has_next_page: bool
tokens: List[Token]
token: str
expires_at: str
hostname: str
policy: TokenPolicy
data: List[TokenPolicyData]
id: str
access: List[Literal["read_messages", "write_messages", "read_agent", "write_agent"]]
Accepts one of the following:
"read_messages"
"write_messages"
"read_agent"
"write_agent"
type: Literal["agent"]
Accepts one of the following:
"agent"
version: Literal["1"]
Accepts one of the following:
"1"
List tokens (Cloud-only)
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
access_tokens = client.access_tokens.list()
print(access_tokens.has_next_page)
{
  "hasNextPage": true,
  "tokens": [
    {
      "token": "token",
      "expiresAt": "expiresAt",
      "hostname": "hostname",
      "policy": {
        "data": [
          {
            "id": "id",
            "access": [
              "read_messages"
            ],
            "type": "agent"
          }
        ],
        "version": "1"
      }
    }
  ]
}
Returns Examples
{
  "hasNextPage": true,
  "tokens": [
    {
      "token": "token",
      "expiresAt": "expiresAt",
      "hostname": "hostname",
      "policy": {
        "data": [
          {
            "id": "id",
            "access": [
              "read_messages"
            ],
            "type": "agent"
          }
        ],
        "version": "1"
      }
    }
  ]
}