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:
        # List all tokens
        tokens = await client.list_api_tokens()
        
        # Display token information
        for token in tokens:
            print(f"Token: {token['description']}")

Response Structure

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

Usage Notes

  • Regular audit of active tokens recommended
  • Check creation dates for token rotation
  • Review token descriptions for accuracy
  • Monitor token usage metrics in Mira Console
  • API keys follow the format sk-mira-****

Usage 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 Dashboard in your Mira Console.