Docs Menu & Search
Documentation
Quickstart
Signup to first response, in five steps.
1. Create an Account
Sign up for nabh.cloud. You will receive 50 free credits instantly — no card required — which is enough for thousands of requests on the free models.
2. Create an API Key
In the dashboard, go to API Keys and create a key. Your key is shown only once,
begins with nbh_, and is tied to your account’s credits. Store it securely — anyone
with the key can spend your credits.
3. Install an SDK (Optional)
The API is OpenAI-compatible, so you can use the official OpenAI libraries:
pip install openainpm install openai4. Make Your First Request
Point the client at https://api.nabh.cloud/v1 and pass your key. This example uses
gpt-oss-20b, which is available on every plan.
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": "नभ क्या है?"}],
)
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: "gpt-oss-20b",
messages: [{ role: "user", content: "Hello from India!" }],
});
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": "gpt-oss-20b",
"messages": [{"role": "user", "content": "Hello!"}]
}'5. Read the Cost
Non-streaming responses include cost_inr (the credits this request used) and
balance_inr (your remaining credits) in the JSON body — the values are credits,
1 nabh credit = ₹1. Every response, streaming or not, also carries an X-Balance-INR header —
so you always know how many credits remain.
Streaming
Set stream: true to receive tokens as a server-sent event (SSE) stream, exactly like
the OpenAI API.
stream = client.chat.completions.create(
model="gpt-oss-20b",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="", flush=True)Next Steps
- Browse the full model catalogue and pricing.
- Learn about authentication and key security.
- Understand rate limits and error handling.