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

# Authentication

> How to authenticate in order to call the Taxwire API

## API keys management

To use the Taxwire API you need an API key. Assuming you have an account set up, login and generate an API key from the [developer page](https://app.taxwire.com/developer).

<Accordion title="Step by step instructions">
  If you don't already have a key created, make a new one [here](https://app.taxwire.com/developer):

  <img src="https://mintcdn.com/taxwire/kIqs87W6QVd_NiC-/images/authentication/create_key.png?fit=max&auto=format&n=kIqs87W6QVd_NiC-&q=85&s=fedafc82771eca1a100d9e2c8324b2a6" alt="create a key" width="1191" height="829" data-path="images/authentication/create_key.png" />

  Name the key

  <img src="https://mintcdn.com/taxwire/kIqs87W6QVd_NiC-/images/authentication/name_key.png?fit=max&auto=format&n=kIqs87W6QVd_NiC-&q=85&s=cb714f359a94f69dd9367d295a049022" alt="name a key" width="1192" height="864" data-path="images/authentication/name_key.png" />

  Make sure you copy the key and save it into a secure store (1Password, etc.). Once the popup is closed you cannot see the key in clear again.

  <img src="https://mintcdn.com/taxwire/kIqs87W6QVd_NiC-/images/authentication/copy_key.png?fit=max&auto=format&n=kIqs87W6QVd_NiC-&q=85&s=cdf97e7054e3b3282b66218e6bd98aa9" alt="copy a key" width="1187" height="866" data-path="images/authentication/copy_key.png" />

  You can now see all active keys

  <img src="https://mintcdn.com/taxwire/kIqs87W6QVd_NiC-/images/authentication/enjoy.png?fit=max&auto=format&n=kIqs87W6QVd_NiC-&q=85&s=45228d6ea4fb07a7106c63fcc1bc69ef" alt="see a key" width="1432" height="500" data-path="images/authentication/enjoy.png" />
</Accordion>

## Request Authentication

All API endpoints are authenticated using an API key header. Copy the secret key you saved when creating your API key and pass it as a http header to all requests to the API.

Example code with appropriate auth header (`X-API-Key`):

<CodeGroup>
  ```shell cURL theme={null}
  curl --request POST \
    --url https://api.taxwire.com/calculations \
    --header 'Content-Type: application/json' \
    --header 'Taxwire-Version: hydrogen.2025-04-15' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --data '{....SOME BEAUTIFUL JSON....}'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.taxwire.com/calculations"
  headers = {
      "Taxwire-Version": "hydrogen.2025-04-15",
      "Content-Type": "application/json",
      "X-API-Key": "YOUR_API_KEY"
  }
  payload = {
      # ... MORE BEAUTIFUL JSON ...
  }
  response = requests.request("POST", url, json=payload, headers=headers)
  response.json()
  ```

  ```javascript JavaScript theme={null}
  const options = {
    method: 'POST',
    headers: {
      'Taxwire-Version': 'hydrogen.2025-04-15',
      'Content-Type': 'application/json',
      'X-API-Key': 'YOUR_API_KEY'
    },
    body: '{ ...GREAT JSON... }'
  };

  fetch('https://api.taxwire.com/calculations', options)
    .then(response => response.json())
    .then(response => console.log(response))
    .catch(err => console.error(err));
  ```
</CodeGroup>
