nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Gateways

List gateways

gethttps://api.nsin.ir/domains/{domain}/gateways/

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

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 allowances (requests and egress bytes) has been used. Gateways switched on earlier whose catalog entry has since been withdrawn are listed too, marked retired, so they can still be switched off. Requires domain.view.

Each entry carries its icon inline as a base64 data: URI, which is most of the response's size. Pass icons=url to get a cacheable icon_url instead (see GET /gateway-presets/{presetId}/icon).

Path parameters

  • domainstringrequiredpath

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

Query parameters

  • iconsstringquery

    url returns icon_url instead of the inline icon.

    One of: "url"

Responses

200Gateway list and quota standing.

Content type: application/json

  • itemsarray of Gateway
    Item fields
    • idinteger

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

    • titlestring

      Display name.

    • slugstring

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

    • descriptionstring

      Short explanatory line. May be empty.

    • upstreamstring

      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.

    • iconstring

      Icon as a base64 data: URI, ready to use as an <img> source. May be empty. Empty when the list was asked for with icons=url.

    • icon_urlstring

      Only with icons=url: the icon's content-addressed path on the API origin (/gateway-presets/{id}/icon?v=…), cacheable for a year. Empty when the gateway has no icon.

    • categorystring

      Group the gateway is filed under on the Gateways page. Empty means uncategorised.

    • enabledboolean

      Whether this gateway is currently on for this domain.

    • blockedboolean

      The gateway is on but its hostname is answering 429 right now, because the domain's gateway allowance is spent (or its plan no longer includes gateways).

    • retiredboolean

      The gateway is no longer offered but is still on for this domain. It keeps working and can be switched off; it cannot be switched on again.

    • recordobject

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

      Fields
      • idinteger

        Record id.

      • namestring

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

      • original_namestring

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

  • availableboolean

    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.

  • max_requests_30dinteger | null

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

  • max_gb_30dinteger | null

    Egress allowed in the rolling 30-day window, in GB. Null means unlimited.

  • requests_30dinteger (int64)

    Requests served by this domain's gateways in the window, as of counted_at. The 429s the quota itself produces are not counted.

  • bytes_30dinteger (int64)

    Egress bytes served by the gateways in the same window. A meter for the allowance, not a separate charge — the bytes are billed as the domain's ordinary traffic.

  • quota_exceededboolean

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

  • quota_reasonstring

    Which allowance ran out. Absent while neither has.

    One of: "requests" "bytes"
  • counted_atstring (date-time)

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

  • dns_modestring

    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.

    One of: "managed" "external"
json
{
  "items": [
    {
      "id": 0,
      "title": "string",
      "slug": "string",
      "description": "string",
      "upstream": "api.push.apple.com",
      "icon": "string",
      "icon_url": "/gateway-presets/12/icon?v=3kx9q1m2r7a",
      "category": "string",
      "enabled": true,
      "blocked": true,
      "retired": true,
      "record": {
        "id": 0,
        "name": "string",
        "original_name": "string"
      }
    }
  ],
  "available": true,
  "max_requests_30d": 0,
  "max_gb_30d": 0,
  "requests_30d": 0,
  "bytes_30d": 0,
  "quota_exceeded": true,
  "quota_reason": "requests",
  "counted_at": "2026-01-01T00:00:00Z",
  "dns_mode": "managed"
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}

Example request

bash
curl -X GET "https://api.nsin.ir/domains/example.com/gateways/" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc