> For the complete documentation index, see [llms.txt](https://docs.akkio.com/akkio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akkio.com/akkio-docs/concepts/code-generation.md).

# Code Generation

We provide an OpenAPI Spec that represents a formal specification of our API Interface. A powerful side effect of OpenAPI is that you can perform code generation to generate your own (often strongly-typed) library to work with it.

We'll show you how to do it with TypeScript here, but solutions exist for most languages out there. OpenAPI is very well support across most languages - see [here](https://openapi-generator.tech/) for a starting point for virtually every language.

### JavaScript / TypeScript Example[​](https://api-docs.akkio.com/concepts/code-generation#javascript--typescript-example)

[openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen) is a popular solution for generating a TypeScript client in order to interface with our API in a programmatic, type-safe way.

First, install the library into your project as a dev dependency.

```
npm install -D openapi-typescript-codegen
```

Then, add a script to your `package.json` `scripts` tag that will perform code generation from our specification.

```javascript
{
  "scripts": {
    "generate:akkio": "openapi --input https://api.akkio.com/api/v1/api.yaml --output generated/"
  }
}
```

When run with `npm run generate:akkio`, this will generate a strongly typed client through which you can easily make type-safe queries.<br>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akkio.com/akkio-docs/concepts/code-generation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
