# Generating API clients

> Generate a client for the Botyard REST API from the public OpenAPI 3.1 document at api.botyard.io/openapi.json, which always matches the running API.

Canonical URL: https://docs.botyard.io/docs/api/generating-clients

Botyard publishes an OpenAPI 3.1 document describing every endpoint you can call. Point
your generator of choice at it:

```
https://api.botyard.io/openapi.json
```

The document is public — no API key is needed to fetch it — and it always matches the
running API, so there is no version to pin or file to re-download after a release.

The same document backs the [interactive API console](/api-docs), where you can try an
endpoint in the browser before generating anything.

## Example

Using [`openapi-generator`](https://openapi-generator.tech):

```bash
openapi-generator generate \
  -i https://api.botyard.io/openapi.json \
  -g python \
  -o ./botyard-client
```

Or [`openapi-typescript`](https://openapi-ts.dev):

```bash
npx openapi-typescript https://api.botyard.io/openapi.json -o botyard-schema.d.ts
```

The spec declares `https://api.botyard.io` as its server and bearer authentication at the
document level, so generated clients are configured for production and will expect an API
key. See [Authentication](/docs/api/authentication) for how to create one.

## What the spec contains

The published document describes the **customer-callable** surface only. Platform-admin
operations, internal service-to-service routes, and webhook receivers are excluded — they
are not reachable with an API key, so generating client methods for them would only
produce code you cannot call.

> [!NOTE]
> If you previously generated against a spec that contained `/v1/admin/...` operations, you
> were reading an unfiltered document. Regenerate from the URL above; the resulting client
> will be smaller and will not include endpoints your key cannot reach.

## Reporting a problem

Client generators occasionally emit code that does not compile for constructs our spec uses
legitimately. If that happens, tell us which generator and version you used along with the
operation it failed on — a spec that is technically valid but awkward to consume is still
something we want to know about.
