> ## Documentation Index
> Fetch the complete documentation index at: https://student-213fb9fc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How to authenticate with the AJ STUDIOZ Cloud Infra API

## API Keys

All requests to AJ STUDIOZ Cloud Infra require an API key. You can create and manage API keys in the [console](https://cloud.ajstudioz.com/api-keys).

<Warning>
  Never expose your API key in client-side code or public repositories. Store it as an environment variable.
</Warning>

***

## Passing the API Key

Include your API key in the `Authorization` header as a Bearer token:

```
Authorization: Bearer YOUR_API_KEY
```

### Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.ajstudioz.co.in/api/tags \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  from ollama import Client

  client = Client(
      host="https://api.ajstudioz.co.in",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  )
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai";

  const openai = new OpenAI({
    baseURL: "https://api.ajstudioz.co.in/v1",
    apiKey: "YOUR_API_KEY",
  });
  ```

  ```python OpenAI Python SDK theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.ajstudioz.co.in/v1",
      api_key="YOUR_API_KEY"
  )
  ```
</CodeGroup>

***

## Environment Variables

We strongly recommend storing your API key in an environment variable:

```bash theme={null}
export AJSTUDIOZ_API_KEY="YOUR_API_KEY"
```

Then reference it in your code:

```python theme={null}
import os
from ollama import Client

client = Client(
    host="https://api.ajstudioz.co.in",
    headers={"Authorization": f"Bearer {os.environ['AJSTUDIOZ_API_KEY']}"}
)
```

***

## API Key Scopes

| Scope       | Description                                                |
| ----------- | ---------------------------------------------------------- |
| `inference` | Make model inference requests (chat, generate, embeddings) |
| `read`      | Read model information and usage stats                     |
| `admin`     | Full access including key management                       |

By default, new keys have `inference` + `read` access.

***

## Base URLs

| API Type          | Base URL                         |
| ----------------- | -------------------------------- |
| Ollama-compatible | `https://api.ajstudioz.co.in`    |
| OpenAI-compatible | `https://api.ajstudioz.co.in/v1` |

***

## Error Codes

| Code  | Meaning                             |
| ----- | ----------------------------------- |
| `401` | Invalid or missing API key          |
| `403` | API key doesn't have required scope |
| `429` | Rate limit exceeded                 |
| `503` | Model temporarily unavailable       |

<Card title="View Rate Limits" icon="gauge" href="/rate-limits" />
