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. 1

    Get an API key

    Create an account and generate a key on the API keys page. Keys start with sk-ng-.

  2. 2

    Fund your account

    Deposit USDT, USDC, ETH or BTC. Your balance is debited per request at the listed model prices.

  3. 3

    Make your first request

    Send a chat completion to the base URL with your key:

bash
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!"}
    ]
  }'
Same as OpenAI. NeuronGate implements the OpenAI-compatible chat completions API. If your code works with OpenAI, it works with NeuronGate. Just change the base URL and API key.

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)

text
Authorization: Bearer sk-ng-your-api-key

X-API-Key header

text
X-API-Key: sk-ng-your-api-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": "Hi"}]}'

Chat completions

POST/v1/chat/completions

Creates a chat completion. Compatible with the OpenAI chat completions API.

Request body

FieldTypeDescription
modelrequiredstringModel identifier, e.g. "openai/gpt-6-sol", "anthropic/claude-sonnet-5.5", "deepseek/deepseek-v4-pro".
messagesrequiredarrayArray of message objects. Each has a "role" (system | user | assistant) and "content" (string).
streambooleanIf true, returns a stream of server-sent events. Default: false.
temperaturenumberSampling temperature between 0 and 2. Higher values produce more random output. Default: 1.
max_tokensintegerMaximum number of tokens to generate. If omitted, the model decides.
top_pnumberNucleus sampling. An alternative to temperature. Default: 1.
stopstring | arrayUp to 4 sequences where the model will stop generating further tokens.
frequency_penaltynumberNumber between -2 and 2. Positive values penalise repeated tokens. Default: 0.
presence_penaltynumberNumber between -2 and 2. Positive values penalise tokens already present. Default: 0.

Response

json
{
  "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:

text
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

GET/v1/modelspublic

Returns 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

FieldTypeDescription
providerstringComma-separated provider names to filter by, e.g. anthropic,openai
modalitystringComma-separated capability shorthand: vision, audio, text
streamingbooleanFilter by streaming support (true or false)
toolsbooleanFilter by tool / function-call support (true or false)
qstringSearch term matched against model id, name, and description
limitintegerMax models to return (default 200, max 1000)
offsetintegerNumber of models to skip for pagination (default 0)

Response

json
{
  "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/models

Rate limits

Requests are rate-limited per API key. Spend limits are optional and off until you set them.

LimitDefaultDescription
Requests per minute60Maximum requests per minute per API key.
Daily spendNoneOptional cap on spend per day for the whole account. Set it in Settings → Spend limits.
Monthly spendNoneOptional 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.

json
{
  "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.

StatusTypeDescription
400bad_requestThe request body is malformed or missing required fields.
401unauthorizedInvalid or missing API key.
402insufficient_fundsYour account balance is too low to process this request.
404not_foundThe requested model or resource does not exist.
429rate_limit_exceededToo many requests or spend limit reached. Check Retry-After header.
500internal_errorAn unexpected error occurred on our side. Please retry.
502upstream_errorThe upstream model provider returned an error. Try again or use a different model.

Error response format

json
{
  "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

bash
pip install openai

Node.js / TypeScript

bash
npm install openai

Python setup

python
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

typescript
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);
}
Any OpenAI-compatible library works. LangChain, LlamaIndex, Vercel AI SDK, and other frameworks that support a custom base URL are all compatible. Just set the base URL to https://neurongate.net/v1 and provide your NeuronGate API key.