AI Coding Assistants
Use NexGate with Cursor, Windsurf, Claude Code, Continue.dev, and other OpenAI-compatible coding tools.
Overview
NexGate works with AI coding tools that let you configure an OpenAI-compatible base URL, API key, and model.
Note
Some tools do not support custom OpenAI-compatible endpoints. When a tool does not expose base URL settings, use a tool or extension that does.
OpenAI-compatible
Use https://api.nexgate.app/v1 as the base URL.
Track coding cost
Every coding request appears in usage logs with model, tokens, cost, and status.
Pick a model
Choose any model from the catalog or /api/models.
Keep keys private
Store ng- keys in local settings or server-side secrets, not in source control.
Quick setup
Sign in at nexgate.app, open the dashboard, and generate a key.
Use https://api.nexgate.app/v1 as the base URL.
Use any supported model ID, such as gpt-5.5. See the model catalog.
Check the usage dashboard or CSV export after a coding session.
Configuration by tool
- Open Cursor settings.
- Go to model or OpenAI API settings.
- Set base URL to
https://api.nexgate.app/v1. - Set API key to
ng-your-key. - Set model to
gpt-5.5or another direct model ID.
- Open Windsurf settings.
- Select a custom OpenAI-compatible endpoint.
- Set endpoint to
https://api.nexgate.app/v1. - Set API key to
ng-your-key. - Set model to
gpt-5.5or another direct model ID.
- Open model provider settings.
- Select OpenAI-compatible API if available.
- Set base URL to
https://api.nexgate.app/v1. - Set API key to
ng-your-key. - Use
gpt-5.5or another supported model.
{
"models": [
{
"title": "NexGate GPT-4.1 Mini",
"provider": "openai",
"model": "gpt-5.5",
"apiKey": "ng-your-key",
"apiBase": "https://api.nexgate.app/v1"
}
]
}Warning
GitHub Copilot does not support arbitrary custom model endpoints by default. Use only Copilot extensions or companion tools that explicitly support OpenAI-compatible endpoint configuration.
Recommended coding models
| Model | Best for | Input/1M | Output/1M |
|---|---|---|---|
gpt-5.5 | Best overall quality for coding, planning, and reviews | $5.00 | $30.00 |
gpt-5.4-mini | Balanced lower-cost default for agent workflows | $0.40 | $1.60 |
deepseek-v4-pro | Frontier DeepSeek with enhanced reasoning | $1.93 | $3.83 |
deepseek-v3.2 | Efficient coding & general chat | $0.28 | $0.42 |
deepseek-v4-flash | Low-cost lightweight tasks | $0.14 | $0.28 |
grok-4-3 | xAI Grok 4.3 flagship model | $1.25 | $2.50 |
grok-4-1-fast-reasoning | Fast reasoning at low cost | $0.20 | $0.50 |
kimi-k2.6 | Very long context agent chat (256K) | $0.95 | $4.00 |
llama-4-maverick | Open model, long context (512K) | $0.18 | $0.70 |
Tip
Reserve expensive frontier models for requests that need deeper reasoning, broader context, or higher review quality.
SDK examples
from openai import OpenAI
client = OpenAI(
api_key="ng-your-key",
base_url="https://api.nexgate.app/v1",
)
def generate_code(prompt: str) -> str:
response = client.chat.completions.create(
model="gpt-5.5",
messages=[
{"role": "system", "content": "You are an expert programmer."},
{"role": "user", "content": prompt},
],
max_tokens=1000,
)
return response.choices[0].message.content or ""import OpenAI from "openai";
const client = new OpenAI({
apiKey: "ng-your-key",
baseURL: "https://api.nexgate.app/v1",
});
async function generateCode(prompt: string): Promise<string> {
const response = await client.chat.completions.create({
model: "gpt-5.5",
messages: [
{ role: "system", content: "You are an expert programmer." },
{ role: "user", content: prompt },
],
max_tokens: 1000,
});
return response.choices[0].message.content ?? "";
}package main
import (
"context"
"github.com/sashabaranov/go-openai"
)
func main() {
cfg := openai.DefaultConfig("ng-your-key")
cfg.BaseURL = "https://api.nexgate.app/v1"
client := openai.NewClientWithConfig(cfg)
resp, _ := client.CreateChatCompletion(
context.Background(),
openai.ChatCompletionRequest{
Model: "gpt-5.5",
Messages: []openai.ChatCompletionMessage{
{Role: openai.ChatMessageRoleUser, Content: "Hello!"},
},
},
)
println(resp.Choices[0].Message.Content)
}Cost controls
Troubleshooting
| Error | Fix |
|---|---|
401 authentication_error | Check the API key and make sure it starts with ng- |
400 invalid_request_error | Check model ID, request body size, and parameter limits |
402 insufficient_credits | Add credits before retrying |
429 rate_limit_error | Raise the hourly spend safety limit or wait for the window to clear |
| Slow responses | Try deepseek-v4-flash, llama-4-scout, or another faster model |