NezhaGate
API Documentation

NezhaGate API Developer Docs

An OpenAI-compatible AI Gateway — one endpoint for the full catalogue: GPT-5.5, the Gemini chat family and gpt-image generation. Readable by humans, and one-click copyable for AI coding assistants.

Quick Start

Just swap in the Base URL and API Key, and your existing OpenAI SDK works out of the box.

Base URL
https://nezhagate.com/v1
curl · Chat API: Chat Completions
curl https://nezhagate.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": "Write a short product intro for an AI API"}], "stream": false}'

Full request parameters, examples and async usage for each model live in that model's own doc — open it from the Models & pricing table below.

More runnable examples (Python / Node / curl, including the async image and video flow): github.com/gaoorange/nezhagate-api-examples

Authentication

All API calls require a Bearer Token.

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

Models & Pricing

Full request parameters, examples and async usage for each model live in that model's own doc — open it from the Models & pricing table below.

ModelCapabilityEndpointPrice
gpt-5.6-solFrontier reasoning, agentic coding, long-horizon tasks, structured output/chat/completions Input $2.0/1M · Output $12.0/1M API Docs →
gpt-5.6-terraEveryday chat, agentic coding, reasoning, structured output/chat/completions Input $1.2/1M · Output $7.0/1M API Docs →
gpt-5.6-lunaHigh-speed chat, agentic coding, high-volume low-latency, structured output/chat/completions Input $0.8/1M · Output $4.8/1M API Docs →
gpt-5.5Chat, reasoning, agents, structured output/chat/completions Input $0.7/1M · Output $4.2/1M API Docs →
gpt-6-astraDeep reasoning, agentic coding, very long context, image input, structured output/chat/completions Input $2.8/1M · Output $14.0/1M API Docs →
gpt-image-2Text-to-image, image-to-image, covers, posters, illustrations/images/generations 1K $0.015 · 2K $0.025 · 4K $0.04 API Docs →
gpt-image-2.5-flareText-to-image, image-to-image, covers, posters, illustration, typography/images/generations 1K $0.015 · 2K $0.025 · 4K $0.04 API Docs →
gpt-image-2.5-sunburstText-to-image, image-to-image, covers, posters, illustration, typography/images/generations 1K $0.015 · 2K $0.025 · 4K $0.04 API Docs →
nano-banana-2Text-to-image, image-to-image, covers, posters, illustrations/images/generations 1K $0.025 · 2K $0.0375 · 4K $0.0625 API Docs →
nano-banana-proText-to-image, image-to-image, covers, posters, illustrations, infographics/images/generations 1K $0.04 · 2K $0.06 · 4K $0.1 API Docs →
claude-sonnet-4-6Chat, code, reasoning, long context/chat/completions Input $1.5/1M · Output $7.5/1M API Docs →
claude-opus-5Deep reasoning, code, agents, long context, image understanding/chat/completions Input $4.0/1M · Output $20.0/1M API Docs →
claude-fable-5Chinese writing, narrative creation, long-form generation, chat, code, image understanding/chat/completions Input $8.0/1M · Output $40.0/1M API Docs →
gemini-3.1-proChat, reasoning, very long context, multimodal/chat/completions Input $0.5/1M · Output $3.0/1M API Docs →
gemini-3.8-flashChat, reasoning, adaptive thinking, image input, very long context/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3.7-flashChat, reasoning, adaptive thinking, image input, very long context/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3.6-flashChat, reasoning, thinking, image input, very long context/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3.6-flash-highDeep reasoning, complex tasks, thinking, image input, very long context/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3.6-flash-lowHigh-speed chat, high volume, low latency, image input/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3.6-flash-tieredAdaptive thinking, chat, reasoning, image input/chat/completions Input $0.6/1M · Output $3.6/1M API Docs →
gemini-3-flash-previewChat, reasoning, high concurrency, low latency/chat/completions Input $0.3/1M · Output $1.2/1M API Docs →
gemini-3.5-flashChat, reasoning, high concurrency, low latency, thinking/chat/completions Input $0.45/1M · Output $2.7/1M API Docs →
gemini-2.5-flashChat, high concurrency, low latency, multimodal/chat/completions Input $0.3/1M · Output $1.2/1M API Docs →
veo-3.1Text-to-video, image-to-video, short clips, commercial footage/videos/generations $0.075 /clip+ API Docs →
seedance-2.5Long-take short films, multi-reference input, commercial footage/videos/generations $0.158 /s API Docs →
seedance-2.0Short clips, commercial assets/videos/generations $0.15 /s API Docs →
seedance-2.0-fastBulk assets, quick concept checks/videos/generations $0.1 /s API Docs →
seedance-2.0-miniHigh-volume drafts, low-cost iteration/videos/generations $0.066 /s API Docs →
wan3.0-videoLong-take storytelling, multi-asset composition, video rewriting/videos/generations $0.12 /s API Docs →
wan3.0-video-primeDeadline footage, batch test shoots/videos/generations $0.16 /s API Docs →
minimax-h3HD footage, short clips with sound/videos/generations $0.036 /s API Docs →
grok-imagine-video-1.5Bulk short videos, quick concept checks/videos/generations $0.3 /clip+ API Docs →

Use it in an app (no code)

In any app that speaks the OpenAI API, fill in these three fields — no programming needed:

API base URLhttps://nezhagate.com/v1
API keythe key you create in the console (Console → API Keys → Copy)
Model namegpt-5.6-sol gpt-5.6-terra gpt-5.6-luna gpt-5.5 gpt-6-astra gpt-image-2 gpt-image-2.5-flare gpt-image-2.5-sunburst nano-banana-2 nano-banana-pro claude-sonnet-4-6 claude-opus-5 claude-fable-5 gemini-3.1-pro gemini-3.8-flash gemini-3.7-flash gemini-3.6-flash gemini-3.6-flash-high gemini-3.6-flash-low gemini-3.6-flash-tiered gemini-3-flash-preview gemini-3.5-flash gemini-2.5-flash veo-3.1 seedance-2.5 seedance-2.0 seedance-2.0-fast seedance-2.0-mini wan3.0-video wan3.0-video-prime minimax-h3 grok-imagine-video-1.5

Verified with ChatBox, Cherry Studio, NextChat, LobeChat, Immersive Translate, Open WebUI, etc.

Native Anthropic API (Claude Code)

Beyond the OpenAI-compatible route, Claude models also expose the native Anthropic Messages API. Point Claude Code (or any Anthropic SDK) at the base URL below and use your gateway key as x-api-key — thinking, tool use and prompt caching are all preserved natively.

Claude Code · env
export ANTHROPIC_BASE_URL=https://nezhagate.com/anthropic
export ANTHROPIC_API_KEY=YOUR_API_KEY
# claude-sonnet-4-6 / claude-opus-5 / claude-fable-5
curl · /anthropic/v1/messages
curl https://nezhagate.com/anthropic/v1/messages -H "x-api-key: YOUR_API_KEY" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" -d '{"model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

Models: claude-opus-5, claude-fable-5, claude-sonnet-4-6. Billed exactly like /v1, per token.

Prompt-cache billing: cache hits (cache read) are billed at 1/10 (0.1×) of the input rate, cache writes at 1.25× (per-model rates on the pricing page). A hit needs a stable, long-enough prefix (Claude Opus ≥ 4096 tokens, Sonnet ≥ 2048) repeated within a short window — Claude Code with a large CLAUDE.md / system prompt over a real codebase hits every turn, cutting input cost to ~1/10. Short Playground chats are too small to cache.

Video Generation (async)

Text-to-video / image-to-video are async jobs: the call returns HTTP 202 + a job id immediately ({"id":"img_...","object":"video.generation.job","status":"queued"}); poll GET /v1/videos/jobs/{id} until status=succeeded, result in data[0].url (a re-hosted mp4). 1-12 min per clip. Two billing modes: Veo 3.1 is billed per clip; Seedance 2.x and MiniMax H3 are billed per second (rate x duration). Both hold exactly what they settle and refund in full on failure. Set the aspect ratio via size (16:9 landscape is the default); for image-to-video pass a first-frame reference in image.

curl · submit
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "veo-3.1", "prompt": "a cat surfing at sunset", "tier": "quality", "resolution": "1080p", "size": "16:9", "duration": "8s"}'
curl · poll
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'

Video models: veo-3.1 seedance-2.5 seedance-2.0 seedance-2.0-fast seedance-2.0-mini wan3.0-video wan3.0-video-prime minimax-h3 grok-imagine-video-1.5

Integration Notes to Copy for AI

Send the whole block below to Codex / Claude Code / Cursor and it will know how to integrate. You can also use “Copy Page” in the top right to copy the entire doc.

AI Integration Prompt
Integrate NezhaGate through its OpenAI-compatible API.
Base URL: https://nezhagate.com/v1
API Key: read it from the environment variable NEZHAAPI_KEY.
Claude models can also use the native Anthropic protocol (for Claude Code / the Anthropic SDK): ANTHROPIC_BASE_URL=https://nezhagate.com/anthropic, headers x-api-key=API Key and anthropic-version: 2023-06-01, POST /anthropic/v1/messages (max_tokens is required), models claude-sonnet-4-6 / claude-opus-5 / claude-fable-5.
Chat models (/chat/completions): gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna / gpt-5.5 / gpt-6-astra / claude-sonnet-4-6 / claude-opus-5 / claude-fable-5 / gemini-3.1-pro / gemini-3.8-flash / gemini-3.7-flash / gemini-3.6-flash / gemini-3.6-flash-high / gemini-3.6-flash-low / gemini-3.6-flash-tiered / gemini-3-flash-preview / gemini-3.5-flash / gemini-2.5-flash
Image models (text-to-image /images/generations; image-to-image /images/edits or add an image parameter): gpt-image-2 / gpt-image-2.5-flare / gpt-image-2.5-sunburst / nano-banana-2 / nano-banana-pro
Video models (text-to-video /videos/generations, async jobs; add an image parameter for image-to-video, the image becomes the first frame): veo-3.1 / seedance-2.5 / seedance-2.0 / seedance-2.0-fast / seedance-2.0-mini / wan3.0-video / wan3.0-video-prime / minimax-h3 / grok-imagine-video-1.5
Auth: Authorization: Bearer YOUR_API_KEY
Requirements (chat): return choices[0].message.content; on 401 check the key, 402 means insufficient balance, 429/5xx can be retried.
Requirements (images, async): POST /images/generations or /images/edits returns HTTP 202 with a job id right away ({"id":"img_...","object":"image.generation.job","status":"queued"}); then poll GET /v1/images/jobs/{id} until status=succeeded and read data[0].url (a stable link on img.nezhagate.com). Do not read data right after submitting.
Requirements (video, async): POST /videos/generations returns HTTP 202 with a job id (object=video.generation.job); then poll GET /v1/videos/jobs/{id} until status=succeeded and read data[0].url (a stable re-hosted mp4 link). About 1-2 minutes per clip; failed jobs are refunded in full.

Check balance & usage

Use any API key to read the account remaining balance and spend — no dashboard login needed. Simplest: GET /v1/usage. Also OpenAI-compatible: /v1/dashboard/billing/credit_grants (balance = total_available).

curl · /v1/usage
curl https://nezhagate.com/v1/usage -H "Authorization: Bearer YOUR_API_KEY"
curl · /v1/dashboard/billing/credit_grants
curl https://nezhagate.com/v1/dashboard/billing/credit_grants -H "Authorization: Bearer YOUR_API_KEY"

Error Codes

Status CodeMeaningHow to Handle
401API Key missing or invalidCheck the Authorization header
402Insufficient balance or Key over quotaContact the admin to top up
400Unsupported model or parameterUse only gpt-5.5 / gpt-image-2
429Upstream rate limitRetry later
502All upstream routes failedWait for recovery or contact the admin