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)

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, 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 an X-Balance-INR header so you can track credits spent in your own app.