> For the complete documentation index, see [llms.txt](https://token-terminal.gitbook.io/token-terminal-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://token-terminal.gitbook.io/token-terminal-api/master.md).

# Introduction

## API Reference

The Token Terminal API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). The API has predictable resource-oriented URLs, uses standard HTTP response codes, authentication and verbs. Instead of using [JSON-encoded](https://www.json.org/json-en.html) responses, the API utilizes the [JSON Lines](https://jsonlines.org/) text format.

You can use the Token Terminal API with an API key which you use to authenticate the request. Send and email to <aleksis@tokenterminal.xyz> to get your API key.

### Why JSON Lines?

The existing JSON format doesn't support streaming properly as it's a non-concatenative protocol that doesn't allow the concatenation of two JSON objects. The use of [JSON streaming](https://en.wikipedia.org/wiki/JSON_streaming) fixes this by delimiting each consecutive JSON object with a newline. This makes JSON Lines especially attractive for consuming large files with unix-style text processing tools and shell pipelines.

### Authentication

The Token Terminal uses API keys to authenticate requests. Currently you will have to contact us at <aleksis@tokenterminal.xyz> to get your API key.

Your API key should be kept a secret, so make sure to not share it or store it in publicly accessible areas such as GitHub, client-side code, and so forth.

Authentication to the API is performed via [HTTP Token Auth](https://auth0.com/docs/tokens/access-tokens). Provide your API key as the token auth value by using the [Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) header: \
`-H "Authorization: Token 7i6b5732db4fb26fc5be158c17c75c42f1296345"`

All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). Calls made over plain HTTP will fail. API requests without authentication will also fail.
