Skip to content
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 yournbh_ key. Set the model field to a nabh.cloud model ID (seeModels).

The examples use gpt-oss-20b, which every plan can call, including Free. Most other models need the Developer plan (your first ₹500 recharge) or Pro; on a plan that doesn’t include the model, the request returns 403 PERMISSION_DENIED.

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)

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_... or X-API-Key: nbh_....
  • Streaming is supported via stream: true (server-sent events).
  • Chat completions, embeddings, image generation, text-to-speech and transcription 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 request that passes the key and balance checks (including streaming) carries an X-Balance-INR header so you can track credits spent in your own app.
Download on the App StoreGet it on Google Play