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

# VastAI.set_api_key

Set a new API key.

## Signature

```python theme={null}
VastAI.set_api_key(new_api_key: str) -> str
```

## Parameters

<ParamField path="new_api_key" type="str" required>
  new\_api\_key
</ParamField>

## Returns

`str`, Result from the API call.

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.set_api_key(new_api_key="...")
print(result)
```
