Documentation

Quickstart

Signup to first response, in five steps.

1. Create an account

Sign up for nabh.cloud. You will receive ₹50 in 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 wallet. Store it securely — anyone with the key can spend your balance.

3. Install an SDK (optional)

The API is OpenAI-compatible, so you can use the official OpenAI libraries:

pip install openai

4. Make your first request

Point the client at https://api.nabh.cloud/v1 and pass your key. This example uses mistral-7b-instruct, 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="mistral-7b-instruct",
    messages=[{"role": "user", "content": "नभ क्या है?"}],
)
print(resp.choices[0].message.content)

5. Read the cost

Non-streaming responses include cost_inr and balance_inr in the JSON body. Every response, streaming or not, also carries an X-Balance-INR header — so you always know how much balance remains.

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="llama-3-70b-instruct",
    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