Skip to content

List gateways

GET
/domains/{domain}/gateways/
curl --request GET \
--url https://api.nsin.ir/domains/example.com/gateways/ \
--header 'Authorization: Bearer <token>'

Every gateway currently offered, each with whether it is switched on for this domain and, when it is, the record that was created for it — together with this domain’s gateway plan standing: whether gateways are included at all, and how much of the rolling 30-day request allowance has been used.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com

Gateway list and quota standing.

Media type application/json

The gateway catalog for one domain, plus that domain’s gateway quota.

Gateway traffic is metered separately from the domain’s own traffic: a plan allows a fixed number of gateway requests per ROLLING 30 days. There is no reset date — capacity returns gradually as older requests age out of the window. While the allowance is spent, only the gateway hostnames stop serving (they answer 429); the rest of the domain is unaffected.

object
items
Array<object>

One entry in the gateway catalog, plus whether it is switched on for the domain you asked about. The origin and upstream Host header behind a gateway are NSIN’s and are not exposed.

object
id

Pass this as gatewayId to switch the gateway on or off.

integer
title

Display name.

string
slug

Prefix of the generated hostname — the record is named <slug>-<5 digits>.

string
description

Short explanatory line. May be empty.

string
upstream

The service this gateway forwards to, e.g. api.openai.com. Sent as the Host header upstream. The origin address behind it is not exposed.

string
icon

Icon as a base64 data: URI, ready to use as an <img> source. May be empty.

string
enabled

Whether this gateway is currently on for this domain.

boolean
record

The record created for this gateway. Absent when enabled is false.

object
id

Record id.

integer
name

Name relative to the domain, e.g. chatgpt-84213.

string
original_name

Fully qualified name, e.g. chatgpt-84213.example.com.

string
available

Whether the domain’s plan includes gateways. When false, switching a new gateway on is refused; gateways already on stay listed and can still be switched off.

boolean
max_requests_30d

Requests allowed in the rolling 30-day window. Null means unlimited.

integer
nullable
requests_30d

Requests served by this domain’s gateways in the window, as of counted_at.

integer format: int64
quota_exceeded

Whether the allowance is currently spent, so the gateways are answering 429.

boolean
counted_at

When the count was last recomputed. Absent before the first count.

string format: date-time
dns_mode

This domain’s DNS mode. Gateways need managed: on an external domain the record would live in a zone NSIN does not serve, so switching one on is refused whatever the plan says. Gateways already on stay listed and can still be switched off.

string
Allowed values: managed external
Example
{
"items": [
{
"upstream": "api.push.apple.com"
}
],
"dns_mode": "managed"
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}