> 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.

# Generate an SDK

The Taiga Partner API is published as an **OpenAPI 3.0.1** document. Drop it into your favorite generator to produce typed clients in any language.

Download it:

```bash
curl https://api.taigabilling.com/openapi.json -o taiga-openapi.json
```

## Compatible generators

#### openapi-typescript

Lightweight TypeScript types only

#### OpenAPI Generator

Full clients in many languages

#### Stainless

Polished, idiomatic SDKs

#### Fern

SDK + docs generation

#### Speakeasy

SDK + docs generation

#### Your generator

Anything that speaks OpenAPI 3.0.1

## Generate a client

Point your generator at the local `taiga-openapi.json` file you downloaded above.

#### TypeScript types

```bash
npx openapi-typescript ./taiga-openapi.json \
  -o ./src/taiga-api.ts
```

#### TypeScript client

```bash
npx @openapitools/openapi-generator-cli generate \
  -i ./taiga-openapi.json \
  -g typescript-fetch \
  -o ./generated/taiga
```

#### Python

```bash
pip install openapi-python-client
openapi-python-client generate \
  --path ./taiga-openapi.json
```

#### Go

```bash
npx @openapitools/openapi-generator-cli generate \
  -i ./taiga-openapi.json \
  -g go \
  -o ./generated/taiga-go
```

## TypeScript example

Use the generated types with your HTTP client:

**`taiga.ts`**

```ts title="taiga.ts"
import type { paths } from "./taiga-api";

type EncounterList =
  paths["/api/encounters/v4"]["get"]["responses"]["200"]["content"]["application/json"];
```

## Full client example

**`client.ts`**

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

const encounters = await res.json();
```

Pass your API key to your generated client's auth configuration as a Bearer token.

## When to regenerate

#### New API version

Taiga publishes a new API version.

#### New endpoint

You start using a new endpoint.

#### CI signal

Your build detects an OpenAPI change.

> **Keep generated code separate.**
>
> Keep generated client code in its own folder, separate from handwritten integration code. That makes spec updates easier to review.