> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.taigabilling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.taigabilling.com/_mcp/server.

# Authentication

The Partner API authenticates with **API keys**. You create an API key in the Taiga developer portal and send it as a Bearer token on every request. There is no token-exchange step.

```mermaid
sequenceDiagram
  autonumber
  participant You as Your service
  participant Portal as Developer portal
  participant API as Taiga Partner API
  You->>Portal: Create API key
  Portal-->>You: API key (shown once)
  You->>API: Authorization: Bearer API key
  API-->>You: Scoped response
```

## Create an API key

#### Open the developer portal

Go to `https://app.taigabilling.com/developers`.

#### Add a key

Select **Add API key**, name it, and copy the generated key.

#### Store it

Store the key in your secret manager.

> **The API key is shown once.**
>
> Taiga cannot show the key again after creation. If it is lost or exposed, revoke it from the developer portal and create a new one. Revocation takes effect immediately.

API keys are scoped to your Taiga organization. Every request made with a key is limited to that organization's configured billing-provider NPIs. You do not pass an organization override in API requests.

## Use the API key

Include the key in the `Authorization` header on every request:

#### cURL

```bash
curl "https://api.taigabilling.com/api/encounters/v4?limit=10" \
  -H "Authorization: Bearer $TAIGA_API_KEY"
```

#### TypeScript

```ts
const res = await fetch(
  "https://api.taigabilling.com/api/encounters/v4?limit=10",
  {
    method: "GET",
    headers: {
      Authorization: `Bearer ${process.env.TAIGA_API_KEY}`,
    },
  }
);
```

## Authentication failures

Authentication fails closed. A request can fail if:

| Failure                            | Action                             |
| ---------------------------------- | ---------------------------------- |
| API key is missing or malformed    | Send a valid key as a Bearer token |
| API key has been revoked           | Create a new key                   |
| API key has expired                | Create a new key                   |
| Organization lost developer access | Contact Taiga support              |

> **Never log API keys.**
>
> Store API keys in a secret manager and rotate them if exposed. Audit logs only reference key IDs, never the key value itself.