Skip to content
Docs Menu & Search

Documentation

Request Parameters

Which chat request fields nabh.cloud checks, which it passes to the model, and the defaults.

POST /v1/chat/completions takes the same body as OpenAI’s Chat Completions API. nabh.cloud checks a few fields itself, because they decide what a request can cost. Every other field goes to the model exactly as you sent it.

Fields nabh.cloud Checks

FieldRule
modelRequired. A model ID from Models. If your plan doesn’t include the model, the request returns 403 PERMISSION_DENIED.
max_tokens, max_completion_tokensOptional. The most output tokens to generate: a whole number from 1 to 32,000. With neither field, the cap is 4,096. If you send both, max_completion_tokens wins. Any other value returns 400 INVALID_REQUEST; a value is never silently lowered.
nOptional. How many answers to generate, from 1 to 8 (default 1). Every answer is billed.
streamtrue streams the answer as server-sent events. nabh.cloud adds stream_options: {"include_usage": true}, so the last chunk carries the token counts. See Streaming.

Before a request starts, your balance must cover an estimate of the input plus the full output cap for every answer, so a lower max_tokens needs fewer credits to begin. You’re billed only for the tokens actually used.

Fields Passed to the Model

temperature, top_p, stop, seed, presence_penalty, frequency_penalty, logit_bias, tools, tool_choice, response_format and any other field go to the model unchanged. nabh.cloud sets no defaults of its own for them: each model uses its own.

Support varies by model. A field one model honours, another may ignore. For tools and JSON output, each model’s page shows Supported, Not Supported or Unverified; seeTools & Structured Output.

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": "Give me three names for a chai stall."}],
    "temperature": 0.9,
    "top_p": 0.95,
    "max_tokens": 300,
    "stop": ["4."]
  }'

Reasoning Models

Models tagged Reasoning may think before they answer, and thinking tokens count toward max_tokens and are billed as output. Leave room for them: 2,000 or more, or leave max_tokens unset. A reply cut off by the cap ends with finish_reason: "length".

medha returns its thinking in reasoning_content and the answer in content. For a faster, cheaper answer, turn thinking off for one request:

{
  "model": "medha",
  "messages": [{ "role": "user", "content": "Translate 'good morning' into Hindi." }],
  "chat_template_kwargs": { "enable_thinking": false }
}

Other Endpoints

Download on the App StoreGet it on Google Play