> ## 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.

# OpenAI Compatibility

> Use AJ STUDIOZ Cloud Infra with any OpenAI SDK or tool

## Overview

AJ STUDIOZ Cloud Infra exposes an **OpenAI-compatible REST API** at `https://api.ajstudioz.co.in/v1`. This means any tool, SDK, or library that supports OpenAI can be pointed at our API with minimal changes.

***

## Base URL

```
https://api.ajstudioz.co.in/v1
```

Replace `https://api.openai.com/v1` with the above URL in any OpenAI SDK or configuration.

***

## Python SDK

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

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

# Chat completions
response = client.chat.completions.create(
    model="gemma3:27b",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is machine learning?"}
    ],
    temperature=0.7,
    max_tokens=500
)
print(response.choices[0].message.content)
```

***

## Node.js SDK

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

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

const response = await openai.chat.completions.create({
  model: "deepseek-v3.2",
  messages: [
    { role: "user", content: "Explain neural networks briefly." }
  ],
});

console.log(response.choices[0].message.content);
```

***

## Supported OpenAI Endpoints

| OpenAI Endpoint                 | AJ STUDIOZ Equivalent       | Status          |
| ------------------------------- | --------------------------- | --------------- |
| `POST /v1/chat/completions`     | `POST /v1/chat/completions` | ✅ Supported     |
| `POST /v1/completions`          | `POST /v1/completions`      | ✅ Supported     |
| `GET /v1/models`                | `GET /v1/models`            | ✅ Supported     |
| `POST /v1/embeddings`           | `POST /v1/embeddings`       | ✅ Supported     |
| `POST /v1/images/generations`   | —                           | ❌ Not supported |
| `POST /v1/audio/transcriptions` | —                           | ❌ Not supported |

***

## Chat Completions Parameters

All standard OpenAI parameters are supported:

| Parameter           | Type         | Description                    |
| ------------------- | ------------ | ------------------------------ |
| `model`             | string       | Model name (e.g. `gemma3:27b`) |
| `messages`          | array        | Chat history                   |
| `temperature`       | float        | Sampling temperature (0–2)     |
| `max_tokens`        | integer      | Maximum tokens to generate     |
| `stream`            | boolean      | Enable streaming               |
| `top_p`             | float        | Nucleus sampling               |
| `frequency_penalty` | float        | Frequency penalty              |
| `presence_penalty`  | float        | Presence penalty               |
| `stop`              | string/array | Stop sequences                 |
| `n`                 | integer      | Number of completions          |

***

## Tool / Function Calling

Function calling is supported for capable models:

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

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

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a city",
            "parameters": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string",
                        "description": "The city name"
                    }
                },
                "required": ["city"]
            }
        }
    }
]

response = client.chat.completions.create(
    model="qwen3-coder:480b",
    messages=[{"role": "user", "content": "What's the weather in Paris?"}],
    tools=tools,
    tool_choice="auto"
)
print(response.choices[0].message.tool_calls)
```

***

## Using with Popular Frameworks

### LangChain

```python theme={null}
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gemma3:27b",
    base_url="https://api.ajstudioz.co.in/v1",
    api_key="YOUR_API_KEY"
)

response = llm.invoke("What is the meaning of life?")
print(response.content)
```

### LlamaIndex

```python theme={null}
from llama_index.llms.openai import OpenAI

llm = OpenAI(
    model="deepseek-v3.2",
    api_base="https://api.ajstudioz.co.in/v1",
    api_key="YOUR_API_KEY"
)
```

### Cursor / Claude-Code / Windsurf

Set in settings:

* **API Base URL:** `https://api.ajstudioz.co.in/v1`
* **API Key:** Your AJ STUDIOZ API key
* **Model:** any model from the [model list](/models)
