> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI specification

> Download the spec, generate type-safe clients, and stay in sync with API changes

Akua publishes an [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0) specification that describes every endpoint, parameter, and response shape in this documentation. Use it to generate type-safe clients in any language, validate requests in your tests, and keep your integrations in lockstep with the API.

## Where to get the spec

The public OpenAPI document is served at:

**[`https://api.akua.dev/openapi.json`](https://api.akua.dev/openapi.json)**

Use that URL for downloads and codegen. It reflects the deployed public API. The same document is published with these docs at [`https://docs.akua.dev/openapi-public.json`](https://docs.akua.dev/openapi-public.json); vendor that file when a build must pin to a stable input instead of fetching the live document.

## Generate a client

Most languages have mature OpenAPI codegen tooling. Pick whichever fits your stack:

### TypeScript and JavaScript

[`openapi-typescript`](https://github.com/openapi-ts/openapi-typescript) generates a single `.d.ts` file with no runtime dependencies. Pair it with [`openapi-fetch`](https://github.com/openapi-ts/openapi-typescript) for a type-safe `fetch` wrapper.

```bash
# Install a reviewed exact version, then generate types without network fallback
bun add --dev --exact openapi-typescript@7.13.0
bun node_modules/openapi-typescript/bin/cli.js https://api.akua.dev/openapi.json -o src/akua-api.d.ts
```

```ts
import createClient from 'openapi-fetch';
import type { paths } from './akua-api';

const client = createClient<paths>({
	baseUrl: 'https://api.akua.dev/v1',
	headers: {
		Authorization: `Bearer ${process.env.AKUA_API_TOKEN}`,
		// Optional: omit when using a workspace API token (workspace is implied).
		// Set only for broad credentials to select the target workspace.
		'Akua-Context': process.env.AKUA_WORKSPACE_ID
	}
});

const { data, error } = await client.GET('/installs/{id}', {
	params: { path: { id: 'INSTALL_ID' } }
});
```

### Go

[`oapi-codegen`](https://github.com/oapi-codegen/oapi-codegen) generates a strongly typed Go client.

```bash
# Generate a client package
go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen \
	-package akua \
	-generate types,client \
	-o akua/client.gen.go \
	https://api.akua.dev/openapi.json
```

### Python

[`openapi-python-client`](https://github.com/openapi-generators/openapi-python-client) emits a Pydantic-typed package.

```bash
uvx openapi-python-client generate --url https://api.akua.dev/openapi.json
```

### Other languages

The [OpenAPI Generator](https://openapi-generator.tech/docs/generators) project ships generators for 50+ languages, including Java, C#, Rust, PHP, and Ruby. The Akua spec is plain OpenAPI 3.1, so any compliant generator works.

## Stay in sync

Fetch the live document and cache it briefly so new endpoints become available as soon as they ship:

```bash
curl -fsS https://api.akua.dev/openapi.json -o ./vendor/akua-openapi.json
```

## Related topics

> [card] [Introduction](https://docs.akua.dev/apis/introduction.md)
>
> API base URL, conventions, and error envelope.

> [card] [Authentication](https://docs.akua.dev/apis/authentication.md)
>
> Session credentials and personal API tokens.

> [card] [CLI](https://docs.akua.dev/cli.md)
>
> Discover and run commands generated from this contract.
