# REST API

### Authentication

All API requests must include an authorization header with a Bearer token.

```
Authorization: Bearer YOUR_API_KEY
```

### Mainnet URL

```url
https://api.hydromancer.xyz
```

### Testnet URL

{% hint style="warning" %}
Everything is the same except when its described in the docs of the specific endpoint
{% endhint %}

```url
https://api-testnet.hydromancer.xyz
```

### Base Endpoint

```
POST /info
```

All requests use the same endpoint with different `type` values to specify the operation.<br>

### Error responses

<details>

<summary>Error responses</summary>

400 Bad Request

```
{
  "error": "Invalid Ethereum address: 0xinvalid"
}
```

401 Unauthorized

```
{
  "error": "Invalid API key"
}
```

502 Bad Gateway

```
{
  "error": "Timeout error"
}
```

500 Internal Server Error

```
{
  "error": "An internal error occurred"
}
```

</details>


---

# 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.hydromancer.xyz/readme/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.
