> For the complete documentation index, see [llms.txt](https://docs.moderncollections.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moderncollections.io/sdks/codegen.md).

# Codegen

A machine-readable OpenAPI 3.1 spec for the **external REST API** (the creditor-API-key surface) now ships with these docs: [`api-reference/rest-api/openapi.yaml`](https://github.com/knollmeyersam-dot/MC-Docs/blob/main/api-reference/rest-api/openapi.yaml).

It is generated directly from the live application schema, so request/response shapes are field-accurate by construction — 62 paths / 71 operations, with the per-environment `servers` list and the Bearer (`ca_*`) security scheme attached. It covers the external integration surface only: placements, analytics, payments, intake, documents, exports, statements, agreements, creditor onboarding/settings, and the QuickBooks integration.

Feed it to your generator of choice:

```bash
openapi-generator-cli generate -i api-reference/rest-api/openapi.yaml -g typescript-fetch -o ./mc-client
# or
oapi-codegen -package mc api-reference/rest-api/openapi.yaml > client.go
```

{% hint style="info" %}
Always generate from the shipped `openapi.yaml` — it is curated and pruned to the supported external contract. The server's raw `/openapi.json` is not curated for codegen and is not a supported integration surface.
{% endhint %}

Regenerate your client whenever the spec version changes; the spec is regenerated whenever the API changes.

## See also

* [Python SDK](/sdks/python.md)
* [JavaScript SDK](/sdks/javascript.md)
* [REST API overview](/rest-api/overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.moderncollections.io/sdks/codegen.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
