Skip to main content

List API Tokens

View all active API tokens using the list_api_tokens() method.

Example

from mira_network import MiraClient

async def list_tokens():
    async with MiraClient(api_key="your-api-key") as client:
        result = await client.list_api_tokens()

        # Tokens are under "items"
        for token in result["items"]:
            print(f"{token['description']}: {token['token']}")

Response Structure

list_api_tokens() returns a paginated object; the tokens are in items:
{
    "items": [
        {
            "id": "43dbd302-0a07-428d-b7c3-fd2f7aa170bb",
            "token": "sk-mira-xxxx...",
            "description": "Production API Key",
            "meta_data": {},
            "created_at": "2026-01-01T00:00:00.000Z"
        }
        # ... other tokens
    ],
    "total": 1,
    "page": 1,
    "page_size": 10,
    "total_pages": 1
}
The response only includes token metadata — the full token value is returned once, at creation.

Usage Notes

  • Audit active tokens periodically and delete any you no longer use.
  • The id identifies a token; the token field is the key itself (sk-mira-...).
  • View per-token usage and analytics in the Mira Console.