# Overview

## API Access

This section provides guidance on utilizing the Cosmo API. Be advised that in order to access the API, it is necessary to purchase the API Addon from BuiltByBit and follow the instructions for its integration into Cosmo.

## 3rd Party Addons

Developers are welcome to create resources as add-ons for Cosmo that utilize the API. Be sure to make it clear that the resource is a **Cosmo Addon** and requires the **API Addon** to function.

Please refer to [this](https://cosmo.atomatrix.gg/addons/creating-an-addon) page to view more information on creating an addon.

## User API

By default, any user can create an API Key and use the User API. If you'd like to restrict API usage to a certain role (specific level, donators, etc.). You can restrict the API command permissions to those roles by going to Server Settings -> Integrations in your Discord Server and clicking on your bot.

Just be aware that once a user creates an API Key, restricting their access to the command will not revoke their API Key. So it's recommended to give access to a permanent role rather than Server Boosters, Patreon Supporters, etc.

## Endpoints

View all the endpoints available in the Cosmo API on the dedicated page:

{% content-ref url="endpoints" %}
[endpoints](https://cosmo.atomatrix.gg/api/endpoints)
{% endcontent-ref %}

## Errors

When any response other than **200** or **201** is returned. The error is described in the message under the **error** key. Example:

```json
{"error": "This is a description of the error you just received"}
```


---

# 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://cosmo.atomatrix.gg/api/overview.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.
