plaingateway
API reference

Current key

Read the calling key's spend limit and usage with GET /auth/key.

GET /auth/key returns the limit and usage of the key that sends the request. It never creates, lists or changes keys. No API does that: create and manage keys in the dashboard at /settings/keys. label shows the first 8 and last 3 characters of the key, for example sk-pg-v1...3fa. limit, limit_reset and limit_remaining are null when the key has no spend limit. usage is all the key has spent, in USD. usage_daily, usage_weekly and usage_monthly cover the last 1, 7 and 30 days. is_free_tier is always false: there is no free tier, and free_model_daily_requests is always 0. The byok_*, guardrail_id, budget_id and rate_limit fields exist for OpenRouter compatibility; they are always zero, null or fixed.

Request

sh
curl https://api.plaingateway.com/api/v1/auth/key \
  -H "Authorization: Bearer $PLAINGATEWAY_API_KEY"

Response

A key with a 50 USD monthly spend limit:

http
HTTP/1.1 200
{
  "data": {
    "label": "sk-pg-v1...3fa",
    "is_management_key": false,
    "is_provisioning_key": false,
    "limit": 50,
    "limit_reset": "monthly",
    "limit_remaining": 49.999164718,
    "include_byok_in_limit": false,
    "budgets": [
      {
        "scope": "key_limit",
        "guardrail_id": null,
        "budget_id": null,
        "limit_usd": 50,
        "spend_usd": 0.000835282,
        "remaining_usd": 49.999164718,
        "reset_interval": "monthly",
        "resets_at": "2026-11-01T00:00:00Z",
        "include_byok": false
      }
    ],
    "effective_budget": {
      "scope": "key_limit",
      "guardrail_id": null,
      "budget_id": null,
      "limit_usd": 50,
      "spend_usd": 0.000835282,
      "remaining_usd": 49.999164718,
      "reset_interval": "monthly",
      "resets_at": "2026-11-01T00:00:00Z",
      "include_byok": false
    },
    "usage": 0.000835282,
    "usage_daily": 0.000835282,
    "usage_weekly": 0.000835282,
    "usage_monthly": 0.000835282,
    "byok_usage": 0,
    "byok_usage_daily": 0,
    "byok_usage_weekly": 0,
    "byok_usage_monthly": 0,
    "is_free_tier": false,
    "expires_at": null,
    "creator_user_id": "10000000-0000-0000-0000-000000000001",
    "organization_id": null,
    "workspace_id": "10000000-0000-0000-0000-000000000001",
    "allowed_data_regions": [
      "global"
    ],
    "free_model_daily_requests": {
      "used": 0,
      "limit": 0,
      "remaining": 0
    },
    "rate_limit": {
      "requests": -1,
      "interval": "10s",
      "note": "This field is deprecated and safe to ignore."
    }
  }
}

Errors: 401 for a missing or unknown key, 503 when the billing store cannot be read.