> 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 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.akkio.com/akkio-docs/concepts/code-generation.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.
