List API Tokens

List API Tokens

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

Copy

from mira_network import MiraClient

async def list_tokens():
    async with MiraClient(api_key="your-api-key") as client:
        # List all tokens
        tokens = await client.list_api_tokens()
        
        # Display token information
        for token in tokens:
            print(f"Token: {token['description']}")

arrow-up-rightResponse Structure

Copy

[
    {
        "token": "mira_tk_xxxx...",
        "description": "Production API Key",
        "created_at": "2024-01-01T00:00:00Z"
    },
    // ... other tokens
]

  • Regular audit of active tokens recommended

  • Check creation dates for token rotation

  • Review token descriptions for accuracy

  • Monitor token usage metrics in Mira Consolearrow-up-right

  • API keys follow the format sk-mira-****

arrow-up-rightUsage Metrics

View detailed usage metrics for each token in the Mira Console:

  • Request volume over time

  • Model usage distribution

  • Cost analysis charts

  • Usage patterns visualization

Access these metrics by visiting the API Keys Dashboardarrow-up-right in your Mira Console.

Last updated