Docs Menu & Search
Documentation
SDKs & Libraries
nabh.cloud is OpenAI-compatible — use the tools you already know.
Use Any OpenAI-Compatible Client
The API implements the OpenAI Chat Completions specification. To use it with the official OpenAI SDKs,
change two things: the base URL to https://api.nabh.cloud/v1 and the API key to your
nbh_ key. Set the model field to a nabh.cloud model ID (see
Models).
from openai import OpenAI
client = OpenAI(
base_url="https://api.nabh.cloud/v1",
api_key="nbh_your_key_here",
)
resp = client.chat.completions.create(
model="gpt-oss-20b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.nabh.cloud/v1",
apiKey: "nbh_your_key_here",
});
const resp = await client.chat.completions.create({
model: "mistral-small-24b",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);curl https://api.nabh.cloud/v1/chat/completions \
-H "Authorization: Bearer nbh_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2-7-code",
"messages": [{"role": "user", "content": "Write a Python API"}]
}'Frameworks & Tools
Anything that lets you point at a custom OpenAI-compatible endpoint works out of the box — including LangChain, LlamaIndex, the Vercel AI SDK, and most OpenAI-compatible desktop and CLI tools. Just override the base URL and key.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://api.nabh.cloud/v1",
api_key="nbh_your_key_here",
model="gpt-oss-20b",
)
print(llm.invoke("Hello!").content)Notes
- Authenticate with
Authorization: Bearer nbh_...orX-API-Key: nbh_.... - Streaming is supported via
stream: true(server-sent events). - Chat completions, embeddings, and image generation are available; pick the right model for each.
- Non-streaming responses return
cost_inr/balance_inr(in credits, 1 nabh credit = ₹1) in the body; every response (including streaming) carries anX-Balance-INRheader so you can track credits spent in your own app.