API reference
NeuronGate is compatible with the OpenAI API format. Point any OpenAI SDK at our base URL and you are ready to go. Pay with crypto, access every model.
Quick start
- 1
Get an API key
Create an account and generate a key on the API keys page. Keys start with
sk-ng-. - 2
Fund your account
Deposit USDT, USDC, ETH or BTC. Your balance is debited per request at the listed model prices.
- 3
Make your first request
Send a chat completion to the base URL with your key:
curl https://neurongate.net/v1/chat/completions \
-H "Authorization: Bearer sk-ng-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-sol",
"messages": [
{"role": "user", "content": "Hello, NeuronGate!"}
]
}'Authentication
All API requests require authentication. NeuronGate API keys follow the format sk-ng-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. You can pass the key in two ways:
Authorization header (recommended)
Authorization: Bearer sk-ng-your-api-keyX-API-Key header
X-API-Key: sk-ng-your-api-keycurl https://neurongate.net/v1/chat/completions \
-H "Authorization: Bearer sk-ng-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-6-sol", "messages": [{"role": "user", "content": "Hi"}]}'Chat completions
/v1/chat/completionsCreates a chat completion. Compatible with the OpenAI chat completions API.
Request body
| Field | Type | Description |
|---|---|---|
| modelrequired | string | Model identifier, e.g. "openai/gpt-6-sol", "anthropic/claude-sonnet-5.5", "deepseek/deepseek-v4-pro". |
| messagesrequired | array | Array of message objects. Each has a "role" (system | user | assistant) and "content" (string). |
| stream | boolean | If true, returns a stream of server-sent events. Default: false. |
| temperature | number | Sampling temperature between 0 and 2. Higher values produce more random output. Default: 1. |
| max_tokens | integer | Maximum number of tokens to generate. If omitted, the model decides. |
| top_p | number | Nucleus sampling. An alternative to temperature. Default: 1. |
| stop | string | array | Up to 4 sequences where the model will stop generating further tokens. |
| frequency_penalty | number | Number between -2 and 2. Positive values penalise repeated tokens. Default: 0. |
| presence_penalty | number | Number between -2 and 2. Positive values penalise tokens already present. Default: 0. |
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1713000000,
"model": "openai/gpt-6-sol",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}Streaming
Set stream: true to receive server-sent events. Each event contains a delta object:
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1713000000,"model":"openai/gpt-6-sol","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1713000000,"model":"openai/gpt-6-sol","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1713000000,"model":"openai/gpt-6-sol","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Examples
curl https://neurongate.net/v1/chat/completions \
-H "Authorization: Bearer sk-ng-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-sol",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in one sentence."}
],
"temperature": 0.7,
"max_tokens": 100
}'List models
/v1/modelspublicReturns all active models with pricing, context window, and capability metadata. This endpoint is public — no API key required. Responses are cached for 60 seconds and support ETag-based 304 conditional requests.
Query parameters
| Field | Type | Description |
|---|---|---|
| provider | string | Comma-separated provider names to filter by, e.g. anthropic,openai |
| modality | string | Comma-separated capability shorthand: vision, audio, text |
| streaming | boolean | Filter by streaming support (true or false) |
| tools | boolean | Filter by tool / function-call support (true or false) |
| q | string | Search term matched against model id, name, and description |
| limit | integer | Max models to return (default 200, max 1000) |
| offset | integer | Number of models to skip for pagination (default 0) |
Response
{
"object": "list",
"total": 42,
"limit": 200,
"offset": 0,
"data": [
{
"id": "openai/gpt-6-sol",
"object": "model",
"created": 1713000000,
"owned_by": "openai",
"seo_slug": "gpt-6-sol",
"marketing_blurb": "GPT-6 Sol — OpenAI's mid-tier GPT-6 model for coding and agents.",
"context_window": 1050000,
"input_price_per_million": 5.0,
"output_price_per_million": 30.0,
"capabilities": {
"streaming": true,
"tools": true,
"vision": true,
"audio": false
}
}
]
}Examples
# No API key needed
curl https://neurongate.net/v1/modelsRate limits
Requests are rate-limited per API key. Spend limits are optional and off until you set them.
| Limit | Default | Description |
|---|---|---|
| Requests per minute | 60 | Maximum requests per minute per API key. |
| Daily spend | None | Optional cap on spend per day for the whole account. Set it in Settings → Spend limits. |
| Monthly spend | None | Optional cap per calendar month, for the account or per API key. |
When a rate limit is exceeded, the API returns a 429 status with a Retry-After header indicating when you can retry.
{
"error": {
"type": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please retry after 2 seconds.",
"code": 429
}
}Errors
NeuronGate uses standard HTTP status codes. Errors return a consistent JSON body.
| Status | Type | Description |
|---|---|---|
| 400 | bad_request | The request body is malformed or missing required fields. |
| 401 | unauthorized | Invalid or missing API key. |
| 402 | insufficient_funds | Your account balance is too low to process this request. |
| 404 | not_found | The requested model or resource does not exist. |
| 429 | rate_limit_exceeded | Too many requests or spend limit reached. Check Retry-After header. |
| 500 | internal_error | An unexpected error occurred on our side. Please retry. |
| 502 | upstream_error | The upstream model provider returned an error. Try again or use a different model. |
Error response format
{
"error": {
"type": "unauthorized",
"message": "Invalid API key. Please check your key and try again.",
"code": 401
}
}SDKs & libraries
NeuronGate is fully compatible with the OpenAI API. You do not need a custom SDK. Just use the official OpenAI library and point it at NeuronGate.
Python
pip install openaiNode.js / TypeScript
npm install openaiPython setup
from openai import OpenAI
client = OpenAI(
api_key="sk-ng-your-api-key",
base_url="https://neurongate.net/v1",
)
# Use exactly like the OpenAI SDK
response = client.chat.completions.create(
model="openai/gpt-6-sol",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
# Streaming works the same way
stream = client.chat.completions.create(
model="anthropic/claude-sonnet-5.5",
messages=[{"role": "user", "content": "Tell me a story."}],
stream=True,
)
for chunk in stream:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)Node.js setup
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-ng-your-api-key",
baseURL: "https://neurongate.net/v1",
});
// Use exactly like the OpenAI SDK
const response = await client.chat.completions.create({
model: "openai/gpt-6-sol",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
// Streaming works the same way
const stream = await client.chat.completions.create({
model: "deepseek/deepseek-v4-pro",
messages: [{ role: "user", content: "Tell me a story." }],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) process.stdout.write(content);
}https://neurongate.net/v1 and provide your NeuronGate API key.