> For the complete documentation index, see [llms.txt](https://docs.deltadefi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltadefi.io/start-trading/developers/api-documentation/account/create-new-api-key.md).

# Create new api key

Create a new API key for programmatic access to the DeltaDeFi trading API. API keys provide a more permanent authentication method compared to JWT tokens.

***

## Create new API key

> Create new API key

```json
{"openapi":"3.1.1","info":{"title":"Espresso API Server","version":"1.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/accounts/new-api-key":{"get":{"description":"Create new API key","tags":["accounts"],"summary":"Create new API key","parameters":[{"schema":{"type":"string"},"description":"API Key","name":"X-API-KEY","in":"header","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.CreateNewAPIKeyResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.ErrorJSONWithCodeResponse"}}}}}}}},"components":{"schemas":{"espresso_internal_api_response.CreateNewAPIKeyResponse":{"type":"object","properties":{"api_key":{"type":"string"},"created_at":{"type":"string"}}},"espresso_internal_api_response.ErrorJSONWithCodeResponse":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"string"}}}}}}
```

## Important Notes

{% hint style="warning" %}
**Security Warning:**

* Creating a new API key will invalidate your previous API key.
* Never share your API key or commit it to version control.
  {% endhint %}

{% hint style="info" %}
**Authentication:** You can authenticate this request using:

* Your current API key in the `X-API-KEY` header
  {% endhint %}
