NezhaGate
POST https://nezhagate.com/v1/chat/completions

OpenAI-compatible chat completions backed by GPT-6 Astra, the next-generation OpenAI flagship: a 1,050,000-token context, up to 128,000 output tokens, reasoning_effort up to xhigh, image input, tool calling and prompt caching. Set model to gpt-6-astra; the same model is also served on /v1/responses. Cached input settles at one tenth of the input rate. This model also returns a reasoning summary: choices[].message.reasoning_content when non-streaming, choices[].delta.reasoning_content when streaming. The answer itself stays in content and is never mixed with the reasoning, so clients that only read content need no changes. When reasoning_effort is omitted the gateway requests the medium tier (the model's own default) and the summary comes back all the same. Billing: thinking tokens are charged at the output rate and are included in usage.completion_tokens; usage.completion_tokens_details.reasoning_tokens breaks out how many were reasoning -- those tokens are billed whether or not you read the field. Note that OpenAI exposes only a summary of the reasoning, never the raw chain of thought, so this field is usually short. Note: this model is served over a ChatGPT-subscription upstream that does not accept temperature / top_p / max_tokens / max_completion_tokens / frequency_penalty / presence_penalty -- sending them is silently ignored (no error). Use reasoning_effort for thinking depth and prompt wording for length. For image input use a base64 data: URI; a public image URL may time out upstream.

📥 Context window (max input):1,050,000 tokens (OpenAI published figure); up to 128,000 output tokens per call. System-prompt overhead counts toward it.

Try in Playground →

Authentication

Header
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Create an API Key in the console to start.

Request body

ParameterTypeRequiredDescription
model string Yes Model ID, here gpt-6-astra.
messages array Yes Array of messages; each has role (system/user/assistant) and content. content may be a string, or an array of {type:text} and {type:image_url} parts for image understanding (multimodal/vision).
stream boolean No Stream the response as SSE. Default false.
web_search boolean No Set true to enable web search: the gateway augments the prompt with live results (citing sources) before the model answers. Can also be triggered via a tools entry {"type":"web_search"}.
reasoning_effort string No Reasoning effort: low / medium / high / xhigh — trades thinking depth for speed (GPT-5.x only). Lower effort = faster responses. When omitted the gateway requests medium, the model's own default.
tools array No Function calling. Pass the standard OpenAI tools array; when the model decides to call one it returns finish_reason=tool_calls with tool_calls. Pair with tool_choice to force a specific tool.
response_format object No Structured output. Pass {"type":"json_object"} to make the model return valid JSON only.

Request example

cURL
curl https://nezhagate.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-6-astra", "messages": [{"role": "user", "content": "Hello"}], "stream": false}'

Response

200 · JSON
{
  "id": "chatcmpl_xxx",
  "object": "chat.completion",
  "model": "gpt-6-astra",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": "**Weighing the options** ... (a summary of how the model reasoned)",
        "content": "Hello!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 11,
    "completion_tokens": 105,
    "total_tokens": 116,
    "completion_tokens_details": {"reasoning_tokens": 43}
  }
}

Image input (Vision)

Put an image in the message content array and the model will analyze it (visual Q&A, reading text / OCR, …). image_url accepts a public image link or an inline base64 data URL (data:image/png;base64,...). Available on multimodal models (gpt-5.5, gemini series, …).

curl · Image input (Vision)
curl https://nezhagate.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-6-astra", "messages": [{"role": "user", "content": [{"type": "text", "text": "What is in this picture?"}, {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}]}]}'

Error codes

CodeDescription
401API Key missing or invalid
402Insufficient balance or Key over quota
400Unsupported model or parameter
429Upstream rate limit
502All upstream routes failed