Skip to main content
POST
/
v1
/
chat
/
completions
Chat Completions
curl --request POST \
  --url https://api.ajstudioz.co.in/v1/chat/completions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {}
  ],
  "stream": true,
  "temperature": 123,
  "max_tokens": 123,
  "top_p": 123,
  "stop": {},
  "tools": [
    {}
  ],
  "tool_choice": {},
  "response_format": {}
}
'
{
  "id": "chatcmpl-abc123xyz",
  "object": "chat.completion",
  "created": 1751760000,
  "model": "gemma3:27b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 9,
    "total_tokens": 23
  }
}

Documentation Index

Fetch the complete documentation index at: https://student-213fb9fc.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Create a chat completion using the OpenAI-compatible API format. Works with any OpenAI SDK, LangChain, LlamaIndex, and tools like Cursor or Continue.

Request

Headers

Authorization
string
required
Bearer token: Bearer YOUR_API_KEY

Body

model
string
required
Model identifier. See available models. Example: "gemma3:27b", "deepseek-v3.2".
messages
array
required
Array of message objects:
  • role"system", "user", or "assistant"
  • content — message text (or array of content objects for vision)
stream
boolean
default:"false"
If true, returns a stream of text/event-stream Server-Sent Events.
temperature
number
default:"1"
Sampling temperature between 0 and 2. Higher = more random, lower = more focused.
max_tokens
integer
Maximum number of tokens to generate. If unset, uses model default.
top_p
number
default:"1"
Nucleus sampling probability mass. Use with temperature not both.
stop
string or array
Up to 4 sequences where the model will stop generating tokens.
tools
array
List of tool definitions for function calling. Each tool has type: "function" and a function object with name, description, and parameters (JSON Schema).
tool_choice
string or object
default:"auto"
Controls how the model responds to tools. Values: "none", "auto", or {"type": "function", "function": {"name": "..."}}
response_format
object
Set to {"type": "json_object"} to enable JSON mode.

Response

id
string
Unique identifier for this completion.
object
string
"chat.completion" or "chat.completion.chunk" for streaming.
created
integer
Unix timestamp when the completion was created.
model
string
The model used.
choices
array
Array of completion choices. Usually one unless n > 1:
  • index — choice index
  • message.role"assistant"
  • message.content — generated text
  • finish_reason"stop", "length", or "tool_calls"
usage
object
Token usage statistics:
  • prompt_tokens
  • completion_tokens
  • total_tokens

Examples

from openai import OpenAI

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

response = client.chat.completions.create(
    model="gemma3:27b",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing briefly."}
    ],
    temperature=0.7,
    max_tokens=512
)

print(response.choices[0].message.content)
{
  "id": "chatcmpl-abc123xyz",
  "object": "chat.completion",
  "created": 1751760000,
  "model": "gemma3:27b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 9,
    "total_tokens": 23
  }
}