An OpenAI-compatible endpoint for Madhuram-v0.6. If your code already talks to OpenAI, changing two lines is enough.
Create an API key from the chat interface, sign in, open Settings → API, and select Create API key. The key is shown once and cannot be retrieved afterwards, so store it somewhere safe.
from openai import OpenAI client = OpenAI( api_key="YOUR_KEY", base_url="https://api.maruthlabs.com/v1" ) response = client.chat.completions.create( model="madhuram", messages=[{"role": "user", "content": "Explain gradient descent in two sentences."}] ) print(response.choices[0].message.content)
curl https://api.maruthlabs.com/v1/chat/completions \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "madhuram", "messages": [{"role": "user", "content": "Hello"}] }'
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_KEY", baseURL: "https://api.maruthlabs.com/v1" }); const r = await client.chat.completions.create({ model: "madhuram", messages: [{ role: "user", content: "Hello" }] }); console.log(r.choices[0].message.content);
Every request requires a bearer token in the Authorization header:
Authorization: Bearer sk-mrth-...
Keys are issued per account, one active key at a time. Regenerating a key revokes the previous one immediately. Only a hash of your key is stored on our side, which means we cannot recover it for you, if it is lost, generate a new one.
Base URL: https://api.maruthlabs.com/v1
Generates a completion for a conversation. Accepts and returns the standard OpenAI chat-completions shape, with or without streaming.
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1785312496,
"model": "madhuram",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 57,
"completion_tokens": 10,
"total_tokens": 67
}
}
Lists available models.
{
"object": "list",
"data": [{ "id": "madhuram", "object": "model", "owned_by": "maruthlabs" }]
}
Returns your consumption against the current day's quota.
{
"tier": "free",
"day": "2026-07-29",
"requests_used": 12,
"requests_limit": 1000,
"tokens_used": 4820,
"tokens_limit": 200000,
"resets": "00:00 UTC"
}
| Parameter | Type | Description |
|---|---|---|
messages |
array | Required. Conversation history. Each entry has a role (system, user, or assistant) and content. |
model |
string | Use "madhuram". Other values are ignored. |
max_tokens |
integer | Maximum tokens to generate. Capped at 4096. Values of -1 or 0 are treated as "use the maximum". |
temperature |
number | Sampling temperature. Lower is more deterministic; higher is more varied. |
top_p |
number | Nucleus sampling threshold. |
top_k |
integer | Restricts sampling to the k most likely tokens. |
repetition_penalty |
number | Multiplicative penalty on repeated tokens. 1.0 is neutral; useful range is roughly 1.0 to 1.3. |
presence_penaltyfrequency_penalty |
number | Additive OpenAI-style penalties. Do not stack these with repetition_penalty or output degrades. |
stop |
string / array | Sequences that halt generation. A bare string is accepted and normalised. |
seed |
integer | Seeds sampling for reproducible output. |
stream |
boolean | Streams tokens as server-sent events. Defaults to false. |
Set stream: true to receive tokens as they are generated, in the standard OpenAI server-sent-event format terminated by data: [DONE].
stream = client.chat.completions.create( model="madhuram", messages=[{"role": "user", "content": "Write a haiku about servers."}], stream=True ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="", flush=True)
Free-tier limits, applied per account:
| Limit | Value | Window |
|---|---|---|
Requests per minute | 60 | Rolling |
Requests per day | 1,000 | Resets 00:00 UTC |
Tokens per day | 200,000 | Resets 00:00 UTC |
Max tokens per request | 4,096 | Per request |
Context window | 16,384 | Prompt + completion |
Responses carry X-RateLimit-Remaining-Requests and X-RateLimit-Remaining-Tokens headers so clients can self-throttle. Building something that needs more? Get in touch, higher limits are available on request.
| Status | Meaning | What to do |
|---|---|---|
400 |
Malformed request | Check that messages is present and well-formed, and that the prompt fits the context window. |
401 |
Missing, invalid, or revoked key | Verify the Authorization header. If the key was regenerated, update it. |
429 |
Rate limit or daily quota exceeded | Back off and retry. The Retry-After header gives the wait in seconds. |
503 |
Inference backend unavailable | Transient. Retry with exponential backoff. |
Requests and responses are recorded for usage metering, debugging, and abuse investigation. They are used to train future models only if you opt in, the setting is off by default and can be changed at any time under Settings → API in the chat interface.
The API is free for Madhuram-v0.6. We will give notice before introducing pricing.