> For the complete documentation index, see [llms.txt](https://docs.underdogprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.underdogprotocol.com/guides/authentication.md).

# Authentication

Underdog uses OAuth2 with a token to authenticate API requests.&#x20;

## OAuth2 with bearer token

The recommended way to authenticate with the Underdog API is by using OAuth2. When establishing a connection using OAuth2, you will need your access token — you will find it on the home page of the [Underdog dashboard](https://app.underdogprotocol.com) or in the [developer settings](https://app.underdogprotocol.com/developers?network=MAINNET). Here's how to add the token to the request header using cURL:

#### Example request with bearer token

```bash
curl https://api.underdogprotocol.com/v1/collections \
  -H "Authorization: Bearer {token}"
```

Always keep your token safe and reset it if you suspect it has been compromised.

## Network Access

API keys can be configured to give access to the Mainnet API, Devnet API, or both. This setting can be configured in the dashboard.&#x20;


---

# 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.underdogprotocol.com/guides/authentication.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.
