> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nolano.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete reference for the Nolano time series forecasting API

## Welcome to Nolano API Platform

The Nolano API delivers enterprise-grade Time Series Foundation Models for forecasting and anomaly detection, with secure authentication, robust key management, and AWS-powered reliability, security, and scalability.

<CardGroup cols={2}>
  <Card title="Base URL" icon="globe" href="https://api.nolano.ai">
    `https://api.nolano.ai`
  </Card>

  <Card title="Supported Models" icon="chart-line" href="/models">
    4+ Time Series Foundation Models
  </Card>
</CardGroup>

## Quick Start

Get up and running with the Nolano API in under 5 minutes:

<Steps>
  <Step title="Get Your API Key">
    Sign up at [app.nolano.ai](https://app.nolano.ai) and generate your API key from the dashboard.
  </Step>

  <Step title="Test Authentication">
    Verify your API key is working:

    ```bash theme={null}
    curl -H "Authorization: Bearer your_api_key_here" https://api.nolano.ai/verify
    ```
  </Step>

  <Step title="Make Your First Forecast">
    Use the `/forecast` endpoint to predict future values:

    ```bash theme={null}
    curl -X POST https://api.nolano.ai/forecast \
      -H "Authorization: Bearer your_api_key_here" \
      -H "Content-Type: application/json" \
      -d '{"series":[{"timestamps":["2023-01-01T00:00:00","2023-01-02T00:00:00"],"values":[100,102]}],"forecast_horizon":5,"data_frequency":"Daily","forecast_frequency":"Daily"}'
    ```
  </Step>
</Steps>

## Authentication

All API endpoints require authentication using API keys in the `Authorization` header.

### API Key Format

```
Authorization: Bearer ak_[64_character_hex_string]
```

<Note>
  API keys always start with `ak_` followed by a 64-character hexadecimal string.
</Note>

### Verify Authentication

Test your API key with the verification endpoint:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.nolano.ai/verify" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.nolano.ai/verify",
      headers={
          "Authorization": "Bearer your_api_key_here",
          "Content-Type": "application/json"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.nolano.ai/verify', {
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    }
  });
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

**Success Response:**

```json theme={null}
{
  "success": true,
  "message": "API key is valid and working correctly",
  "timestamp": "2025-01-17T00:20:24.435Z",
  "apiKey": {
    "permissions": ["read"]
  },
  "rateLimit": {
    "limit": "1000",
    "remaining": "999",
    "resetTime": "1755044460000"
  }
}
```

## Rate Limits

API requests are limited based on your API key's permission level:

| Permission Level | Requests/Min | Requests/Hour | Requests/Day |
| ---------------- | ------------ | ------------- | ------------ |
| **Read Only**    | 50           | 500           | 10,000       |
| **Read/Write**   | 100          | 1,000         | 50,000       |
| **Admin**        | 200          | 2,000         | 100,000      |
| **Full Access**  | 500          | 5,000         | 250,000      |

### Rate Limit Headers

Every API response includes rate limit information:

```http theme={null}
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1755044460
```

### Handling Rate Limits

When you exceed your rate limit, you'll receive a `429 Too Many Requests` response:

```json theme={null}
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "API rate limit exceeded",
    "details": {
      "limit": 1000,
      "reset_time": "2025-01-17T01:00:00Z"
    }
  }
}
```

<Tip>
  Implement exponential backoff when handling rate limit errors to avoid repeated failures.
</Tip>

## API Key Security

* **Secure Storage**: API keys are hashed using SHA-256 before storage
* **Usage Tracking**: All API calls are logged with usage statistics
* **Instant Revocation**: Immediately revoke compromised keys through the dashboard
* **Environment Variables**: Store keys in environment variables, never in source code

<Warning>
  Never expose API keys in client-side code or public repositories. Keys should only be used in secure server-side environments.
</Warning>

## Contact Us

<Card title="Need Support?" icon="envelope" color="#935095">
  Have questions about the API or need technical assistance? Our team is here to help!

  **Email:** [hello@nolano.ai](mailto:hello@nolano.ai)

  We typically respond within 24 hours during business days.
</Card>
