> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mira.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating an API Token

> Create Mira Network API tokens with create_api_token() and an ApiTokenRequest. Tokens start with sk-mira- and authenticate your requests.

## Create API Token

Generate new API tokens for authentication using the `create_api_token()` method.

### Example

`create_api_token()` takes an `ApiTokenRequest` (not a plain dict):

```python theme={null}
from mira_network import MiraClient, ApiTokenRequest

async def create_token():
    async with MiraClient(api_key="your-api-key") as client:
        new_token = await client.create_api_token(
            ApiTokenRequest(description="Production API Key")
        )
        print(f"New token created: {new_token}")
```

### Response Structure

```python theme={null}
{
    "id": "7b89fb91-ce54-49d5-b177-68f29cf670fa",  # token id
    "token": "sk-mira-xxxx...",                      # the API key (starts with sk-mira-)
    "description": "Production API Key",
    "meta_data": {},
    "created_at": "2026-01-01T00:00:00.000Z"
}
```

<Warning>
  The full `token` value is only returned here, at creation time. Copy and store it securely — you can't retrieve it again later.
</Warning>

### Usage Notes

* The full token is shown only at creation — store it securely.
* Use a clear `description` so you can identify the token later.
* Manage tokens in the [Mira Console](https://console.mira.network/api-keys).
