# Rest API

[![PyPI - Version](https://img.shields.io/pypi/v/kiln-server.svg?logo=pypi\&label=PyPI\&logoColor=gold)](https://pypi.org/project/kiln-server/) [![Docs](https://img.shields.io/badge/docs-OpenAPI-blue)](https://kiln-ai.github.io/Kiln/kiln_server_openapi_docs/index.html)

We also offer an open-source self-hostable REST API (web API) for Kiln, based on [FastAPI](https://fastapi.tiangolo.com).

To install the Kiln rest API, run the following command:

```bash
pip install kiln_server
```

### Docs

The [REST API docs](https://kiln-ai.github.io/Kiln/kiln_server_openapi_docs/index.html) explain the endpoints, parameters, response format, and errors.

### Client Side Libraries

The REST API supports OpenAPI, which means you can generate typed client libraries for almost any language using code generators:

* [OpenAPI Generator List](https://openapi-generator.tech/docs/generators/)
* [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)


---

# Agent Instructions: 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:

```
GET https://docs.kiln.tech/developers/rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
